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:
Michael Jerris committed 2006-04-29 06:05:03 +00:00
1 parent e92ca062aa
commit 73a3adac8f
53 files changed
+959 -956

No files matched your search

+52 -52
View File
@@ -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);
+53 -53
View File
@@ -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";
+50 -50
View File
@@ -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) {
+51 -51
View File
@@ -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);
+45 -45
View File
@@ -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";