mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-07-24 13:12:03 +00:00
part 2 of many standardizing typedefed types to end in _t
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1294 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -36,11 +36,11 @@
|
||||
|
||||
static const char modname[] = "mod_bridgecall";
|
||||
|
||||
static void audio_bridge_function(switch_core_session *session, char *data)
|
||||
static void audio_bridge_function(switch_core_session_t *session, char *data)
|
||||
{
|
||||
switch_channel *caller_channel;
|
||||
switch_core_session *peer_session;
|
||||
switch_caller_profile *caller_profile, *caller_caller_profile;
|
||||
switch_channel_t *caller_channel;
|
||||
switch_core_session_t *peer_session;
|
||||
switch_caller_profile_t *caller_profile, *caller_caller_profile;
|
||||
char chan_type[128] = { '\0' }, *chan_data;
|
||||
unsigned int timelimit = 60; /* probably a useful option to pass in when there's time */
|
||||
caller_channel = switch_core_session_get_channel(session);
|
||||
|
||||
@@ -43,10 +43,10 @@ static switch_status load_function(char *mod, char *out, size_t outlen)
|
||||
|
||||
static switch_status kill_function(char *dest, char *out, size_t outlen)
|
||||
{
|
||||
switch_core_session *session = NULL;
|
||||
switch_core_session_t *session = NULL;
|
||||
|
||||
if ((session = switch_core_session_locate(dest))) {
|
||||
switch_channel *channel = switch_core_session_get_channel(session);
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
switch_core_session_kill_channel(session, SWITCH_SIG_KILL);
|
||||
switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
|
||||
switch_core_session_rwunlock(session);
|
||||
@@ -61,7 +61,7 @@ static switch_status kill_function(char *dest, char *out, size_t outlen)
|
||||
|
||||
static switch_status transfer_function(char *cmd, char *out, size_t outlen)
|
||||
{
|
||||
switch_core_session *session = NULL;
|
||||
switch_core_session_t *session = NULL;
|
||||
char *argv[4] = {0};
|
||||
int argc = 0;
|
||||
|
||||
@@ -98,7 +98,7 @@ static switch_status transfer_function(char *cmd, char *out, size_t outlen)
|
||||
|
||||
static switch_status pause_function(char *cmd, char *out, size_t outlen)
|
||||
{
|
||||
switch_core_session *session = NULL;
|
||||
switch_core_session_t *session = NULL;
|
||||
char *argv[4] = {0};
|
||||
int argc = 0;
|
||||
|
||||
@@ -111,7 +111,7 @@ static switch_status pause_function(char *cmd, char *out, size_t outlen)
|
||||
char *dest = argv[1];
|
||||
|
||||
if ((session = switch_core_session_locate(uuid))) {
|
||||
switch_channel *channel = switch_core_session_get_channel(session);
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
|
||||
if (!strcasecmp(dest, "on")) {
|
||||
switch_channel_set_flag(channel, CF_HOLD);
|
||||
|
||||
@@ -33,9 +33,9 @@
|
||||
|
||||
static const char modname[] = "mod_echo";
|
||||
|
||||
static void echo_function(switch_core_session *session, char *data)
|
||||
static void echo_function(switch_core_session_t *session, char *data)
|
||||
{
|
||||
switch_channel *channel;
|
||||
switch_channel_t *channel;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
assert(channel != NULL);
|
||||
|
||||
@@ -39,7 +39,7 @@ static const char modname[] = "mod_ivrtest";
|
||||
dtmf handler function you can hook up to be executed when a digit is dialed during playback
|
||||
if you return anything but SWITCH_STATUS_SUCCESS the playback will stop.
|
||||
*/
|
||||
static switch_status on_dtmf(switch_core_session *session, char *dtmf, void *buf, unsigned int buflen)
|
||||
static switch_status on_dtmf(switch_core_session_t *session, char *dtmf, void *buf, unsigned int buflen)
|
||||
{
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Digits %s\n", dtmf);
|
||||
|
||||
@@ -49,7 +49,7 @@ static switch_status on_dtmf(switch_core_session *session, char *dtmf, void *buf
|
||||
}
|
||||
|
||||
|
||||
static void disast_function(switch_core_session *session, char *data)
|
||||
static void disast_function(switch_core_session_t *session, char *data)
|
||||
{
|
||||
void *x = NULL;
|
||||
memset((void *) x, 0, 1000);
|
||||
@@ -57,10 +57,10 @@ static void disast_function(switch_core_session *session, char *data)
|
||||
}
|
||||
|
||||
|
||||
static void dirtest_function(switch_core_session *session, char *data)
|
||||
static void dirtest_function(switch_core_session_t *session, char *data)
|
||||
{
|
||||
char *var, *val;
|
||||
switch_channel *channel;
|
||||
switch_channel_t *channel;
|
||||
switch_directory_handle dh;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
@@ -90,7 +90,7 @@ static void dirtest_function(switch_core_session *session, char *data)
|
||||
|
||||
}
|
||||
|
||||
static switch_status show_dtmf(switch_core_session *session, char *dtmf, void *buf, unsigned int buflen)
|
||||
static switch_status show_dtmf(switch_core_session_t *session, char *dtmf, void *buf, unsigned int buflen)
|
||||
{
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Digits %s\n", dtmf);
|
||||
|
||||
@@ -99,10 +99,10 @@ static switch_status show_dtmf(switch_core_session *session, char *dtmf, void *b
|
||||
|
||||
}
|
||||
|
||||
static void tts_function(switch_core_session *session, char *data)
|
||||
static void tts_function(switch_core_session_t *session, char *data)
|
||||
{
|
||||
switch_channel *channel;
|
||||
switch_codec *codec;
|
||||
switch_channel_t *channel;
|
||||
switch_codec_t *codec;
|
||||
char *mydata, *text = NULL, *voice_name = NULL, *tts_name = NULL;
|
||||
char buf[10] = "";
|
||||
char *argv[3];
|
||||
@@ -134,11 +134,11 @@ static void tts_function(switch_core_session *session, char *data)
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Done\n");
|
||||
}
|
||||
|
||||
static void ivrtest_function(switch_core_session *session, char *data)
|
||||
static void ivrtest_function(switch_core_session_t *session, char *data)
|
||||
{
|
||||
switch_channel *channel;
|
||||
switch_channel_t *channel;
|
||||
switch_status status = SWITCH_STATUS_SUCCESS;
|
||||
switch_codec *codec;
|
||||
switch_codec_t *codec;
|
||||
char buf[10] = "";
|
||||
char term;
|
||||
char say[128] = "";
|
||||
@@ -182,9 +182,9 @@ static void ivrtest_function(switch_core_session *session, char *data)
|
||||
}
|
||||
|
||||
|
||||
static switch_status my_on_hangup(switch_core_session *session)
|
||||
static switch_status my_on_hangup(switch_core_session_t *session)
|
||||
{
|
||||
switch_channel *channel;
|
||||
switch_channel_t *channel;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
assert(channel != NULL);
|
||||
@@ -194,7 +194,7 @@ static switch_status my_on_hangup(switch_core_session *session)
|
||||
|
||||
}
|
||||
|
||||
static const switch_state_handler_table state_handlers = {
|
||||
static const switch_state_handler_table_t state_handlers = {
|
||||
/*.on_init */ NULL,
|
||||
/*.on_ring */ NULL,
|
||||
/*.on_execute */ NULL,
|
||||
|
||||
@@ -37,7 +37,7 @@ static const char modname[] = "mod_playback";
|
||||
dtmf handler function you can hook up to be executed when a digit is dialed during playback
|
||||
if you return anything but SWITCH_STATUS_SUCCESS the playback will stop.
|
||||
*/
|
||||
static switch_status on_dtmf(switch_core_session *session, char *dtmf, void *buf, unsigned int buflen)
|
||||
static switch_status on_dtmf(switch_core_session_t *session, char *dtmf, void *buf, unsigned int buflen)
|
||||
{
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Digits %s\n", dtmf);
|
||||
|
||||
@@ -49,9 +49,9 @@ static switch_status on_dtmf(switch_core_session *session, char *dtmf, void *buf
|
||||
}
|
||||
|
||||
|
||||
static void playback_function(switch_core_session *session, char *data)
|
||||
static void playback_function(switch_core_session_t *session, char *data)
|
||||
{
|
||||
switch_channel *channel;
|
||||
switch_channel_t *channel;
|
||||
char *timer_name = NULL;
|
||||
char *file_name = NULL;
|
||||
|
||||
@@ -73,9 +73,9 @@ static void playback_function(switch_core_session *session, char *data)
|
||||
}
|
||||
|
||||
|
||||
static void record_function(switch_core_session *session, char *data)
|
||||
static void record_function(switch_core_session_t *session, char *data)
|
||||
{
|
||||
switch_channel *channel;
|
||||
switch_channel_t *channel;
|
||||
channel = switch_core_session_get_channel(session);
|
||||
assert(channel != NULL);
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ typedef struct {
|
||||
swift_params *params;
|
||||
swift_voice *voice;
|
||||
switch_mutex_t *audio_lock;
|
||||
switch_buffer *audio_buffer;
|
||||
switch_buffer_t *audio_buffer;
|
||||
int done;
|
||||
int done_gen;
|
||||
} cepstral_t;
|
||||
|
||||
@@ -36,8 +36,8 @@
|
||||
static const char modname[] = "mod_g711codec";
|
||||
|
||||
|
||||
static switch_status switch_g711u_init(switch_codec *codec, switch_codec_flag flags,
|
||||
const struct switch_codec_settings *codec_settings)
|
||||
static switch_status switch_g711u_init(switch_codec_t *codec, switch_codec_flag flags,
|
||||
const switch_codec_settings_t *codec_settings)
|
||||
{
|
||||
int encoding, decoding;
|
||||
|
||||
@@ -52,8 +52,8 @@ static switch_status switch_g711u_init(switch_codec *codec, switch_codec_flag fl
|
||||
}
|
||||
|
||||
|
||||
static switch_status switch_g711u_encode(switch_codec *codec,
|
||||
switch_codec *other_codec,
|
||||
static switch_status switch_g711u_encode(switch_codec_t *codec,
|
||||
switch_codec_t *other_codec,
|
||||
void *decoded_data,
|
||||
uint32_t decoded_data_len,
|
||||
uint32_t decoded_rate,
|
||||
@@ -76,8 +76,8 @@ static switch_status switch_g711u_encode(switch_codec *codec,
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status switch_g711u_decode(switch_codec *codec,
|
||||
switch_codec *other_codec,
|
||||
static switch_status switch_g711u_decode(switch_codec_t *codec,
|
||||
switch_codec_t *other_codec,
|
||||
void *encoded_data,
|
||||
uint32_t encoded_data_len,
|
||||
uint32_t encoded_rate,
|
||||
@@ -105,14 +105,14 @@ static switch_status switch_g711u_decode(switch_codec *codec,
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status switch_g711u_destroy(switch_codec *codec)
|
||||
static switch_status switch_g711u_destroy(switch_codec_t *codec)
|
||||
{
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static switch_status switch_g711a_init(switch_codec *codec, switch_codec_flag flags,
|
||||
const struct switch_codec_settings *codec_settings)
|
||||
static switch_status switch_g711a_init(switch_codec_t *codec, switch_codec_flag flags,
|
||||
const switch_codec_settings_t *codec_settings)
|
||||
{
|
||||
int encoding, decoding;
|
||||
|
||||
@@ -127,8 +127,8 @@ static switch_status switch_g711a_init(switch_codec *codec, switch_codec_flag fl
|
||||
}
|
||||
|
||||
|
||||
static switch_status switch_g711a_encode(switch_codec *codec,
|
||||
switch_codec *other_codec,
|
||||
static switch_status switch_g711a_encode(switch_codec_t *codec,
|
||||
switch_codec_t *other_codec,
|
||||
void *decoded_data,
|
||||
uint32_t decoded_data_len,
|
||||
uint32_t decoded_rate,
|
||||
@@ -151,8 +151,8 @@ static switch_status switch_g711a_encode(switch_codec *codec,
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status switch_g711a_decode(switch_codec *codec,
|
||||
switch_codec *other_codec,
|
||||
static switch_status switch_g711a_decode(switch_codec_t *codec,
|
||||
switch_codec_t *other_codec,
|
||||
void *encoded_data,
|
||||
uint32_t encoded_data_len,
|
||||
uint32_t encoded_rate,
|
||||
@@ -180,7 +180,7 @@ static switch_status switch_g711a_decode(switch_codec *codec,
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status switch_g711a_destroy(switch_codec *codec)
|
||||
static switch_status switch_g711a_destroy(switch_codec_t *codec)
|
||||
{
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -189,7 +189,7 @@ static switch_status switch_g711a_destroy(switch_codec *codec)
|
||||
|
||||
#if 0
|
||||
|
||||
static const switch_codec_implementation g711u_8k_60ms_implementation = {
|
||||
static const switch_codec_implementation_t g711u_8k_60ms_implementation = {
|
||||
/*.samples_per_second */ 8000,
|
||||
/*.bits_per_second */ 19200,
|
||||
/*.microseconds_per_frame */ 60000,
|
||||
@@ -206,7 +206,7 @@ static const switch_codec_implementation g711u_8k_60ms_implementation = {
|
||||
};
|
||||
|
||||
|
||||
static const switch_codec_implementation g711u_8k_30ms_implementation = {
|
||||
static const switch_codec_implementation_t g711u_8k_30ms_implementation = {
|
||||
/*.samples_per_second */ 8000,
|
||||
/*.bits_per_second */ 96000,
|
||||
/*.microseconds_per_frame */ 30000,
|
||||
@@ -224,7 +224,7 @@ static const switch_codec_implementation g711u_8k_30ms_implementation = {
|
||||
};
|
||||
#endif
|
||||
|
||||
static const switch_codec_implementation g711u_16k_implementation = {
|
||||
static const switch_codec_implementation_t g711u_16k_implementation = {
|
||||
/*.samples_per_second */ 16000,
|
||||
/*.bits_per_second */ 128000,
|
||||
/*.microseconds_per_frame */ 20000,
|
||||
@@ -240,7 +240,7 @@ static const switch_codec_implementation g711u_16k_implementation = {
|
||||
/*.destroy */ switch_g711u_destroy,
|
||||
};
|
||||
|
||||
static const switch_codec_implementation g711u_8k_implementation = {
|
||||
static const switch_codec_implementation_t g711u_8k_implementation = {
|
||||
/*.samples_per_second */ 8000,
|
||||
/*.bits_per_second */ 64000,
|
||||
/*.microseconds_per_frame */ 20000,
|
||||
@@ -258,7 +258,7 @@ static const switch_codec_implementation g711u_8k_implementation = {
|
||||
};
|
||||
|
||||
|
||||
static const switch_codec_implementation g711a_8k_implementation = {
|
||||
static const switch_codec_implementation_t g711a_8k_implementation = {
|
||||
/*.samples_per_second */ 8000,
|
||||
/*.bits_per_second */ 64000,
|
||||
/*.microseconds_per_frame */ 20000,
|
||||
|
||||
@@ -42,8 +42,8 @@ struct g729_context {
|
||||
};
|
||||
|
||||
|
||||
static switch_status switch_g729_init(switch_codec *codec, switch_codec_flag flags,
|
||||
const struct switch_codec_settings *codec_settings)
|
||||
static switch_status switch_g729_init(switch_codec_t *codec, switch_codec_flag flags,
|
||||
const switch_codec_settings_t *codec_settings)
|
||||
{
|
||||
|
||||
struct g729_context *context = NULL;
|
||||
@@ -72,7 +72,7 @@ static switch_status switch_g729_init(switch_codec *codec, switch_codec_flag fla
|
||||
}
|
||||
|
||||
|
||||
static switch_status switch_g729_destroy(switch_codec *codec)
|
||||
static switch_status switch_g729_destroy(switch_codec_t *codec)
|
||||
{
|
||||
codec->private_info = NULL;
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
@@ -80,8 +80,8 @@ static switch_status switch_g729_destroy(switch_codec *codec)
|
||||
|
||||
|
||||
|
||||
static switch_status switch_g729_encode(switch_codec *codec,
|
||||
switch_codec *other_codec,
|
||||
static switch_status switch_g729_encode(switch_codec_t *codec,
|
||||
switch_codec_t *other_codec,
|
||||
void *decoded_data,
|
||||
|
||||
uint32_t decoded_data_len,
|
||||
@@ -127,8 +127,8 @@ static switch_status switch_g729_encode(switch_codec *codec,
|
||||
|
||||
|
||||
|
||||
static switch_status switch_g729_decode(switch_codec *codec,
|
||||
switch_codec *other_codec,
|
||||
static switch_status switch_g729_decode(switch_codec_t *codec,
|
||||
switch_codec_t *other_codec,
|
||||
void *encoded_data,
|
||||
|
||||
uint32_t encoded_data_len,
|
||||
@@ -218,7 +218,7 @@ static switch_status switch_g729_decode(switch_codec *codec,
|
||||
|
||||
/* Registration */
|
||||
|
||||
static const switch_codec_implementation g729_10ms_8k_implementation = {
|
||||
static const switch_codec_implementation_t g729_10ms_8k_implementation = {
|
||||
/*.samples_per_second */ 8000,
|
||||
/*.bits_per_second */ 32000,
|
||||
/*.microseconds_per_frame */ 10000,
|
||||
@@ -234,7 +234,7 @@ static const switch_codec_implementation g729_10ms_8k_implementation = {
|
||||
/*.destroy */ switch_g729_destroy,
|
||||
};
|
||||
|
||||
static const switch_codec_implementation g729_8k_implementation = {
|
||||
static const switch_codec_implementation_t g729_8k_implementation = {
|
||||
/*.samples_per_second */ 8000,
|
||||
/*.bits_per_second */ 64000,
|
||||
/*.microseconds_per_frame */ 20000,
|
||||
|
||||
@@ -36,8 +36,8 @@ struct gsm_context {
|
||||
gsm encoder;
|
||||
gsm decoder;
|
||||
};
|
||||
static switch_status switch_gsm_init(switch_codec *codec, switch_codec_flag flags,
|
||||
const struct switch_codec_settings *codec_settings)
|
||||
static switch_status switch_gsm_init(switch_codec_t *codec, switch_codec_flag flags,
|
||||
const switch_codec_settings_t *codec_settings)
|
||||
{
|
||||
struct gsm_context *context;
|
||||
int encoding, decoding;
|
||||
@@ -55,7 +55,7 @@ static switch_status switch_gsm_init(switch_codec *codec, switch_codec_flag flag
|
||||
codec->private_info = context;
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
static switch_status switch_gsm_destroy(switch_codec *codec)
|
||||
static switch_status switch_gsm_destroy(switch_codec_t *codec)
|
||||
{
|
||||
struct gsm_context *context = codec->private_info;
|
||||
int encoding = (codec->flags & SWITCH_CODEC_FLAG_ENCODE);
|
||||
@@ -67,7 +67,7 @@ static switch_status switch_gsm_destroy(switch_codec *codec)
|
||||
codec->private_info = NULL;
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
static switch_status switch_gsm_encode(switch_codec *codec, switch_codec *other_codec, void *decoded_data,
|
||||
static switch_status switch_gsm_encode(switch_codec_t *codec, switch_codec_t *other_codec, void *decoded_data,
|
||||
uint32_t decoded_data_len, uint32_t decoded_rate, void *encoded_data,
|
||||
uint32_t *encoded_data_len, uint32_t *encoded_rate, unsigned int *flag)
|
||||
{
|
||||
@@ -96,7 +96,7 @@ static switch_status switch_gsm_encode(switch_codec *codec, switch_codec *other_
|
||||
}
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
static switch_status switch_gsm_decode(switch_codec *codec, switch_codec *other_codec, void *encoded_data,
|
||||
static switch_status switch_gsm_decode(switch_codec_t *codec, switch_codec_t *other_codec, void *encoded_data,
|
||||
uint32_t encoded_data_len, uint32_t encoded_rate, void *decoded_data,
|
||||
uint32_t *decoded_data_len, uint32_t *decoded_rate, unsigned int *flag)
|
||||
{
|
||||
@@ -132,7 +132,7 @@ static switch_status switch_gsm_decode(switch_codec *codec, switch_codec *other_
|
||||
|
||||
|
||||
/* Registration */
|
||||
static const switch_codec_implementation gsm_8k_implementation = {
|
||||
static const switch_codec_implementation_t gsm_8k_implementation = {
|
||||
/*.samples_per_second */ 8000,
|
||||
/*.bits_per_second */ 13200,
|
||||
/*.microseconds_per_frame */ 20000,
|
||||
|
||||
@@ -44,8 +44,8 @@ struct ilbc_context {
|
||||
uint16_t dbytes;
|
||||
};
|
||||
|
||||
static switch_status switch_ilbc_init(switch_codec *codec, switch_codec_flag flags,
|
||||
const struct switch_codec_settings *codec_settings)
|
||||
static switch_status switch_ilbc_init(switch_codec_t *codec, switch_codec_flag flags,
|
||||
const switch_codec_settings_t *codec_settings)
|
||||
{
|
||||
struct ilbc_context *context;
|
||||
int encoding, decoding;
|
||||
@@ -86,15 +86,15 @@ static switch_status switch_ilbc_init(switch_codec *codec, switch_codec_flag fla
|
||||
}
|
||||
|
||||
|
||||
static switch_status switch_ilbc_destroy(switch_codec *codec)
|
||||
static switch_status switch_ilbc_destroy(switch_codec_t *codec)
|
||||
{
|
||||
codec->private_info = NULL;
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
static switch_status switch_ilbc_encode(switch_codec *codec,
|
||||
switch_codec *other_codec,
|
||||
static switch_status switch_ilbc_encode(switch_codec_t *codec,
|
||||
switch_codec_t *other_codec,
|
||||
void *decoded_data,
|
||||
uint32_t decoded_data_len,
|
||||
uint32_t decoded_rate,
|
||||
@@ -136,8 +136,8 @@ static switch_status switch_ilbc_encode(switch_codec *codec,
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status switch_ilbc_decode(switch_codec *codec,
|
||||
switch_codec *other_codec,
|
||||
static switch_status switch_ilbc_decode(switch_codec_t *codec,
|
||||
switch_codec_t *other_codec,
|
||||
void *encoded_data,
|
||||
uint32_t encoded_data_len,
|
||||
uint32_t encoded_rate,
|
||||
@@ -185,7 +185,7 @@ static switch_status switch_ilbc_decode(switch_codec *codec,
|
||||
|
||||
/* Registration */
|
||||
|
||||
static const switch_codec_implementation ilbc_8k_30ms_implementation = {
|
||||
static const switch_codec_implementation_t ilbc_8k_30ms_implementation = {
|
||||
/*.samples_per_second */ 8000,
|
||||
/*.bits_per_second */ NO_OF_BYTES_30MS*8*8000/BLOCKL_30MS,
|
||||
/*.microseconds_per_frame */ 30000,
|
||||
@@ -201,7 +201,7 @@ static const switch_codec_implementation ilbc_8k_30ms_implementation = {
|
||||
/*.destroy */ switch_ilbc_destroy
|
||||
};
|
||||
|
||||
static const switch_codec_implementation ilbc_8k_20ms_implementation = {
|
||||
static const switch_codec_implementation_t ilbc_8k_20ms_implementation = {
|
||||
/*.samples_per_second */ 8000,
|
||||
/*.bits_per_second */ NO_OF_BYTES_20MS*8*8000/BLOCKL_20MS,
|
||||
/*.microseconds_per_frame */ 20000,
|
||||
@@ -219,7 +219,7 @@ static const switch_codec_implementation ilbc_8k_20ms_implementation = {
|
||||
};
|
||||
|
||||
|
||||
static const switch_codec_implementation ilbc_8k_20ms_nonext_implementation = {
|
||||
static const switch_codec_implementation_t ilbc_8k_20ms_nonext_implementation = {
|
||||
/*.samples_per_second */ 8000,
|
||||
/*.bits_per_second */ NO_OF_BYTES_20MS*8*8000/BLOCKL_20MS,
|
||||
/*.microseconds_per_frame */ 20000,
|
||||
|
||||
@@ -34,8 +34,8 @@
|
||||
static const char modname[] = "mod_rawaudio";
|
||||
|
||||
|
||||
static switch_status switch_raw_init(switch_codec *codec, switch_codec_flag flags,
|
||||
const struct switch_codec_settings *codec_settings)
|
||||
static switch_status switch_raw_init(switch_codec_t *codec, switch_codec_flag flags,
|
||||
const switch_codec_settings_t *codec_settings)
|
||||
{
|
||||
int encoding, decoding;
|
||||
|
||||
@@ -49,8 +49,8 @@ static switch_status switch_raw_init(switch_codec *codec, switch_codec_flag flag
|
||||
}
|
||||
}
|
||||
|
||||
static switch_status switch_raw_encode(switch_codec *codec,
|
||||
switch_codec *other_codec,
|
||||
static switch_status switch_raw_encode(switch_codec_t *codec,
|
||||
switch_codec_t *other_codec,
|
||||
void *decoded_data,
|
||||
uint32_t decoded_data_len,
|
||||
uint32_t decoded_rate,
|
||||
@@ -67,8 +67,8 @@ static switch_status switch_raw_encode(switch_codec *codec,
|
||||
return SWITCH_STATUS_NOOP;
|
||||
}
|
||||
|
||||
static switch_status switch_raw_decode(switch_codec *codec,
|
||||
switch_codec *other_codec,
|
||||
static switch_status switch_raw_decode(switch_codec_t *codec,
|
||||
switch_codec_t *other_codec,
|
||||
void *encoded_data,
|
||||
uint32_t encoded_data_len,
|
||||
uint32_t encoded_rate,
|
||||
@@ -84,13 +84,13 @@ static switch_status switch_raw_decode(switch_codec *codec,
|
||||
}
|
||||
|
||||
|
||||
static switch_status switch_raw_destroy(switch_codec *codec)
|
||||
static switch_status switch_raw_destroy(switch_codec_t *codec)
|
||||
{
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static const switch_codec_implementation raw_32k_implementation = {
|
||||
static const switch_codec_implementation_t raw_32k_implementation = {
|
||||
/*.samples_per_second = */ 32000,
|
||||
/*.bits_per_second = */ 512000,
|
||||
/*.microseconds_per_frame = */ 20000,
|
||||
@@ -106,7 +106,7 @@ static const switch_codec_implementation raw_32k_implementation = {
|
||||
/*.destroy = */ switch_raw_destroy
|
||||
};
|
||||
|
||||
static const switch_codec_implementation raw_22k_implementation = {
|
||||
static const switch_codec_implementation_t raw_22k_implementation = {
|
||||
/*.samples_per_second = */ 22050,
|
||||
/*.bits_per_second = */ 352800,
|
||||
/*.microseconds_per_frame = */ 20000,
|
||||
@@ -123,7 +123,7 @@ static const switch_codec_implementation raw_22k_implementation = {
|
||||
/*.next = */ &raw_32k_implementation
|
||||
};
|
||||
|
||||
static const switch_codec_implementation raw_16k_implementation = {
|
||||
static const switch_codec_implementation_t raw_16k_implementation = {
|
||||
/*.samples_per_second = */ 16000,
|
||||
/*.bits_per_second = */ 256000,
|
||||
/*.microseconds_per_frame = */ 20000,
|
||||
@@ -140,7 +140,7 @@ static const switch_codec_implementation raw_16k_implementation = {
|
||||
/*.next = */ &raw_22k_implementation
|
||||
};
|
||||
|
||||
static const switch_codec_implementation raw_8k_implementation = {
|
||||
static const switch_codec_implementation_t raw_8k_implementation = {
|
||||
/*.samples_per_second = */ 8000,
|
||||
/*.bits_per_second = */ 128000,
|
||||
/*.microseconds_per_frame = */ 20000,
|
||||
@@ -158,7 +158,7 @@ static const switch_codec_implementation raw_8k_implementation = {
|
||||
};
|
||||
|
||||
|
||||
static const switch_codec_implementation raw_8k_30ms_implementation = {
|
||||
static const switch_codec_implementation_t raw_8k_30ms_implementation = {
|
||||
/*.samples_per_second */ 8000,
|
||||
/*.bits_per_second */ 128000,
|
||||
/*.microseconds_per_frame */ 30000,
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
static const char modname[] = "mod_speexcodec";
|
||||
|
||||
static const struct switch_codec_settings default_codec_settings = {
|
||||
static const switch_codec_settings_t default_codec_settings = {
|
||||
/*.quality */ 5,
|
||||
/*.complexity */ 5,
|
||||
/*.enhancement */ 1,
|
||||
@@ -55,7 +55,7 @@ static const struct switch_codec_settings default_codec_settings = {
|
||||
};
|
||||
|
||||
struct speex_context {
|
||||
switch_codec *codec;
|
||||
switch_codec_t *codec;
|
||||
unsigned int flags;
|
||||
|
||||
/* Encoder */
|
||||
@@ -72,8 +72,8 @@ struct speex_context {
|
||||
int decoder_mode;
|
||||
};
|
||||
|
||||
static switch_status switch_speex_init(switch_codec *codec, switch_codec_flag flags,
|
||||
const struct switch_codec_settings *codec_settings)
|
||||
static switch_status switch_speex_init(switch_codec_t *codec, switch_codec_flag flags,
|
||||
const switch_codec_settings_t *codec_settings)
|
||||
{
|
||||
struct speex_context *context = NULL;
|
||||
int encoding, decoding;
|
||||
@@ -157,8 +157,8 @@ static switch_status switch_speex_init(switch_codec *codec, switch_codec_flag fl
|
||||
}
|
||||
}
|
||||
|
||||
static switch_status switch_speex_encode(switch_codec *codec,
|
||||
switch_codec *other_codec,
|
||||
static switch_status switch_speex_encode(switch_codec_t *codec,
|
||||
switch_codec_t *other_codec,
|
||||
void *decoded_data,
|
||||
uint32_t decoded_data_len,
|
||||
uint32_t decoded_rate,
|
||||
@@ -212,8 +212,8 @@ static switch_status switch_speex_encode(switch_codec *codec,
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status switch_speex_decode(switch_codec *codec,
|
||||
switch_codec *other_codec,
|
||||
static switch_status switch_speex_decode(switch_codec_t *codec,
|
||||
switch_codec_t *other_codec,
|
||||
void *encoded_data,
|
||||
uint32_t encoded_data_len,
|
||||
uint32_t encoded_rate,
|
||||
@@ -239,7 +239,7 @@ static switch_status switch_speex_decode(switch_codec *codec,
|
||||
}
|
||||
|
||||
|
||||
static switch_status switch_speex_destroy(switch_codec *codec)
|
||||
static switch_status switch_speex_destroy(switch_codec_t *codec)
|
||||
{
|
||||
int encoding, decoding;
|
||||
struct speex_context *context = codec->private_info;
|
||||
@@ -267,7 +267,7 @@ static switch_status switch_speex_destroy(switch_codec *codec)
|
||||
}
|
||||
|
||||
/* Registration */
|
||||
static const switch_codec_implementation speex_32k_implementation = {
|
||||
static const switch_codec_implementation_t speex_32k_implementation = {
|
||||
/*.samples_per_second */ 32000,
|
||||
/*.bits_per_second */ 512000,
|
||||
/*.nanoseconds_per_frame */ 20000,
|
||||
@@ -283,7 +283,7 @@ static const switch_codec_implementation speex_32k_implementation = {
|
||||
/*.destroy */ switch_speex_destroy
|
||||
};
|
||||
|
||||
static const switch_codec_implementation speex_16k_implementation = {
|
||||
static const switch_codec_implementation_t speex_16k_implementation = {
|
||||
/*.samples_per_second */ 16000,
|
||||
/*.bits_per_second */ 256000,
|
||||
/*.nanoseconds_per_frame */ 20000,
|
||||
@@ -300,7 +300,7 @@ static const switch_codec_implementation speex_16k_implementation = {
|
||||
/*.next */ &speex_32k_implementation
|
||||
};
|
||||
|
||||
static const switch_codec_implementation speex_8k_implementation = {
|
||||
static const switch_codec_implementation_t speex_8k_implementation = {
|
||||
/*.samples_per_second */ 8000,
|
||||
/*.bits_per_second */ 128000,
|
||||
/*.nanoseconds_per_frame */ 20000,
|
||||
|
||||
@@ -38,13 +38,13 @@
|
||||
static const char modname[] = "mod_dialplan_demo";
|
||||
|
||||
|
||||
static switch_caller_extension *demo_dialplan_hunt(switch_core_session *session)
|
||||
static switch_caller_extension_t *demo_dialplan_hunt(switch_core_session_t *session)
|
||||
{
|
||||
switch_caller_profile *caller_profile;
|
||||
switch_caller_extension *extension = NULL;
|
||||
switch_channel *channel;
|
||||
switch_caller_profile_t *caller_profile;
|
||||
switch_caller_extension_t *extension = NULL;
|
||||
switch_channel_t *channel;
|
||||
char *cf = "extensions.conf";
|
||||
switch_config cfg;
|
||||
switch_config_t cfg;
|
||||
char *var, *val;
|
||||
char app[1024];
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_base, globals.base)
|
||||
static void load_config(void)
|
||||
{
|
||||
char *cf = "dialplan_directory.conf";
|
||||
switch_config cfg;
|
||||
switch_config_t cfg;
|
||||
char *var, *val;
|
||||
|
||||
if (!switch_config_open_file(&cfg, cf)) {
|
||||
@@ -82,11 +82,11 @@ static void load_config(void)
|
||||
switch_config_close_file(&cfg);
|
||||
}
|
||||
|
||||
static switch_caller_extension *directory_dialplan_hunt(switch_core_session *session)
|
||||
static switch_caller_extension_t *directory_dialplan_hunt(switch_core_session_t *session)
|
||||
{
|
||||
switch_caller_profile *caller_profile;
|
||||
switch_caller_extension *extension = NULL;
|
||||
switch_channel *channel;
|
||||
switch_caller_profile_t *caller_profile;
|
||||
switch_caller_extension_t *extension = NULL;
|
||||
switch_channel_t *channel;
|
||||
char *var, *val;
|
||||
char filter[256];
|
||||
switch_directory_handle dh;
|
||||
|
||||
@@ -42,13 +42,13 @@ static const char modname[] = "mod_pcre";
|
||||
re = NULL;\
|
||||
}
|
||||
|
||||
static switch_caller_extension *dialplan_hunt(switch_core_session *session)
|
||||
static switch_caller_extension_t *dialplan_hunt(switch_core_session_t *session)
|
||||
{
|
||||
switch_caller_profile *caller_profile;
|
||||
switch_caller_extension *extension = NULL;
|
||||
switch_channel *channel;
|
||||
switch_caller_profile_t *caller_profile;
|
||||
switch_caller_extension_t *extension = NULL;
|
||||
switch_channel_t *channel;
|
||||
char *cf = "regextensions.conf";
|
||||
switch_config cfg;
|
||||
switch_config_t cfg;
|
||||
char *var, *val;
|
||||
char app[1024] = "";
|
||||
int catno = -1;
|
||||
|
||||
@@ -96,12 +96,12 @@ struct mdl_profile {
|
||||
|
||||
struct private_object {
|
||||
unsigned int flags;
|
||||
switch_codec read_codec;
|
||||
switch_codec write_codec;
|
||||
struct switch_frame read_frame;
|
||||
switch_codec_t read_codec;
|
||||
switch_codec_t write_codec;
|
||||
switch_frame_t read_frame;
|
||||
struct mdl_profile *profile;
|
||||
switch_core_session *session;
|
||||
switch_caller_profile *caller_profile;
|
||||
switch_core_session_t *session;
|
||||
switch_caller_profile_t *caller_profile;
|
||||
unsigned short samprate;
|
||||
switch_mutex_t *mutex;
|
||||
switch_codec_interface *codecs[SWITCH_MAX_CODECS];
|
||||
@@ -149,18 +149,18 @@ SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_dialplan, globals.dialplan)
|
||||
SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_codec_rates_string, globals.codec_rates_string)
|
||||
|
||||
|
||||
static switch_status channel_on_init(switch_core_session *session);
|
||||
static switch_status channel_on_hangup(switch_core_session *session);
|
||||
static switch_status channel_on_ring(switch_core_session *session);
|
||||
static switch_status channel_on_loopback(switch_core_session *session);
|
||||
static switch_status channel_on_transmit(switch_core_session *session);
|
||||
static switch_status channel_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile,
|
||||
switch_core_session **new_session, switch_memory_pool_t *pool);
|
||||
static switch_status channel_read_frame(switch_core_session *session, switch_frame **frame, int timeout,
|
||||
static switch_status channel_on_init(switch_core_session_t *session);
|
||||
static switch_status channel_on_hangup(switch_core_session_t *session);
|
||||
static switch_status channel_on_ring(switch_core_session_t *session);
|
||||
static switch_status channel_on_loopback(switch_core_session_t *session);
|
||||
static switch_status channel_on_transmit(switch_core_session_t *session);
|
||||
static switch_status channel_outgoing_channel(switch_core_session_t *session, switch_caller_profile_t *outbound_profile,
|
||||
switch_core_session_t **new_session, switch_memory_pool_t *pool);
|
||||
static switch_status channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout,
|
||||
switch_io_flag flags, int stream_id);
|
||||
static switch_status channel_write_frame(switch_core_session *session, switch_frame *frame, int timeout,
|
||||
static switch_status channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, int timeout,
|
||||
switch_io_flag flags, int stream_id);
|
||||
static switch_status channel_kill_channel(switch_core_session *session, int sig);
|
||||
static switch_status channel_kill_channel(switch_core_session_t *session, int sig);
|
||||
static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsession, ldl_signal_t signal, char *msg);
|
||||
static ldl_status handle_response(ldl_handle_t *handle, char *id);
|
||||
static switch_status load_config(void);
|
||||
@@ -230,7 +230,7 @@ static void handle_thread_launch(ldl_handle_t *handle)
|
||||
|
||||
static int activate_rtp(struct private_object *tech_pvt)
|
||||
{
|
||||
switch_channel *channel = switch_core_session_get_channel(tech_pvt->session);
|
||||
switch_channel_t *channel = switch_core_session_get_channel(tech_pvt->session);
|
||||
const char *err;
|
||||
int ms = 20;
|
||||
|
||||
@@ -308,7 +308,7 @@ static int activate_rtp(struct private_object *tech_pvt)
|
||||
|
||||
static int do_candidates(struct private_object *tech_pvt, int force)
|
||||
{
|
||||
switch_channel *channel = switch_core_session_get_channel(tech_pvt->session);
|
||||
switch_channel_t *channel = switch_core_session_get_channel(tech_pvt->session);
|
||||
assert(channel != NULL);
|
||||
|
||||
if (switch_test_flag(tech_pvt, TFLAG_DO_CAND)) {
|
||||
@@ -399,7 +399,7 @@ static char *lame(char *in)
|
||||
static int do_describe(struct private_object *tech_pvt, int force)
|
||||
{
|
||||
ldl_payload_t payloads[5];
|
||||
switch_channel *channel = switch_core_session_get_channel(tech_pvt->session);
|
||||
switch_channel_t *channel = switch_core_session_get_channel(tech_pvt->session);
|
||||
assert(channel != NULL);
|
||||
|
||||
if (switch_test_flag(tech_pvt, TFLAG_DO_DESC)) {
|
||||
@@ -451,9 +451,9 @@ static int do_describe(struct private_object *tech_pvt, int force)
|
||||
|
||||
static void *SWITCH_THREAD_FUNC negotiate_thread_run(switch_thread_t *thread, void *obj)
|
||||
{
|
||||
switch_core_session *session = obj;
|
||||
switch_core_session_t *session = obj;
|
||||
|
||||
switch_channel *channel;
|
||||
switch_channel_t *channel;
|
||||
struct private_object *tech_pvt = NULL;
|
||||
switch_time_t started;
|
||||
switch_time_t now;
|
||||
@@ -530,7 +530,7 @@ static void *SWITCH_THREAD_FUNC negotiate_thread_run(switch_thread_t *thread, vo
|
||||
}
|
||||
|
||||
|
||||
static void negotiate_thread_launch(switch_core_session *session)
|
||||
static void negotiate_thread_launch(switch_core_session_t *session)
|
||||
{
|
||||
switch_thread_t *thread;
|
||||
switch_threadattr_t *thd_attr = NULL;
|
||||
@@ -548,9 +548,9 @@ static void negotiate_thread_launch(switch_core_session *session)
|
||||
returning SWITCH_STATUS_SUCCESS tells the core to execute the standard state method next
|
||||
so if you fully implement the state you can return SWITCH_STATUS_FALSE to skip it.
|
||||
*/
|
||||
static switch_status channel_on_init(switch_core_session *session)
|
||||
static switch_status channel_on_init(switch_core_session_t *session)
|
||||
{
|
||||
switch_channel *channel;
|
||||
switch_channel_t *channel;
|
||||
struct private_object *tech_pvt = NULL;
|
||||
|
||||
tech_pvt = switch_core_session_get_private(session);
|
||||
@@ -567,9 +567,9 @@ static switch_status channel_on_init(switch_core_session *session)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status channel_on_ring(switch_core_session *session)
|
||||
static switch_status channel_on_ring(switch_core_session_t *session)
|
||||
{
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
struct private_object *tech_pvt = NULL;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
@@ -583,10 +583,10 @@ static switch_status channel_on_ring(switch_core_session *session)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status channel_on_execute(switch_core_session *session)
|
||||
static switch_status channel_on_execute(switch_core_session_t *session)
|
||||
{
|
||||
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
struct private_object *tech_pvt = NULL;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
@@ -601,9 +601,9 @@ static switch_status channel_on_execute(switch_core_session *session)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status channel_on_hangup(switch_core_session *session)
|
||||
static switch_status channel_on_hangup(switch_core_session_t *session)
|
||||
{
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
struct private_object *tech_pvt = NULL;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
@@ -640,9 +640,9 @@ static switch_status channel_on_hangup(switch_core_session *session)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status channel_kill_channel(switch_core_session *session, int sig)
|
||||
static switch_status channel_kill_channel(switch_core_session_t *session, int sig)
|
||||
{
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
struct private_object *tech_pvt = NULL;
|
||||
|
||||
if ((channel = switch_core_session_get_channel(session))) {
|
||||
@@ -664,19 +664,19 @@ static switch_status channel_kill_channel(switch_core_session *session, int sig)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status channel_on_loopback(switch_core_session *session)
|
||||
static switch_status channel_on_loopback(switch_core_session_t *session)
|
||||
{
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL LOOPBACK\n");
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status channel_on_transmit(switch_core_session *session)
|
||||
static switch_status channel_on_transmit(switch_core_session_t *session)
|
||||
{
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL TRANSMIT\n");
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status channel_waitfor_read(switch_core_session *session, int ms, int stream_id)
|
||||
static switch_status channel_waitfor_read(switch_core_session_t *session, int ms, int stream_id)
|
||||
{
|
||||
struct private_object *tech_pvt = NULL;
|
||||
|
||||
@@ -686,7 +686,7 @@ static switch_status channel_waitfor_read(switch_core_session *session, int ms,
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status channel_waitfor_write(switch_core_session *session, int ms, int stream_id)
|
||||
static switch_status channel_waitfor_write(switch_core_session_t *session, int ms, int stream_id)
|
||||
{
|
||||
struct private_object *tech_pvt = NULL;
|
||||
|
||||
@@ -697,7 +697,7 @@ static switch_status channel_waitfor_write(switch_core_session *session, int ms,
|
||||
|
||||
}
|
||||
|
||||
static switch_status channel_send_dtmf(switch_core_session *session, char *dtmf)
|
||||
static switch_status channel_send_dtmf(switch_core_session_t *session, char *dtmf)
|
||||
{
|
||||
struct private_object *tech_pvt = NULL;
|
||||
//char *digit;
|
||||
@@ -709,13 +709,13 @@ static switch_status channel_send_dtmf(switch_core_session *session, char *dtmf)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status channel_read_frame(switch_core_session *session, switch_frame **frame, int timeout,
|
||||
static switch_status channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout,
|
||||
switch_io_flag flags, int stream_id)
|
||||
{
|
||||
struct private_object *tech_pvt = NULL;
|
||||
uint32_t bytes = 0;
|
||||
switch_size_t samples = 0, frames = 0, ms = 0;
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
switch_payload_t payload = 0;
|
||||
switch_status status;
|
||||
|
||||
@@ -806,11 +806,11 @@ static switch_status channel_read_frame(switch_core_session *session, switch_fra
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status channel_write_frame(switch_core_session *session, switch_frame *frame, int timeout,
|
||||
static switch_status channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, int timeout,
|
||||
switch_io_flag flags, int stream_id)
|
||||
{
|
||||
struct private_object *tech_pvt;
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
switch_status status = SWITCH_STATUS_SUCCESS;
|
||||
int bytes = 0, samples = 0, frames = 0;
|
||||
|
||||
@@ -914,10 +914,10 @@ static switch_status channel_write_frame(switch_core_session *session, switch_fr
|
||||
return status;
|
||||
}
|
||||
|
||||
static switch_status channel_answer_channel(switch_core_session *session)
|
||||
static switch_status channel_answer_channel(switch_core_session_t *session)
|
||||
{
|
||||
struct private_object *tech_pvt;
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
assert(channel != NULL);
|
||||
@@ -934,9 +934,9 @@ static switch_status channel_answer_channel(switch_core_session *session)
|
||||
}
|
||||
|
||||
|
||||
static switch_status channel_receive_message(switch_core_session *session, switch_core_session_message *msg)
|
||||
static switch_status channel_receive_message(switch_core_session_t *session, switch_core_session_message_t *msg)
|
||||
{
|
||||
switch_channel *channel;
|
||||
switch_channel_t *channel;
|
||||
struct private_object *tech_pvt;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
@@ -966,7 +966,7 @@ static switch_status channel_receive_message(switch_core_session *session, switc
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
static const switch_state_handler_table channel_event_handlers = {
|
||||
static const switch_state_handler_table_t channel_event_handlers = {
|
||||
/*.on_init */ channel_on_init,
|
||||
/*.on_ring */ channel_on_ring,
|
||||
/*.on_execute */ channel_on_execute,
|
||||
@@ -1008,13 +1008,13 @@ static const switch_loadable_module_interface channel_module_interface = {
|
||||
/* Make sure when you have 2 sessions in the same scope that you pass the appropriate one to the routines
|
||||
that allocate memory or you will have 1 channel with memory allocated from another channel's pool!
|
||||
*/
|
||||
static switch_status channel_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile,
|
||||
switch_core_session **new_session, switch_memory_pool_t *pool)
|
||||
static switch_status channel_outgoing_channel(switch_core_session_t *session, switch_caller_profile_t *outbound_profile,
|
||||
switch_core_session_t **new_session, switch_memory_pool_t *pool)
|
||||
{
|
||||
if ((*new_session = switch_core_session_request(&channel_endpoint_interface, pool)) != 0) {
|
||||
struct private_object *tech_pvt;
|
||||
switch_channel *channel;
|
||||
switch_caller_profile *caller_profile = NULL;
|
||||
switch_channel_t *channel;
|
||||
switch_caller_profile_t *caller_profile = NULL;
|
||||
struct mdl_profile *mdl_profile = NULL;
|
||||
ldl_session_t *dlsession = NULL;
|
||||
char *profile_name;
|
||||
@@ -1181,7 +1181,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_shutdown(void)
|
||||
|
||||
static switch_status load_config(void)
|
||||
{
|
||||
switch_config cfg;
|
||||
switch_config_t cfg;
|
||||
char *var, *val;
|
||||
char *cf = "dingaling.conf";
|
||||
struct mdl_profile *profile = NULL;
|
||||
@@ -1282,8 +1282,8 @@ static switch_status load_config(void)
|
||||
static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsession, ldl_signal_t signal, char *msg)
|
||||
{
|
||||
struct mdl_profile *profile = NULL;
|
||||
switch_core_session *session = NULL;
|
||||
switch_channel *channel = NULL;
|
||||
switch_core_session_t *session = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
struct private_object *tech_pvt = NULL;
|
||||
|
||||
assert(dlsession != NULL);
|
||||
|
||||
@@ -98,11 +98,11 @@ static struct {
|
||||
|
||||
struct private_object {
|
||||
unsigned int flags;
|
||||
switch_core_session *session;
|
||||
switch_frame read_frame;
|
||||
switch_codec read_codec;
|
||||
switch_codec write_codec;
|
||||
switch_caller_profile *caller_profile;
|
||||
switch_core_session_t *session;
|
||||
switch_frame_t read_frame;
|
||||
switch_codec_t read_codec;
|
||||
switch_codec_t write_codec;
|
||||
switch_caller_profile_t *caller_profile;
|
||||
int cid;
|
||||
int did;
|
||||
int tid;
|
||||
@@ -145,19 +145,19 @@ SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_rtpip, globals.rtpip)
|
||||
SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_codec_string, globals.codec_string)
|
||||
SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_sipip, globals.sipip)
|
||||
|
||||
static switch_status exosip_on_init(switch_core_session *session);
|
||||
static switch_status exosip_on_hangup(switch_core_session *session);
|
||||
static switch_status exosip_on_loopback(switch_core_session *session);
|
||||
static switch_status exosip_on_transmit(switch_core_session *session);
|
||||
static switch_status exosip_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile,
|
||||
switch_core_session **new_session, switch_memory_pool_t *pool);
|
||||
static switch_status exosip_read_frame(switch_core_session *session, switch_frame **frame, int timeout,
|
||||
static switch_status exosip_on_init(switch_core_session_t *session);
|
||||
static switch_status exosip_on_hangup(switch_core_session_t *session);
|
||||
static switch_status exosip_on_loopback(switch_core_session_t *session);
|
||||
static switch_status exosip_on_transmit(switch_core_session_t *session);
|
||||
static switch_status exosip_outgoing_channel(switch_core_session_t *session, switch_caller_profile_t *outbound_profile,
|
||||
switch_core_session_t **new_session, switch_memory_pool_t *pool);
|
||||
static switch_status exosip_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout,
|
||||
switch_io_flag flags, int stream_id);
|
||||
static switch_status exosip_write_frame(switch_core_session *session, switch_frame *frame, int timeout,
|
||||
static switch_status exosip_write_frame(switch_core_session_t *session, switch_frame_t *frame, int timeout,
|
||||
switch_io_flag flags, int stream_id);
|
||||
static int config_exosip(int reload);
|
||||
static switch_status parse_sdp_media(sdp_media_t * media, char **dname, char **drate, char **dpayload);
|
||||
static switch_status exosip_kill_channel(switch_core_session *session, int sig);
|
||||
static switch_status exosip_kill_channel(switch_core_session_t *session, int sig);
|
||||
static switch_status activate_rtp(struct private_object *tech_pvt);
|
||||
static void deactivate_rtp(struct private_object *tech_pvt);
|
||||
static void sdp_add_rfc2833(struct osip_rfc3264 *cnf, int rate);
|
||||
@@ -173,7 +173,7 @@ static struct private_object *get_pvt_by_call_id(int id)
|
||||
return tech_pvt;
|
||||
}
|
||||
|
||||
static switch_status exosip_on_execute(switch_core_session *session)
|
||||
static switch_status exosip_on_execute(switch_core_session_t *session)
|
||||
{
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
@@ -223,10 +223,10 @@ State methods they get called when the state changes to the specific state
|
||||
returning SWITCH_STATUS_SUCCESS tells the core to execute the standard state method next
|
||||
so if you fully implement the state you can return SWITCH_STATUS_FALSE to skip it.
|
||||
*/
|
||||
static switch_status exosip_on_init(switch_core_session *session)
|
||||
static switch_status exosip_on_init(switch_core_session_t *session)
|
||||
{
|
||||
struct private_object *tech_pvt;
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
char from_uri[512] = "", port[7] = "", *buf = NULL, tmp[512] = "";
|
||||
osip_message_t *invite = NULL;
|
||||
|
||||
@@ -320,7 +320,7 @@ static switch_status exosip_on_init(switch_core_session *session)
|
||||
|
||||
if (num_codecs > 0) {
|
||||
int i;
|
||||
static const switch_codec_implementation *imp;
|
||||
static const switch_codec_implementation_t *imp;
|
||||
for (i = 0; i < num_codecs; i++) {
|
||||
int x = 0;
|
||||
|
||||
@@ -382,9 +382,9 @@ static switch_status exosip_on_init(switch_core_session *session)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status exosip_on_ring(switch_core_session *session)
|
||||
static switch_status exosip_on_ring(switch_core_session_t *session)
|
||||
{
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
struct private_object *tech_pvt = NULL;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
@@ -398,10 +398,10 @@ static switch_status exosip_on_ring(switch_core_session *session)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status exosip_on_hangup(switch_core_session *session)
|
||||
static switch_status exosip_on_hangup(switch_core_session_t *session)
|
||||
{
|
||||
struct private_object *tech_pvt;
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
int i;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
@@ -427,13 +427,13 @@ static switch_status exosip_on_hangup(switch_core_session *session)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status exosip_on_loopback(switch_core_session *session)
|
||||
static switch_status exosip_on_loopback(switch_core_session_t *session)
|
||||
{
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "EXOSIP LOOPBACK\n");
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status exosip_on_transmit(switch_core_session *session)
|
||||
static switch_status exosip_on_transmit(switch_core_session_t *session)
|
||||
{
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "EXOSIP TRANSMIT\n");
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
@@ -462,7 +462,7 @@ static void deactivate_rtp(struct private_object *tech_pvt)
|
||||
static switch_status activate_rtp(struct private_object *tech_pvt)
|
||||
{
|
||||
int bw, ms;
|
||||
switch_channel *channel;
|
||||
switch_channel_t *channel;
|
||||
const char *err;
|
||||
char *key = NULL;
|
||||
|
||||
@@ -526,7 +526,7 @@ static switch_status activate_rtp(struct private_object *tech_pvt)
|
||||
switch_set_flag(tech_pvt, TFLAG_VAD);
|
||||
}
|
||||
} else {
|
||||
switch_channel *channel = switch_core_session_get_channel(tech_pvt->session);
|
||||
switch_channel_t *channel = switch_core_session_get_channel(tech_pvt->session);
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "RTP REPORTS ERROR: [%s]\n", err);
|
||||
switch_channel_hangup(channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
|
||||
switch_set_flag(tech_pvt, TFLAG_BYE);
|
||||
@@ -537,10 +537,10 @@ static switch_status activate_rtp(struct private_object *tech_pvt)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status exosip_answer_channel(switch_core_session *session)
|
||||
static switch_status exosip_answer_channel(switch_core_session_t *session)
|
||||
{
|
||||
struct private_object *tech_pvt;
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
|
||||
assert(session != NULL);
|
||||
|
||||
@@ -571,12 +571,12 @@ static switch_status exosip_answer_channel(switch_core_session *session)
|
||||
}
|
||||
|
||||
|
||||
static switch_status exosip_read_frame(switch_core_session *session, switch_frame **frame, int timeout,
|
||||
static switch_status exosip_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout,
|
||||
switch_io_flag flags, int stream_id)
|
||||
{
|
||||
struct private_object *tech_pvt = NULL;
|
||||
size_t bytes = 0, samples = 0, frames = 0, ms = 0;
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
int payload = 0;
|
||||
switch_time_t now, started = switch_time_now(), last_act = switch_time_now();
|
||||
unsigned int elapsed;
|
||||
@@ -699,11 +699,11 @@ static switch_status exosip_read_frame(switch_core_session *session, switch_fram
|
||||
}
|
||||
|
||||
|
||||
static switch_status exosip_write_frame(switch_core_session *session, switch_frame *frame, int timeout,
|
||||
static switch_status exosip_write_frame(switch_core_session_t *session, switch_frame_t *frame, int timeout,
|
||||
switch_io_flag flags, int stream_id)
|
||||
{
|
||||
struct private_object *tech_pvt;
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
switch_status status = SWITCH_STATUS_SUCCESS;
|
||||
int bytes = 0, samples = 0, frames = 0;
|
||||
|
||||
@@ -811,10 +811,10 @@ static switch_status exosip_write_frame(switch_core_session *session, switch_fra
|
||||
|
||||
|
||||
|
||||
static switch_status exosip_kill_channel(switch_core_session *session, int sig)
|
||||
static switch_status exosip_kill_channel(switch_core_session_t *session, int sig)
|
||||
{
|
||||
struct private_object *tech_pvt;
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
assert(channel != NULL);
|
||||
@@ -833,10 +833,10 @@ static switch_status exosip_kill_channel(switch_core_session *session, int sig)
|
||||
|
||||
}
|
||||
|
||||
static switch_status exosip_waitfor_read(switch_core_session *session, int ms, int stream_id)
|
||||
static switch_status exosip_waitfor_read(switch_core_session_t *session, int ms, int stream_id)
|
||||
{
|
||||
struct private_object *tech_pvt;
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
assert(channel != NULL);
|
||||
@@ -848,10 +848,10 @@ static switch_status exosip_waitfor_read(switch_core_session *session, int ms, i
|
||||
}
|
||||
|
||||
|
||||
static switch_status exosip_waitfor_write(switch_core_session *session, int ms, int stream_id)
|
||||
static switch_status exosip_waitfor_write(switch_core_session_t *session, int ms, int stream_id)
|
||||
{
|
||||
struct private_object *tech_pvt;
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
assert(channel != NULL);
|
||||
@@ -863,7 +863,7 @@ static switch_status exosip_waitfor_write(switch_core_session *session, int ms,
|
||||
|
||||
}
|
||||
|
||||
static switch_status exosip_send_dtmf(switch_core_session *session, char *digits)
|
||||
static switch_status exosip_send_dtmf(switch_core_session_t *session, char *digits)
|
||||
{
|
||||
struct private_object *tech_pvt;
|
||||
char *c;
|
||||
@@ -891,9 +891,9 @@ static switch_status exosip_send_dtmf(switch_core_session *session, char *digits
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status exosip_receive_message(switch_core_session *session, switch_core_session_message *msg)
|
||||
static switch_status exosip_receive_message(switch_core_session_t *session, switch_core_session_message_t *msg)
|
||||
{
|
||||
switch_channel *channel;
|
||||
switch_channel_t *channel;
|
||||
struct private_object *tech_pvt;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
@@ -919,7 +919,7 @@ static switch_status exosip_receive_message(switch_core_session *session, switch
|
||||
case SWITCH_MESSAGE_INDICATE_PROGRESS:
|
||||
if (msg) {
|
||||
struct private_object *tech_pvt;
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
assert(channel != NULL);
|
||||
@@ -969,7 +969,7 @@ static const switch_io_routines exosip_io_routines = {
|
||||
/*.receive_message*/ exosip_receive_message
|
||||
};
|
||||
|
||||
static const switch_state_handler_table exosip_event_handlers = {
|
||||
static const switch_state_handler_table_t exosip_event_handlers = {
|
||||
/*.on_init */ exosip_on_init,
|
||||
/*.on_ring */ exosip_on_ring,
|
||||
/*.on_execute */ exosip_on_execute,
|
||||
@@ -995,12 +995,12 @@ static const switch_loadable_module_interface exosip_module_interface = {
|
||||
/*.application_interface */ NULL
|
||||
};
|
||||
|
||||
static switch_status exosip_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile,
|
||||
switch_core_session **new_session, switch_memory_pool_t *pool)
|
||||
static switch_status exosip_outgoing_channel(switch_core_session_t *session, switch_caller_profile_t *outbound_profile,
|
||||
switch_core_session_t **new_session, switch_memory_pool_t *pool)
|
||||
{
|
||||
if ((*new_session = switch_core_session_request(&exosip_endpoint_interface, pool)) != 0) {
|
||||
struct private_object *tech_pvt;
|
||||
switch_channel *channel;
|
||||
switch_channel_t *channel;
|
||||
|
||||
switch_core_session_add_stream(*new_session, NULL);
|
||||
if ((tech_pvt =
|
||||
@@ -1018,7 +1018,7 @@ static switch_status exosip_outgoing_channel(switch_core_session *session, switc
|
||||
|
||||
if (outbound_profile) {
|
||||
char name[128];
|
||||
switch_caller_profile *caller_profile = NULL;
|
||||
switch_caller_profile_t *caller_profile = NULL;
|
||||
|
||||
|
||||
if (*outbound_profile->destination_number == '!') {
|
||||
@@ -1113,13 +1113,13 @@ static void sdp_add_rfc2833(struct osip_rfc3264 *cnf, int rate)
|
||||
|
||||
static switch_status exosip_create_call(eXosip_event_t * event)
|
||||
{
|
||||
switch_core_session *session;
|
||||
switch_core_session_t *session;
|
||||
sdp_message_t *remote_sdp = NULL;
|
||||
sdp_connection_t *conn = NULL;
|
||||
sdp_media_t *remote_med = NULL, *audio_tab[10], *video_tab[10], *t38_tab[10], *app_tab[10];
|
||||
char local_sdp_str[8192] = "", port[8] = "";
|
||||
int mline = 0, pos = 0;
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
char name[128];
|
||||
char *dpayload, *dname = NULL, *drate = NULL;
|
||||
char *remote_sdp_str = NULL;
|
||||
@@ -1262,7 +1262,7 @@ static switch_status exosip_create_call(eXosip_event_t * event)
|
||||
|
||||
if (num_codecs > 0) {
|
||||
int i;
|
||||
static const switch_codec_implementation *imp;
|
||||
static const switch_codec_implementation_t *imp;
|
||||
|
||||
|
||||
|
||||
@@ -1396,7 +1396,7 @@ static switch_status exosip_create_call(eXosip_event_t * event)
|
||||
static void destroy_call_by_event(eXosip_event_t *event)
|
||||
{
|
||||
struct private_object *tech_pvt;
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
switch_call_cause_t cause;
|
||||
|
||||
if ((tech_pvt = get_pvt_by_call_id(event->cid)) == 0) {
|
||||
@@ -1482,7 +1482,7 @@ static void handle_answer(eXosip_event_t * event)
|
||||
sdp_media_t *remote_med = NULL;
|
||||
struct private_object *tech_pvt;
|
||||
char *dpayload = NULL, *dname = NULL, *drate = NULL;
|
||||
switch_channel *channel;
|
||||
switch_channel_t *channel;
|
||||
|
||||
|
||||
if ((tech_pvt = get_pvt_by_call_id(event->cid)) == 0) {
|
||||
@@ -1713,7 +1713,7 @@ static void log_event(eXosip_event_t * je)
|
||||
|
||||
static int config_exosip(int reload)
|
||||
{
|
||||
switch_config cfg;
|
||||
switch_config_t cfg;
|
||||
char *var, *val;
|
||||
char *cf = "exosip.conf";
|
||||
|
||||
|
||||
@@ -79,13 +79,13 @@ static struct {
|
||||
|
||||
struct private_object {
|
||||
unsigned int flags;
|
||||
switch_codec read_codec;
|
||||
switch_codec write_codec;
|
||||
struct switch_frame read_frame;
|
||||
switch_codec_t read_codec;
|
||||
switch_codec_t write_codec;
|
||||
switch_frame_t read_frame;
|
||||
unsigned char databuf[SWITCH_RECCOMMENDED_BUFFER_SIZE];
|
||||
switch_core_session *session;
|
||||
switch_core_session_t *session;
|
||||
struct iax_session *iax_session;
|
||||
switch_caller_profile *caller_profile;
|
||||
switch_caller_profile_t *caller_profile;
|
||||
unsigned int codec;
|
||||
unsigned int codecs;
|
||||
unsigned short samprate;
|
||||
@@ -211,7 +211,7 @@ static switch_status iax_set_codec(struct private_object *tech_pvt, struct iax_s
|
||||
char *dname = NULL;
|
||||
//int rate = 8000;
|
||||
//int codec_ms = 20;
|
||||
switch_channel *channel;
|
||||
switch_channel_t *channel;
|
||||
switch_codec_interface *codecs[SWITCH_MAX_CODECS];
|
||||
int num_codecs = 0;
|
||||
unsigned int local_cap = 0, mixed_cap = 0, chosen = 0, leading = 0;
|
||||
@@ -390,18 +390,18 @@ static switch_status iax_set_codec(struct private_object *tech_pvt, struct iax_s
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status channel_on_init(switch_core_session *session);
|
||||
static switch_status channel_on_hangup(switch_core_session *session);
|
||||
static switch_status channel_on_ring(switch_core_session *session);
|
||||
static switch_status channel_on_loopback(switch_core_session *session);
|
||||
static switch_status channel_on_transmit(switch_core_session *session);
|
||||
static switch_status channel_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile,
|
||||
switch_core_session **new_session, switch_memory_pool_t *pool);
|
||||
static switch_status channel_read_frame(switch_core_session *session, switch_frame **frame, int timeout,
|
||||
static switch_status channel_on_init(switch_core_session_t *session);
|
||||
static switch_status channel_on_hangup(switch_core_session_t *session);
|
||||
static switch_status channel_on_ring(switch_core_session_t *session);
|
||||
static switch_status channel_on_loopback(switch_core_session_t *session);
|
||||
static switch_status channel_on_transmit(switch_core_session_t *session);
|
||||
static switch_status channel_outgoing_channel(switch_core_session_t *session, switch_caller_profile_t *outbound_profile,
|
||||
switch_core_session_t **new_session, switch_memory_pool_t *pool);
|
||||
static switch_status channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout,
|
||||
switch_io_flag flags, int stream_id);
|
||||
static switch_status channel_write_frame(switch_core_session *session, switch_frame *frame, int timeout,
|
||||
static switch_status channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, int timeout,
|
||||
switch_io_flag flags, int stream_id);
|
||||
static switch_status channel_kill_channel(switch_core_session *session, int sig);
|
||||
static switch_status channel_kill_channel(switch_core_session_t *session, int sig);
|
||||
|
||||
|
||||
static void iax_err_cb(const char *s)
|
||||
@@ -422,9 +422,9 @@ State methods they get called when the state changes to the specific state
|
||||
returning SWITCH_STATUS_SUCCESS tells the core to execute the standard state method next
|
||||
so if you fully implement the state you can return SWITCH_STATUS_FALSE to skip it.
|
||||
*/
|
||||
static switch_status channel_on_init(switch_core_session *session)
|
||||
static switch_status channel_on_init(switch_core_session_t *session)
|
||||
{
|
||||
switch_channel *channel;
|
||||
switch_channel_t *channel;
|
||||
struct private_object *tech_pvt = NULL;
|
||||
|
||||
tech_pvt = switch_core_session_get_private(session);
|
||||
@@ -449,9 +449,9 @@ static switch_status channel_on_init(switch_core_session *session)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status channel_on_ring(switch_core_session *session)
|
||||
static switch_status channel_on_ring(switch_core_session_t *session)
|
||||
{
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
struct private_object *tech_pvt = NULL;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
@@ -465,10 +465,10 @@ static switch_status channel_on_ring(switch_core_session *session)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status channel_on_execute(switch_core_session *session)
|
||||
static switch_status channel_on_execute(switch_core_session_t *session)
|
||||
{
|
||||
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
struct private_object *tech_pvt = NULL;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
@@ -483,9 +483,9 @@ static switch_status channel_on_execute(switch_core_session *session)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status channel_on_hangup(switch_core_session *session)
|
||||
static switch_status channel_on_hangup(switch_core_session_t *session)
|
||||
{
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
struct private_object *tech_pvt = NULL;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
@@ -519,9 +519,9 @@ static switch_status channel_on_hangup(switch_core_session *session)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status channel_kill_channel(switch_core_session *session, int sig)
|
||||
static switch_status channel_kill_channel(switch_core_session_t *session, int sig)
|
||||
{
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
struct private_object *tech_pvt = NULL;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
@@ -541,19 +541,19 @@ static switch_status channel_kill_channel(switch_core_session *session, int sig)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status channel_on_loopback(switch_core_session *session)
|
||||
static switch_status channel_on_loopback(switch_core_session_t *session)
|
||||
{
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL LOOPBACK\n");
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status channel_on_transmit(switch_core_session *session)
|
||||
static switch_status channel_on_transmit(switch_core_session_t *session)
|
||||
{
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL TRANSMIT\n");
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status channel_waitfor_read(switch_core_session *session, int ms, int stream_id)
|
||||
static switch_status channel_waitfor_read(switch_core_session_t *session, int ms, int stream_id)
|
||||
{
|
||||
struct private_object *tech_pvt = NULL;
|
||||
|
||||
@@ -563,7 +563,7 @@ static switch_status channel_waitfor_read(switch_core_session *session, int ms,
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status channel_waitfor_write(switch_core_session *session, int ms, int stream_id)
|
||||
static switch_status channel_waitfor_write(switch_core_session_t *session, int ms, int stream_id)
|
||||
{
|
||||
struct private_object *tech_pvt = NULL;
|
||||
|
||||
@@ -574,7 +574,7 @@ static switch_status channel_waitfor_write(switch_core_session *session, int ms,
|
||||
|
||||
}
|
||||
|
||||
static switch_status channel_send_dtmf(switch_core_session *session, char *dtmf)
|
||||
static switch_status channel_send_dtmf(switch_core_session_t *session, char *dtmf)
|
||||
{
|
||||
struct private_object *tech_pvt = NULL;
|
||||
char *digit;
|
||||
@@ -590,10 +590,10 @@ static switch_status channel_send_dtmf(switch_core_session *session, char *dtmf)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status channel_read_frame(switch_core_session *session, switch_frame **frame, int timeout,
|
||||
static switch_status channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout,
|
||||
switch_io_flag flags, int stream_id)
|
||||
{
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
struct private_object *tech_pvt = NULL;
|
||||
switch_time_t started = switch_time_now();
|
||||
unsigned int elapsed;
|
||||
@@ -636,12 +636,12 @@ static switch_status channel_read_frame(switch_core_session *session, switch_fra
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
static switch_status channel_write_frame(switch_core_session *session, switch_frame *frame, int timeout,
|
||||
static switch_status channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, int timeout,
|
||||
switch_io_flag flags, int stream_id)
|
||||
{
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
struct private_object *tech_pvt = NULL;
|
||||
//switch_frame *pframe;
|
||||
//switch_frame_t *pframe;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
assert(channel != NULL);
|
||||
@@ -665,10 +665,10 @@ static switch_status channel_write_frame(switch_core_session *session, switch_fr
|
||||
|
||||
}
|
||||
|
||||
static switch_status channel_answer_channel(switch_core_session *session)
|
||||
static switch_status channel_answer_channel(switch_core_session_t *session)
|
||||
{
|
||||
struct private_object *tech_pvt;
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
assert(channel != NULL);
|
||||
@@ -682,7 +682,7 @@ static switch_status channel_answer_channel(switch_core_session *session)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static const switch_state_handler_table channel_event_handlers = {
|
||||
static const switch_state_handler_table_t channel_event_handlers = {
|
||||
/*.on_init */ channel_on_init,
|
||||
/*.on_ring */ channel_on_ring,
|
||||
/*.on_execute */ channel_on_execute,
|
||||
@@ -723,13 +723,13 @@ static const switch_loadable_module_interface channel_module_interface = {
|
||||
/* Make sure when you have 2 sessions in the same scope that you pass the appropriate one to the routines
|
||||
that allocate memory or you will have 1 channel with memory allocated from another channel's pool!
|
||||
*/
|
||||
static switch_status channel_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile,
|
||||
switch_core_session **new_session, switch_memory_pool_t *pool)
|
||||
static switch_status channel_outgoing_channel(switch_core_session_t *session, switch_caller_profile_t *outbound_profile,
|
||||
switch_core_session_t **new_session, switch_memory_pool_t *pool)
|
||||
{
|
||||
if ((*new_session = switch_core_session_request(&channel_endpoint_interface, pool)) != 0) {
|
||||
struct private_object *tech_pvt;
|
||||
switch_channel *channel;
|
||||
switch_caller_profile *caller_profile;
|
||||
switch_channel_t *channel;
|
||||
switch_caller_profile_t *caller_profile;
|
||||
unsigned int req = 0, cap = 0;
|
||||
unsigned short samprate = 0;
|
||||
|
||||
@@ -817,7 +817,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_modul
|
||||
|
||||
static switch_status load_config(void)
|
||||
{
|
||||
switch_config cfg;
|
||||
switch_config_t cfg;
|
||||
char *var, *val;
|
||||
char *cf = "iax.conf";
|
||||
|
||||
@@ -949,7 +949,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void)
|
||||
case IAX_EVENT_ANSWER:
|
||||
// the other side answered our call
|
||||
if (tech_pvt) {
|
||||
switch_channel *channel;
|
||||
switch_channel_t *channel;
|
||||
if ((channel = switch_core_session_get_channel(tech_pvt->session)) != 0) {
|
||||
if (switch_channel_test_flag(channel, CF_ANSWERED)) {
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "WTF Mutiple Answer %s?\n",
|
||||
@@ -972,13 +972,13 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void)
|
||||
iaxevent->ies.calling_name, iaxevent->ies.format, iaxevent->ies.capability);
|
||||
|
||||
if (iaxevent) {
|
||||
switch_core_session *session;
|
||||
switch_core_session_t *session;
|
||||
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "New Inbound Channel %s!\n",
|
||||
iaxevent->ies.calling_name);
|
||||
if ((session = switch_core_session_request(&channel_endpoint_interface, NULL)) != 0) {
|
||||
struct private_object *tech_pvt;
|
||||
switch_channel *channel;
|
||||
switch_channel_t *channel;
|
||||
|
||||
switch_core_session_add_stream(session, NULL);
|
||||
if ((tech_pvt =
|
||||
@@ -1036,7 +1036,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void)
|
||||
case IAX_EVENT_BUSY:
|
||||
case IAX_EVENT_HANGUP:
|
||||
if (tech_pvt) {
|
||||
switch_channel *channel;
|
||||
switch_channel_t *channel;
|
||||
|
||||
switch_clear_flag(tech_pvt, TFLAG_IO);
|
||||
switch_clear_flag(tech_pvt, TFLAG_VOICE);
|
||||
@@ -1058,7 +1058,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void)
|
||||
break;
|
||||
case IAX_EVENT_VOICE:
|
||||
if (tech_pvt && (tech_pvt->read_frame.datalen = iaxevent->datalen) != 0) {
|
||||
switch_channel *channel;
|
||||
switch_channel_t *channel;
|
||||
if (((channel = switch_core_session_get_channel(tech_pvt->session)) != 0)
|
||||
&& switch_channel_get_state(channel) <= CS_HANGUP) {
|
||||
int bytes, frames;
|
||||
@@ -1086,7 +1086,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void)
|
||||
break;
|
||||
case IAX_EVENT_DTMF:
|
||||
if (tech_pvt) {
|
||||
switch_channel *channel;
|
||||
switch_channel_t *channel;
|
||||
if ((channel = switch_core_session_get_channel(tech_pvt->session)) != 0) {
|
||||
char str[2] = { (char)iaxevent->subclass };
|
||||
if (globals.debug) {
|
||||
|
||||
@@ -80,12 +80,12 @@ static struct {
|
||||
|
||||
struct private_object {
|
||||
unsigned int flags;
|
||||
switch_codec read_codec;
|
||||
switch_codec write_codec;
|
||||
struct switch_frame read_frame;
|
||||
switch_codec_t read_codec;
|
||||
switch_codec_t write_codec;
|
||||
switch_frame_t read_frame;
|
||||
unsigned char databuf[SWITCH_RECCOMMENDED_BUFFER_SIZE];
|
||||
switch_core_session *session;
|
||||
switch_caller_profile *caller_profile;
|
||||
switch_core_session_t *session;
|
||||
switch_caller_profile_t *caller_profile;
|
||||
char call_id[50];
|
||||
PaError err;
|
||||
PABLIO_Stream *audio_in;
|
||||
@@ -98,19 +98,19 @@ SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_dialplan, globals.dialplan)
|
||||
SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_cid_name, globals.cid_name)
|
||||
SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_cid_num, globals.cid_num)
|
||||
|
||||
static switch_status channel_on_init(switch_core_session *session);
|
||||
static switch_status channel_on_hangup(switch_core_session *session);
|
||||
static switch_status channel_on_ring(switch_core_session *session);
|
||||
static switch_status channel_on_loopback(switch_core_session *session);
|
||||
static switch_status channel_on_transmit(switch_core_session *session);
|
||||
static switch_status channel_outgoing_channel(switch_core_session *session,
|
||||
switch_caller_profile *outbound_profile,
|
||||
switch_core_session **new_session, switch_memory_pool_t *pool);
|
||||
static switch_status channel_read_frame(switch_core_session *session, switch_frame **frame, int timeout,
|
||||
static switch_status channel_on_init(switch_core_session_t *session);
|
||||
static switch_status channel_on_hangup(switch_core_session_t *session);
|
||||
static switch_status channel_on_ring(switch_core_session_t *session);
|
||||
static switch_status channel_on_loopback(switch_core_session_t *session);
|
||||
static switch_status channel_on_transmit(switch_core_session_t *session);
|
||||
static switch_status channel_outgoing_channel(switch_core_session_t *session,
|
||||
switch_caller_profile_t *outbound_profile,
|
||||
switch_core_session_t **new_session, switch_memory_pool_t *pool);
|
||||
static switch_status channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout,
|
||||
switch_io_flag flags, int stream_id);
|
||||
static switch_status channel_write_frame(switch_core_session *session, switch_frame *frame, int timeout,
|
||||
static switch_status channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, int timeout,
|
||||
switch_io_flag flags, int stream_id);
|
||||
static switch_status channel_kill_channel(switch_core_session *session, int sig);
|
||||
static switch_status channel_kill_channel(switch_core_session_t *session, int sig);
|
||||
static switch_status engage_device(struct private_object *tech_pvt);
|
||||
static int dump_info(void);
|
||||
static switch_status load_config(void);
|
||||
@@ -126,9 +126,9 @@ SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_dialplan, globals.dialplan)
|
||||
returning SWITCH_STATUS_SUCCESS tells the core to execute the standard state method next
|
||||
so if you fully implement the state you can return SWITCH_STATUS_FALSE to skip it.
|
||||
*/
|
||||
static switch_status channel_on_init(switch_core_session *session)
|
||||
static switch_status channel_on_init(switch_core_session_t *session)
|
||||
{
|
||||
switch_channel *channel;
|
||||
switch_channel_t *channel;
|
||||
struct private_object *tech_pvt = NULL;
|
||||
|
||||
tech_pvt = switch_core_session_get_private(session);
|
||||
@@ -148,9 +148,9 @@ SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_dialplan, globals.dialplan)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status channel_on_ring(switch_core_session *session)
|
||||
static switch_status channel_on_ring(switch_core_session_t *session)
|
||||
{
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
struct private_object *tech_pvt = NULL;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
@@ -164,10 +164,10 @@ static switch_status channel_on_ring(switch_core_session *session)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status channel_on_execute(switch_core_session *session)
|
||||
static switch_status channel_on_execute(switch_core_session_t *session)
|
||||
{
|
||||
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
struct private_object *tech_pvt = NULL;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
@@ -196,9 +196,9 @@ static void deactivate_audio_device(struct private_object *tech_pvt)
|
||||
switch_mutex_unlock(globals.device_lock);
|
||||
}
|
||||
|
||||
static switch_status channel_on_hangup(switch_core_session *session)
|
||||
static switch_status channel_on_hangup(switch_core_session_t *session)
|
||||
{
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
struct private_object *tech_pvt = NULL;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
@@ -220,9 +220,9 @@ static switch_status channel_on_hangup(switch_core_session *session)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status channel_kill_channel(switch_core_session *session, int sig)
|
||||
static switch_status channel_kill_channel(switch_core_session_t *session, int sig)
|
||||
{
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
struct private_object *tech_pvt = NULL;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
@@ -241,15 +241,15 @@ static switch_status channel_kill_channel(switch_core_session *session, int sig)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status channel_on_loopback(switch_core_session *session)
|
||||
static switch_status channel_on_loopback(switch_core_session_t *session)
|
||||
{
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL LOOPBACK\n");
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status channel_on_transmit(switch_core_session *session)
|
||||
static switch_status channel_on_transmit(switch_core_session_t *session)
|
||||
{
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
struct private_object *tech_pvt = NULL;
|
||||
switch_time_t last;
|
||||
int waitsec = 5 * 1000000;
|
||||
@@ -291,7 +291,7 @@ static switch_status channel_on_transmit(switch_core_session *session)
|
||||
}
|
||||
|
||||
|
||||
static switch_status channel_waitfor_read(switch_core_session *session, int ms, int stream_id)
|
||||
static switch_status channel_waitfor_read(switch_core_session_t *session, int ms, int stream_id)
|
||||
{
|
||||
struct private_object *tech_pvt = NULL;
|
||||
|
||||
@@ -301,7 +301,7 @@ static switch_status channel_waitfor_read(switch_core_session *session, int ms,
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status channel_waitfor_write(switch_core_session *session, int ms, int stream_id)
|
||||
static switch_status channel_waitfor_write(switch_core_session_t *session, int ms, int stream_id)
|
||||
{
|
||||
struct private_object *tech_pvt = NULL;
|
||||
|
||||
@@ -312,7 +312,7 @@ static switch_status channel_waitfor_write(switch_core_session *session, int ms,
|
||||
|
||||
}
|
||||
|
||||
static switch_status channel_send_dtmf(switch_core_session *session, char *dtmf)
|
||||
static switch_status channel_send_dtmf(switch_core_session_t *session, char *dtmf)
|
||||
{
|
||||
struct private_object *tech_pvt = NULL;
|
||||
|
||||
@@ -324,10 +324,10 @@ static switch_status channel_send_dtmf(switch_core_session *session, char *dtmf)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status channel_read_frame(switch_core_session *session, switch_frame **frame, int timeout,
|
||||
static switch_status channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout,
|
||||
switch_io_flag flags, int stream_id)
|
||||
{
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
struct private_object *tech_pvt = NULL;
|
||||
int samples;
|
||||
switch_status status = SWITCH_STATUS_FALSE;
|
||||
@@ -358,10 +358,10 @@ static switch_status channel_read_frame(switch_core_session *session, switch_fra
|
||||
return status;
|
||||
}
|
||||
|
||||
static switch_status channel_write_frame(switch_core_session *session, switch_frame *frame, int timeout,
|
||||
static switch_status channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, int timeout,
|
||||
switch_io_flag flags, int stream_id)
|
||||
{
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
struct private_object *tech_pvt = NULL;
|
||||
switch_status status = SWITCH_STATUS_FALSE;
|
||||
channel = switch_core_session_get_channel(session);
|
||||
@@ -384,10 +384,10 @@ static switch_status channel_write_frame(switch_core_session *session, switch_fr
|
||||
|
||||
}
|
||||
|
||||
static switch_status channel_answer_channel(switch_core_session *session)
|
||||
static switch_status channel_answer_channel(switch_core_session_t *session)
|
||||
{
|
||||
struct private_object *tech_pvt;
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
assert(channel != NULL);
|
||||
@@ -434,7 +434,7 @@ static struct switch_api_interface channel_api_interface = {
|
||||
/*.next */ &channel_hup_interface
|
||||
};
|
||||
|
||||
static const switch_state_handler_table channel_event_handlers = {
|
||||
static const switch_state_handler_table_t channel_event_handlers = {
|
||||
/*.on_init */ channel_on_init,
|
||||
/*.on_ring */ channel_on_ring,
|
||||
/*.on_execute */ channel_on_execute,
|
||||
@@ -475,13 +475,13 @@ static const switch_loadable_module_interface channel_module_interface = {
|
||||
/* Make sure when you have 2 sessions in the same scope that you pass the appropriate one to the routines
|
||||
that allocate memory or you will have 1 channel with memory allocated from another channel's pool!
|
||||
*/
|
||||
static switch_status channel_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile,
|
||||
switch_core_session **new_session, switch_memory_pool_t *pool)
|
||||
static switch_status channel_outgoing_channel(switch_core_session_t *session, switch_caller_profile_t *outbound_profile,
|
||||
switch_core_session_t **new_session, switch_memory_pool_t *pool)
|
||||
{
|
||||
if ((*new_session = switch_core_session_request(&channel_endpoint_interface, pool)) != 0) {
|
||||
struct private_object *tech_pvt;
|
||||
switch_channel *channel;
|
||||
switch_caller_profile *caller_profile;
|
||||
switch_channel_t *channel;
|
||||
switch_caller_profile_t *caller_profile;
|
||||
|
||||
switch_core_session_add_stream(*new_session, NULL);
|
||||
if ((tech_pvt =
|
||||
@@ -554,7 +554,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_modul
|
||||
|
||||
static switch_status load_config(void)
|
||||
{
|
||||
switch_config cfg;
|
||||
switch_config_t cfg;
|
||||
char *var, *val;
|
||||
char *cf = "portaudio.conf";
|
||||
|
||||
@@ -715,7 +715,7 @@ static switch_status engage_device(struct private_object *tech_pvt)
|
||||
int sample_rate = globals.sample_rate;
|
||||
int codec_ms = 20;
|
||||
|
||||
switch_channel *channel;
|
||||
switch_channel_t *channel;
|
||||
channel = switch_core_session_get_channel(tech_pvt->session);
|
||||
assert(channel != NULL);
|
||||
|
||||
@@ -782,7 +782,7 @@ static switch_status engage_device(struct private_object *tech_pvt)
|
||||
|
||||
static switch_status place_call(char *dest, char *out, size_t outlen)
|
||||
{
|
||||
switch_core_session *session;
|
||||
switch_core_session_t *session;
|
||||
switch_status status = SWITCH_STATUS_FALSE;
|
||||
|
||||
if (!dest) {
|
||||
@@ -794,7 +794,7 @@ static switch_status place_call(char *dest, char *out, size_t outlen)
|
||||
|
||||
if ((session = switch_core_session_request(&channel_endpoint_interface, NULL)) != 0) {
|
||||
struct private_object *tech_pvt;
|
||||
switch_channel *channel;
|
||||
switch_channel_t *channel;
|
||||
|
||||
switch_core_session_add_stream(session, NULL);
|
||||
if ((tech_pvt = (struct private_object *) switch_core_session_alloc(session, sizeof(struct private_object))) != 0) {
|
||||
@@ -834,7 +834,7 @@ static switch_status place_call(char *dest, char *out, size_t outlen)
|
||||
static switch_status hup_call(char *callid, char *out, size_t outlen)
|
||||
{
|
||||
struct private_object *tech_pvt;
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
char tmp[50];
|
||||
|
||||
if (callid && !strcasecmp(callid, "last")) {
|
||||
@@ -878,7 +878,7 @@ static switch_status hup_call(char *callid, char *out, size_t outlen)
|
||||
static switch_status send_dtmf(char *callid, char *out, size_t outlen)
|
||||
{
|
||||
struct private_object *tech_pvt = NULL;
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
char *dtmf;
|
||||
|
||||
if ((dtmf = strchr(callid, ' ')) != 0) {
|
||||
@@ -902,7 +902,7 @@ static switch_status send_dtmf(char *callid, char *out, size_t outlen)
|
||||
static switch_status answer_call(char *callid, char *out, size_t outlen)
|
||||
{
|
||||
struct private_object *tech_pvt = NULL;
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
|
||||
if ((tech_pvt = switch_core_hash_find(globals.call_hash, callid)) != 0) {
|
||||
channel = switch_core_session_get_channel(tech_pvt->session);
|
||||
@@ -918,7 +918,7 @@ static switch_status answer_call(char *callid, char *out, size_t outlen)
|
||||
|
||||
static void print_info(struct private_object *tech_pvt, char *out, size_t outlen)
|
||||
{
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
channel = switch_core_session_get_channel(tech_pvt->session);
|
||||
assert(channel != NULL);
|
||||
|
||||
|
||||
@@ -130,10 +130,10 @@ struct woomera_profile {
|
||||
|
||||
struct private_object {
|
||||
char *name;
|
||||
switch_frame frame;
|
||||
switch_codec read_codec;
|
||||
switch_codec write_codec;
|
||||
switch_core_session *session;
|
||||
switch_frame_t frame;
|
||||
switch_codec_t read_codec;
|
||||
switch_codec_t write_codec;
|
||||
switch_core_session_t *session;
|
||||
switch_pollfd_t read_poll;
|
||||
switch_pollfd_t write_poll;
|
||||
switch_pollfd_t command_poll;
|
||||
@@ -152,7 +152,7 @@ struct private_object {
|
||||
switch_time_t started;
|
||||
int timeout;
|
||||
char dtmfbuf[WOOMERA_STRLEN];
|
||||
switch_caller_profile *caller_profile;
|
||||
switch_caller_profile_t *caller_profile;
|
||||
struct woomera_event_queue event_queue;
|
||||
};
|
||||
|
||||
@@ -163,18 +163,18 @@ typedef struct woomera_event_queue woomera_event_queue;
|
||||
|
||||
static woomera_profile default_profile;
|
||||
|
||||
static switch_status woomerachan_on_init(switch_core_session *session);
|
||||
static switch_status woomerachan_on_hangup(switch_core_session *session);
|
||||
static switch_status woomerachan_on_ring(switch_core_session *session);
|
||||
static switch_status woomerachan_on_loopback(switch_core_session *session);
|
||||
static switch_status woomerachan_on_transmit(switch_core_session *session);
|
||||
static switch_status woomerachan_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile,
|
||||
switch_core_session **new_session, switch_memory_pool_t *pool);
|
||||
static switch_status woomerachan_read_frame(switch_core_session *session, switch_frame **frame, int timeout,
|
||||
static switch_status woomerachan_on_init(switch_core_session_t *session);
|
||||
static switch_status woomerachan_on_hangup(switch_core_session_t *session);
|
||||
static switch_status woomerachan_on_ring(switch_core_session_t *session);
|
||||
static switch_status woomerachan_on_loopback(switch_core_session_t *session);
|
||||
static switch_status woomerachan_on_transmit(switch_core_session_t *session);
|
||||
static switch_status woomerachan_outgoing_channel(switch_core_session_t *session, switch_caller_profile_t *outbound_profile,
|
||||
switch_core_session_t **new_session, switch_memory_pool_t *pool);
|
||||
static switch_status woomerachan_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout,
|
||||
switch_io_flag flags, int stream_id);
|
||||
static switch_status woomerachan_write_frame(switch_core_session *session, switch_frame *frame, int timeout,
|
||||
static switch_status woomerachan_write_frame(switch_core_session_t *session, switch_frame_t *frame, int timeout,
|
||||
switch_io_flag flags, int stream_id);
|
||||
static switch_status woomerachan_kill_channel(switch_core_session *session, int sig);
|
||||
static switch_status woomerachan_kill_channel(switch_core_session_t *session, int sig);
|
||||
static void tech_destroy(private_object * tech_pvt);
|
||||
static void woomera_printf(woomera_profile * profile, switch_socket_t *socket, char *fmt, ...);
|
||||
static char *woomera_message_header(woomera_message * wmsg, char *key);
|
||||
@@ -195,9 +195,9 @@ static int tech_activate(private_object * tech_pvt);
|
||||
returning SWITCH_STATUS_SUCCESS tells the core to execute the standard state method next
|
||||
so if you fully implement the state you can return SWITCH_STATUS_FALSE to skip it.
|
||||
*/
|
||||
static switch_status woomerachan_on_init(switch_core_session *session)
|
||||
static switch_status woomerachan_on_init(switch_core_session_t *session)
|
||||
{
|
||||
switch_channel *channel;
|
||||
switch_channel_t *channel;
|
||||
struct private_object *tech_pvt = NULL;
|
||||
int rate = 8000;
|
||||
|
||||
@@ -239,9 +239,9 @@ static switch_status woomerachan_on_init(switch_core_session *session)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status woomerachan_on_ring(switch_core_session *session)
|
||||
static switch_status woomerachan_on_ring(switch_core_session_t *session)
|
||||
{
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
struct private_object *tech_pvt = NULL;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
@@ -255,10 +255,10 @@ static switch_status woomerachan_on_ring(switch_core_session *session)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status woomerachan_on_execute(switch_core_session *session)
|
||||
static switch_status woomerachan_on_execute(switch_core_session_t *session)
|
||||
{
|
||||
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
struct private_object *tech_pvt = NULL;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
@@ -273,9 +273,9 @@ static switch_status woomerachan_on_execute(switch_core_session *session)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status woomerachan_on_hangup(switch_core_session *session)
|
||||
static switch_status woomerachan_on_hangup(switch_core_session_t *session)
|
||||
{
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
struct private_object *tech_pvt = NULL;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
@@ -311,9 +311,9 @@ static void udp_socket_close(struct private_object *tech_pvt)
|
||||
}
|
||||
|
||||
|
||||
static switch_status woomerachan_kill_channel(switch_core_session *session, int sig)
|
||||
static switch_status woomerachan_kill_channel(switch_core_session_t *session, int sig)
|
||||
{
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
struct private_object *tech_pvt = NULL;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
@@ -336,19 +336,19 @@ static switch_status woomerachan_kill_channel(switch_core_session *session, int
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status woomerachan_on_loopback(switch_core_session *session)
|
||||
static switch_status woomerachan_on_loopback(switch_core_session_t *session)
|
||||
{
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "WOOMERACHAN LOOPBACK\n");
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status woomerachan_on_transmit(switch_core_session *session)
|
||||
static switch_status woomerachan_on_transmit(switch_core_session_t *session)
|
||||
{
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "WOOMERACHAN TRANSMIT\n");
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status woomerachan_waitfor_read(switch_core_session *session, int ms, int stream_id)
|
||||
static switch_status woomerachan_waitfor_read(switch_core_session_t *session, int ms, int stream_id)
|
||||
{
|
||||
struct private_object *tech_pvt = NULL;
|
||||
|
||||
@@ -358,7 +358,7 @@ static switch_status woomerachan_waitfor_read(switch_core_session *session, int
|
||||
return switch_socket_waitfor(&tech_pvt->read_poll, ms) ? SWITCH_STATUS_FALSE : SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status woomerachan_waitfor_write(switch_core_session *session, int ms, int stream_id)
|
||||
static switch_status woomerachan_waitfor_write(switch_core_session_t *session, int ms, int stream_id)
|
||||
{
|
||||
struct private_object *tech_pvt = NULL;
|
||||
|
||||
@@ -369,12 +369,12 @@ static switch_status woomerachan_waitfor_write(switch_core_session *session, int
|
||||
// return switch_socket_waitfor(&tech_pvt->write_poll, ms);
|
||||
}
|
||||
|
||||
static switch_status woomerachan_read_frame(switch_core_session *session, switch_frame **frame, int timeout,
|
||||
static switch_status woomerachan_read_frame(switch_core_session_t *session, switch_frame_t **frame, int timeout,
|
||||
switch_io_flag flags, int stream_id)
|
||||
{
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
struct private_object *tech_pvt = NULL;
|
||||
switch_frame *pframe;
|
||||
switch_frame_t *pframe;
|
||||
switch_size_t len;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
@@ -404,13 +404,13 @@ static switch_status woomerachan_read_frame(switch_core_session *session, switch
|
||||
return SWITCH_STATUS_FALSE;
|
||||
}
|
||||
|
||||
static switch_status woomerachan_write_frame(switch_core_session *session, switch_frame *frame, int timeout,
|
||||
static switch_status woomerachan_write_frame(switch_core_session_t *session, switch_frame_t *frame, int timeout,
|
||||
switch_io_flag flags, int stream_id)
|
||||
{
|
||||
switch_channel *channel = NULL;
|
||||
switch_channel_t *channel = NULL;
|
||||
struct private_object *tech_pvt = NULL;
|
||||
switch_size_t len;
|
||||
//switch_frame *pframe;
|
||||
//switch_frame_t *pframe;
|
||||
|
||||
channel = switch_core_session_get_channel(session);
|
||||
assert(channel != NULL);
|
||||
@@ -432,7 +432,7 @@ static switch_status woomerachan_write_frame(switch_core_session *session, switc
|
||||
return SWITCH_STATUS_GENERR;
|
||||
}
|
||||
|
||||
static const switch_state_handler_table woomerachan_event_handlers = {
|
||||
static const switch_state_handler_table_t woomerachan_event_handlers = {
|
||||
/*.on_init */ woomerachan_on_init,
|
||||
/*.on_ring */ woomerachan_on_ring,
|
||||
/*.on_execute */ woomerachan_on_execute,
|
||||
@@ -472,12 +472,12 @@ static const switch_loadable_module_interface woomerachan_module_interface = {
|
||||
/* Make sure when you have 2 sessions in the same scope that you pass the appropriate one to the routines
|
||||
that allocate memory or you will have 1 channel with memory allocated from another channel's pool!
|
||||
*/
|
||||
static switch_status woomerachan_outgoing_channel(switch_core_session *session, switch_caller_profile *outbound_profile,
|
||||
switch_core_session **new_session, switch_memory_pool_t *pool)
|
||||
static switch_status woomerachan_outgoing_channel(switch_core_session_t *session, switch_caller_profile_t *outbound_profile,
|
||||
switch_core_session_t **new_session, switch_memory_pool_t *pool)
|
||||
{
|
||||
if ((*new_session = switch_core_session_request(&woomerachan_endpoint_interface, pool)) != 0) {
|
||||
struct private_object *tech_pvt;
|
||||
switch_channel *channel;
|
||||
switch_channel_t *channel;
|
||||
|
||||
switch_core_session_add_stream(*new_session, NULL);
|
||||
if ((tech_pvt =
|
||||
@@ -495,7 +495,7 @@ static switch_status woomerachan_outgoing_channel(switch_core_session *session,
|
||||
|
||||
if (outbound_profile) {
|
||||
char name[128];
|
||||
switch_caller_profile *caller_profile;
|
||||
switch_caller_profile_t *caller_profile;
|
||||
|
||||
snprintf(name, sizeof(name), "Woomera/%s-%04x", outbound_profile->destination_number, rand() & 0xffff);
|
||||
switch_channel_set_name(channel, name);
|
||||
@@ -928,8 +928,8 @@ static int tech_activate(private_object * tech_pvt)
|
||||
|
||||
static void *woomera_channel_thread_run(switch_thread_t *thread, void *obj)
|
||||
{
|
||||
switch_core_session *session = obj;
|
||||
switch_channel *channel = NULL;
|
||||
switch_core_session_t *session = obj;
|
||||
switch_channel_t *channel = NULL;
|
||||
struct private_object *tech_pvt = NULL;
|
||||
woomera_message wmsg;
|
||||
int res = 0;
|
||||
@@ -1227,7 +1227,7 @@ static void *woomera_thread_run(void *obj)
|
||||
|
||||
if (!strcasecmp(wmsg.command, "INCOMING")) {
|
||||
char *name;
|
||||
switch_core_session *session;
|
||||
switch_core_session_t *session;
|
||||
|
||||
if ((name = woomera_message_header(&wmsg, "Remote-Address")) == 0) {
|
||||
name = woomera_message_header(&wmsg, "Channel-Name");
|
||||
@@ -1236,7 +1236,7 @@ static void *woomera_thread_run(void *obj)
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "New Inbound Channel %s!\n", name);
|
||||
if ((session = switch_core_session_request(&woomerachan_endpoint_interface, NULL)) != 0) {
|
||||
struct private_object *tech_pvt;
|
||||
switch_channel *channel;
|
||||
switch_channel_t *channel;
|
||||
|
||||
switch_core_session_add_stream(session, NULL);
|
||||
|
||||
@@ -1301,7 +1301,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_shutdown(void)
|
||||
SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_module_interface **interface, char *filename)
|
||||
{
|
||||
|
||||
switch_config cfg;
|
||||
switch_config_t cfg;
|
||||
char *var, *val;
|
||||
struct woomera_profile *profile = &default_profile;
|
||||
char *cf = "woomera.conf";
|
||||
|
||||
@@ -50,7 +50,7 @@ SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_address, globals.address)
|
||||
|
||||
static switch_status load_config(void)
|
||||
{
|
||||
switch_config cfg;
|
||||
switch_config_t cfg;
|
||||
switch_status status = SWITCH_STATUS_SUCCESS;
|
||||
char *var, *val;
|
||||
char *cf = "event_multicast.conf";
|
||||
|
||||
@@ -72,7 +72,7 @@ static void *torture_thread(switch_thread_t *thread, void *obj)
|
||||
{
|
||||
int y = 0;
|
||||
int z = 0;
|
||||
switch_core_thread_session *ts = obj;
|
||||
switch_core_thread_session_t *ts = obj;
|
||||
switch_event_t *event;
|
||||
|
||||
z = THREADS++;
|
||||
|
||||
@@ -97,7 +97,7 @@ SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_jid, globals.jid)
|
||||
|
||||
static switch_status load_config(void)
|
||||
{
|
||||
switch_config cfg;
|
||||
switch_config_t cfg;
|
||||
switch_status status = SWITCH_STATUS_FALSE;
|
||||
char *var, *val;
|
||||
char *cf = "xmpp_event.conf";
|
||||
|
||||
@@ -193,7 +193,7 @@ static void event_handler(switch_event_t *event)
|
||||
|
||||
static switch_status load_config(void)
|
||||
{
|
||||
switch_config cfg;
|
||||
switch_config_t cfg;
|
||||
switch_status status = SWITCH_STATUS_SUCCESS;
|
||||
char *var, *val;
|
||||
char *cf = "zeroconf.conf";
|
||||
|
||||
@@ -41,7 +41,7 @@ struct sndfile_context {
|
||||
|
||||
typedef struct sndfile_context sndfile_context;
|
||||
|
||||
static switch_status sndfile_file_open(switch_file_handle *handle, char *path)
|
||||
static switch_status sndfile_file_open(switch_file_handle_t *handle, char *path)
|
||||
{
|
||||
sndfile_context *context;
|
||||
int mode = 0;
|
||||
@@ -144,7 +144,7 @@ static switch_status sndfile_file_open(switch_file_handle *handle, char *path)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status sndfile_file_close(switch_file_handle *handle)
|
||||
static switch_status sndfile_file_close(switch_file_handle_t *handle)
|
||||
{
|
||||
sndfile_context *context = handle->private_info;
|
||||
|
||||
@@ -153,7 +153,7 @@ static switch_status sndfile_file_close(switch_file_handle *handle)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status sndfile_file_seek(switch_file_handle *handle, unsigned int *cur_sample, int64_t samples, int whence)
|
||||
static switch_status sndfile_file_seek(switch_file_handle_t *handle, unsigned int *cur_sample, int64_t samples, int whence)
|
||||
{
|
||||
sndfile_context *context = handle->private_info;
|
||||
|
||||
@@ -169,7 +169,7 @@ static switch_status sndfile_file_seek(switch_file_handle *handle, unsigned int
|
||||
|
||||
}
|
||||
|
||||
static switch_status sndfile_file_read(switch_file_handle *handle, void *data, size_t *len)
|
||||
static switch_status sndfile_file_read(switch_file_handle_t *handle, void *data, size_t *len)
|
||||
{
|
||||
size_t inlen = *len;
|
||||
sndfile_context *context = handle->private_info;
|
||||
@@ -191,7 +191,7 @@ static switch_status sndfile_file_read(switch_file_handle *handle, void *data, s
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status sndfile_file_write(switch_file_handle *handle, void *data, size_t *len)
|
||||
static switch_status sndfile_file_write(switch_file_handle_t *handle, void *data, size_t *len)
|
||||
{
|
||||
size_t inlen = *len;
|
||||
sndfile_context *context = handle->private_info;
|
||||
|
||||
@@ -63,7 +63,7 @@ static PerlInterpreter *clone_perl(void)
|
||||
}
|
||||
|
||||
|
||||
static void perl_function(switch_core_session *session, char *data)
|
||||
static void perl_function(switch_core_session_t *session, char *data)
|
||||
{
|
||||
char *uuid = switch_core_session_get_uuid(session);
|
||||
char code[1024];
|
||||
|
||||
@@ -64,44 +64,44 @@ void fs_console_clean(char *msg)
|
||||
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, msg);
|
||||
}
|
||||
|
||||
struct switch_core_session *fs_core_session_locate(char *uuid)
|
||||
switch_core_session_t *fs_core_session_locate(char *uuid)
|
||||
{
|
||||
return switch_core_session_locate(uuid);
|
||||
}
|
||||
|
||||
void fs_channel_answer(struct switch_core_session *session)
|
||||
void fs_channel_answer(switch_core_session_t *session)
|
||||
{
|
||||
switch_channel *channel = switch_core_session_get_channel(session);
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
switch_channel_answer(channel);
|
||||
}
|
||||
|
||||
void fs_channel_pre_answer(struct switch_core_session *session)
|
||||
void fs_channel_pre_answer(switch_core_session_t *session)
|
||||
{
|
||||
switch_channel *channel = switch_core_session_get_channel(session);
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
switch_channel_pre_answer(channel);
|
||||
}
|
||||
|
||||
void fs_channel_hangup(struct switch_core_session *session)
|
||||
void fs_channel_hangup(switch_core_session_t *session)
|
||||
{
|
||||
switch_channel *channel = switch_core_session_get_channel(session);
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
|
||||
}
|
||||
|
||||
void fs_channel_set_variable(struct switch_core_session *session, char *var, char *val)
|
||||
void fs_channel_set_variable(switch_core_session_t *session, char *var, char *val)
|
||||
{
|
||||
switch_channel *channel = switch_core_session_get_channel(session);
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
switch_channel_set_variable(channel, var, val);
|
||||
}
|
||||
|
||||
void fs_channel_get_variable(struct switch_core_session *session, char *var)
|
||||
void fs_channel_get_variable(switch_core_session_t *session, char *var)
|
||||
{
|
||||
switch_channel *channel = switch_core_session_get_channel(session);
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
switch_channel_get_variable(channel, var);
|
||||
}
|
||||
|
||||
void fs_channel_set_state(struct switch_core_session *session, char *state)
|
||||
void fs_channel_set_state(switch_core_session_t *session, char *state)
|
||||
{
|
||||
switch_channel *channel = switch_core_session_get_channel(session);
|
||||
switch_channel_t *channel = switch_core_session_get_channel(session);
|
||||
switch_channel_state fs_state = switch_channel_get_state(channel);
|
||||
|
||||
if (!strcmp(state, "EXECUTE")) {
|
||||
@@ -113,7 +113,7 @@ void fs_channel_set_state(struct switch_core_session *session, char *state)
|
||||
switch_channel_set_state(channel, fs_state);
|
||||
}
|
||||
|
||||
int fs_ivr_play_file(struct switch_core_session *session, char *file, char *timer_name)
|
||||
int fs_ivr_play_file(switch_core_session_t *session, char *file, char *timer_name)
|
||||
{
|
||||
switch_status status;
|
||||
if (switch_strlen_zero(timer_name)) {
|
||||
|
||||
@@ -106,7 +106,7 @@ struct dtmf_callback_state {
|
||||
};
|
||||
|
||||
struct js_session {
|
||||
switch_core_session *session;
|
||||
switch_core_session_t *session;
|
||||
JSContext *cx;
|
||||
JSObject *obj;
|
||||
unsigned int flags;
|
||||
@@ -116,13 +116,13 @@ struct teletone_obj {
|
||||
teletone_generation_session_t ts;
|
||||
JSContext *cx;
|
||||
JSObject *obj;
|
||||
switch_core_session *session;
|
||||
switch_codec codec;
|
||||
switch_buffer *audio_buffer;
|
||||
switch_buffer *loop_buffer;
|
||||
switch_core_session_t *session;
|
||||
switch_codec_t codec;
|
||||
switch_buffer_t *audio_buffer;
|
||||
switch_buffer_t *loop_buffer;
|
||||
switch_memory_pool_t *pool;
|
||||
switch_timer *timer;
|
||||
switch_timer timer_base;
|
||||
switch_timer_t *timer;
|
||||
switch_timer_t timer_base;
|
||||
char code_buffer[1024];
|
||||
char ret_val[1024];
|
||||
unsigned int flags;
|
||||
@@ -175,12 +175,12 @@ static switch_status init_js(void)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status js_stream_dtmf_callback(switch_core_session *session, char *dtmf, void *buf, unsigned int buflen)
|
||||
static switch_status js_stream_dtmf_callback(switch_core_session_t *session, char *dtmf, void *buf, unsigned int buflen)
|
||||
{
|
||||
char code[2048];
|
||||
struct dtmf_callback_state *cb_state = buf;
|
||||
struct js_session *jss = cb_state->session_state;
|
||||
switch_file_handle *fh = cb_state->extra;
|
||||
switch_file_handle_t *fh = cb_state->extra;
|
||||
jsval rval;
|
||||
char *ret;
|
||||
|
||||
@@ -241,7 +241,7 @@ static switch_status js_stream_dtmf_callback(switch_core_session *session, char
|
||||
switch_core_file_seek(fh, &pos, 0, SEEK_SET);
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
} else if (!strncasecmp(ret, "seek", 4)) {
|
||||
switch_codec *codec;
|
||||
switch_codec_t *codec;
|
||||
unsigned int samps = 0;
|
||||
unsigned int pos = 0;
|
||||
char *p;
|
||||
@@ -283,12 +283,12 @@ static switch_status js_stream_dtmf_callback(switch_core_session *session, char
|
||||
}
|
||||
|
||||
|
||||
static switch_status js_record_dtmf_callback(switch_core_session *session, char *dtmf, void *buf, unsigned int buflen)
|
||||
static switch_status js_record_dtmf_callback(switch_core_session_t *session, char *dtmf, void *buf, unsigned int buflen)
|
||||
{
|
||||
char code[2048];
|
||||
struct dtmf_callback_state *cb_state = buf;
|
||||
struct js_session *jss = cb_state->session_state;
|
||||
switch_file_handle *fh = cb_state->extra;
|
||||
switch_file_handle_t *fh = cb_state->extra;
|
||||
jsval rval;
|
||||
char *ret;
|
||||
|
||||
@@ -344,7 +344,7 @@ static switch_status js_record_dtmf_callback(switch_core_session *session, char
|
||||
}
|
||||
|
||||
|
||||
static switch_status js_speak_dtmf_callback(switch_core_session *session, char *dtmf, void *buf, unsigned int buflen)
|
||||
static switch_status js_speak_dtmf_callback(switch_core_session_t *session, char *dtmf, void *buf, unsigned int buflen)
|
||||
{
|
||||
char code[2048];
|
||||
struct dtmf_callback_state *cb_state = buf;
|
||||
@@ -392,14 +392,14 @@ static switch_status js_speak_dtmf_callback(switch_core_session *session, char *
|
||||
static JSBool session_recordfile(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
struct js_session *jss = JS_GetPrivate(cx, obj);
|
||||
switch_channel *channel;
|
||||
switch_channel_t *channel;
|
||||
char *file_name = NULL;
|
||||
char *dtmf_callback = NULL;
|
||||
void *bp = NULL;
|
||||
int len = 0;
|
||||
switch_dtmf_callback_function dtmf_func = NULL;
|
||||
struct dtmf_callback_state cb_state = {0};
|
||||
switch_file_handle fh;
|
||||
switch_file_handle_t fh;
|
||||
|
||||
channel = switch_core_session_get_channel(jss->session);
|
||||
assert(channel != NULL);
|
||||
@@ -437,7 +437,7 @@ static JSBool session_recordfile(JSContext *cx, JSObject *obj, uintN argc, jsval
|
||||
static JSBool session_streamfile(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
struct js_session *jss = JS_GetPrivate(cx, obj);
|
||||
switch_channel *channel;
|
||||
switch_channel_t *channel;
|
||||
char *file_name = NULL;
|
||||
char *timer_name = NULL;
|
||||
char *dtmf_callback = NULL;
|
||||
@@ -445,7 +445,7 @@ static JSBool session_streamfile(JSContext *cx, JSObject *obj, uintN argc, jsval
|
||||
int len = 0;
|
||||
switch_dtmf_callback_function dtmf_func = NULL;
|
||||
struct dtmf_callback_state cb_state = {0};
|
||||
switch_file_handle fh;
|
||||
switch_file_handle_t fh;
|
||||
|
||||
channel = switch_core_session_get_channel(jss->session);
|
||||
assert(channel != NULL);
|
||||
@@ -489,13 +489,13 @@ static JSBool session_streamfile(JSContext *cx, JSObject *obj, uintN argc, jsval
|
||||
static JSBool session_speak(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
struct js_session *jss = JS_GetPrivate(cx, obj);
|
||||
switch_channel *channel;
|
||||
switch_channel_t *channel;
|
||||
char *tts_name = NULL;
|
||||
char *voice_name = NULL;
|
||||
char *text = NULL;
|
||||
char *dtmf_callback = NULL;
|
||||
char *timer_name = NULL;
|
||||
switch_codec *codec;
|
||||
switch_codec_t *codec;
|
||||
void *bp = NULL;
|
||||
int len = 0;
|
||||
struct dtmf_callback_state cb_state = {0};
|
||||
@@ -586,7 +586,7 @@ static JSBool session_get_digits(JSContext *cx, JSObject *obj, uintN argc, jsval
|
||||
static JSBool session_answer(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
struct js_session *jss = JS_GetPrivate(cx, obj);
|
||||
switch_channel *channel;
|
||||
switch_channel_t *channel;
|
||||
|
||||
channel = switch_core_session_get_channel(jss->session);
|
||||
assert(channel != NULL);
|
||||
@@ -598,7 +598,7 @@ static JSBool session_answer(JSContext *cx, JSObject *obj, uintN argc, jsval *ar
|
||||
static JSBool session_ready(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
struct js_session *jss = JS_GetPrivate(cx, obj);
|
||||
switch_channel *channel;
|
||||
switch_channel_t *channel;
|
||||
|
||||
channel = switch_core_session_get_channel(jss->session);
|
||||
assert(channel != NULL);
|
||||
@@ -610,7 +610,7 @@ static JSBool session_ready(JSContext *cx, JSObject *obj, uintN argc, jsval *arg
|
||||
static JSBool session_wait_for_answer(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
struct js_session *jss = JS_GetPrivate(cx, obj);
|
||||
switch_channel *channel;
|
||||
switch_channel_t *channel;
|
||||
switch_time_t started;
|
||||
unsigned int elapsed;
|
||||
int32 timeout = 60;
|
||||
@@ -660,7 +660,7 @@ static JSBool session_execute(JSContext *cx, JSObject *obj, uintN argc, jsval *a
|
||||
static JSBool session_hangup(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
struct js_session *jss = JS_GetPrivate(cx, obj);
|
||||
switch_channel *channel;
|
||||
switch_channel_t *channel;
|
||||
|
||||
channel = switch_core_session_get_channel(jss->session);
|
||||
assert(channel != NULL);
|
||||
@@ -852,8 +852,8 @@ static JSBool session_getProperty(JSContext *cx, JSObject *obj, jsval id, jsval
|
||||
struct js_session *jss = JS_GetPrivate(cx, obj);
|
||||
int param = 0;
|
||||
JSBool res = JS_TRUE;
|
||||
switch_channel *channel;
|
||||
switch_caller_profile *caller_profile;
|
||||
switch_channel_t *channel;
|
||||
switch_caller_profile_t *caller_profile;
|
||||
char *name;
|
||||
|
||||
channel = switch_core_session_get_channel(jss->session);
|
||||
@@ -928,7 +928,7 @@ JSClass session_class = {
|
||||
};
|
||||
|
||||
|
||||
static JSObject *new_js_session(JSContext *cx, JSObject *obj, switch_core_session *session, struct js_session *jss, char *name, int flags)
|
||||
static JSObject *new_js_session(JSContext *cx, JSObject *obj, switch_core_session_t *session, struct js_session *jss, char *name, int flags)
|
||||
{
|
||||
JSObject *session_obj;
|
||||
if ((session_obj = JS_DefineObject(cx, obj, name, &session_class, NULL, 0))) {
|
||||
@@ -969,8 +969,8 @@ static JSBool session_construct(JSContext *cx, JSObject *obj, uintN argc, jsval
|
||||
if (argc > 2) {
|
||||
struct js_session *jss = NULL;
|
||||
JSObject *session_obj;
|
||||
switch_core_session *session = NULL, *peer_session = NULL;
|
||||
switch_caller_profile *caller_profile = NULL;
|
||||
switch_core_session_t *session = NULL, *peer_session = NULL;
|
||||
switch_caller_profile_t *caller_profile = NULL;
|
||||
char *channel_type = NULL;
|
||||
char *dest = NULL;
|
||||
char *dialplan = NULL;
|
||||
@@ -1053,7 +1053,7 @@ static void session_destroy(JSContext *cx, JSObject *obj)
|
||||
if (cx && obj) {
|
||||
if ((jss = JS_GetPrivate(cx, obj))) {
|
||||
if (switch_test_flag(jss, S_HUP)) {
|
||||
switch_channel *channel;
|
||||
switch_channel_t *channel;
|
||||
|
||||
if (jss->session) {
|
||||
channel = switch_core_session_get_channel(jss->session);
|
||||
@@ -1471,7 +1471,7 @@ static JSBool teletone_construct(JSContext *cx, JSObject *obj, uintN argc, jsval
|
||||
JSObject *session_obj;
|
||||
struct teletone_obj *tto = NULL;
|
||||
struct js_session *jss = NULL;
|
||||
switch_codec *read_codec;
|
||||
switch_codec_t *read_codec;
|
||||
switch_memory_pool_t *pool;
|
||||
char *timer_name = NULL;
|
||||
|
||||
@@ -1601,13 +1601,13 @@ static JSBool teletone_generate(JSContext *cx, JSObject *obj, uintN argc, jsval
|
||||
|
||||
if (argc > 0) {
|
||||
char *script;
|
||||
switch_core_session *session;
|
||||
switch_frame write_frame = {0};
|
||||
switch_core_session_t *session;
|
||||
switch_frame_t write_frame = {0};
|
||||
unsigned char *fdata[1024];
|
||||
switch_frame *read_frame;
|
||||
switch_frame_t *read_frame;
|
||||
int stream_id;
|
||||
switch_core_thread_session thread_session;
|
||||
switch_channel *channel;
|
||||
switch_core_thread_session_t thread_session;
|
||||
switch_channel_t *channel;
|
||||
|
||||
if (argc > 1) {
|
||||
if (!JS_ValueToInt32(cx, argv[1], &loops)) {
|
||||
@@ -1676,7 +1676,7 @@ static JSBool teletone_generate(JSContext *cx, JSObject *obj, uintN argc, jsval
|
||||
}
|
||||
if ((write_frame.datalen = (uint32_t)switch_buffer_read(tto->audio_buffer, fdata, write_frame.codec->implementation->bytes_per_frame)) <= 0) {
|
||||
if (loops > 0) {
|
||||
switch_buffer *tmp;
|
||||
switch_buffer_t *tmp;
|
||||
|
||||
/* Switcharoo*/
|
||||
tmp = tto->audio_buffer;
|
||||
@@ -2059,7 +2059,7 @@ static int env_init(JSContext *cx, JSObject *javascript_object)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void js_parse_and_execute(switch_core_session *session, char *input_code)
|
||||
static void js_parse_and_execute(switch_core_session_t *session, char *input_code)
|
||||
{
|
||||
JSObject *javascript_global_object = NULL;
|
||||
char buf[1024], *script, *arg, *argv[512];
|
||||
|
||||
@@ -80,7 +80,7 @@ static void add_mapping(char *var, char *val)
|
||||
|
||||
static switch_status config_logger(void)
|
||||
{
|
||||
switch_config cfg;
|
||||
switch_config_t cfg;
|
||||
char *var, *val;
|
||||
char *cf = "console.conf";
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ struct timer_private {
|
||||
#endif
|
||||
};
|
||||
|
||||
static switch_status soft_timer_init(switch_timer *timer)
|
||||
static switch_status soft_timer_init(switch_timer_t *timer)
|
||||
{
|
||||
struct timer_private *private;
|
||||
|
||||
@@ -65,7 +65,7 @@ static switch_status soft_timer_init(switch_timer *timer)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status soft_timer_next(switch_timer *timer)
|
||||
static switch_status soft_timer_next(switch_timer_t *timer)
|
||||
{
|
||||
struct timer_private *private = timer->private_info;
|
||||
|
||||
@@ -91,7 +91,7 @@ static switch_status soft_timer_next(switch_timer *timer)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status soft_timer_destroy(switch_timer *timer)
|
||||
static switch_status soft_timer_destroy(switch_timer_t *timer)
|
||||
{
|
||||
timer->private_info = NULL;
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user