stage 1 of wrecking ball (duck!)

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5347 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale committed 2007-06-13 20:40:06 +00:00
1 parent 1d38303345
commit 95f007586f
45 files changed
+414 -280

No files matched your search

+4 -4
View File
@@ -735,7 +735,7 @@ static switch_api_interface_t channel_api_interface = {
/*.next */
};
static const switch_state_handler_table_t channel_event_handlers = {
static switch_state_handler_table_t channel_event_handlers = {
/*.on_init */ channel_on_init,
/*.on_ring */ channel_on_ring,
/*.on_execute */ channel_on_execute,
@@ -744,7 +744,7 @@ static const switch_state_handler_table_t channel_event_handlers = {
/*.on_transmit */ channel_on_transmit
};
static const switch_io_routines_t channel_io_routines = {
static switch_io_routines_t channel_io_routines = {
/*.outgoing_channel */ channel_outgoing_channel,
/*.read_frame */ channel_read_frame,
/*.write_frame */ channel_write_frame,
@@ -755,7 +755,7 @@ static const switch_io_routines_t channel_io_routines = {
/*.receive_message */ channel_receive_message
};
static const switch_endpoint_interface_t channel_endpoint_interface = {
static switch_endpoint_interface_t channel_endpoint_interface = {
/*.interface_name */ "alsa",
/*.io_routines */ &channel_io_routines,
/*.event_handlers */ &channel_event_handlers,
@@ -763,7 +763,7 @@ static const switch_endpoint_interface_t channel_endpoint_interface = {
/*.next */ NULL
};
static const switch_loadable_module_interface_t channel_module_interface = {
static switch_loadable_module_interface_t channel_module_interface = {
/*.module_name */ modname,
/*.endpoint_interface */ &channel_endpoint_interface,
/*.timer_interface */ NULL,
@@ -1569,7 +1569,7 @@ static switch_status_t channel_receive_event(switch_core_session_t *session, swi
return SWITCH_STATUS_SUCCESS;
}
static const switch_state_handler_table_t channel_event_handlers = {
static switch_state_handler_table_t channel_event_handlers = {
/*.on_init */ channel_on_init,
/*.on_ring */ channel_on_ring,
/*.on_execute */ channel_on_execute,
@@ -1578,7 +1578,7 @@ static const switch_state_handler_table_t channel_event_handlers = {
/*.on_transmit */ channel_on_transmit
};
static const switch_io_routines_t channel_io_routines = {
static switch_io_routines_t channel_io_routines = {
/*.outgoing_channel */ channel_outgoing_channel,
/*.read_frame */ channel_read_frame,
/*.write_frame */ channel_write_frame,
@@ -1590,7 +1590,7 @@ static const switch_io_routines_t channel_io_routines = {
/*.receive_event */ channel_receive_event
};
static const switch_endpoint_interface_t channel_endpoint_interface = {
static switch_endpoint_interface_t channel_endpoint_interface = {
/*.interface_name */ "dingaling",
/*.io_routines */ &channel_io_routines,
/*.event_handlers */ &channel_event_handlers,
@@ -1631,12 +1631,12 @@ static switch_api_interface_t login_api_interface = {
/*.next */ &logout_api_interface
};
static const switch_chat_interface_t channel_chat_interface = {
static switch_chat_interface_t channel_chat_interface = {
/*.name */ MDL_CHAT_PROTO,
/*.chat_send */ chat_send,
};
static const switch_loadable_module_interface_t channel_module_interface = {
static switch_loadable_module_interface_t channel_module_interface = {
/*.module_name */ modname,
/*.endpoint_interface */ &channel_endpoint_interface,
/*.timer_interface */ NULL,
+30 -47
View File
@@ -43,6 +43,7 @@ SWITCH_MODULE_DEFINITION(mod_iax, mod_iax_load, mod_iax_shutdown, mod_iax_runtim
#include <sys/timeb.h>
#endif
static switch_endpoint_interface_t *channel_endpoint_interface;
static switch_memory_pool_t *module_pool = NULL;
static int running = 1;
@@ -773,44 +774,6 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s
return SWITCH_STATUS_SUCCESS;
}
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,
/*.on_hangup */ channel_on_hangup,
/*.on_loopback */ channel_on_loopback,
/*.on_transmit */ channel_on_transmit
};
static const switch_io_routines_t channel_io_routines = {
/*.outgoing_channel */ channel_outgoing_channel,
/*.read_frame */ channel_read_frame,
/*.write_frame */ channel_write_frame,
/*.kill_channel */ channel_kill_channel,
/*.waitfor_read */ channel_waitfor_read,
/*.waitfor_write */ channel_waitfor_write,
/*.send_dtmf */ channel_send_dtmf,
/*.receive_message*/ channel_receive_message
};
static const switch_endpoint_interface_t channel_endpoint_interface = {
/*.interface_name */ "iax",
/*.io_routines */ &channel_io_routines,
/*.event_handlers */ &channel_event_handlers,
/*.private */ NULL,
/*.next */ NULL
};
static const switch_loadable_module_interface_t channel_module_interface = {
/*.module_name */ modname,
/*.endpoint_interface */ &channel_endpoint_interface,
/*.timer_interface */ NULL,
/*.dialplan_interface */ NULL,
/*.codec_interface */ NULL,
/*.application_interface */ NULL
};
/* 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!
*/
@@ -818,7 +781,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
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) {
if ((*new_session = switch_core_session_request(channel_endpoint_interface, pool)) != 0) {
private_t *tech_pvt;
switch_channel_t *channel;
switch_caller_profile_t *caller_profile;
@@ -877,17 +840,37 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
}
static switch_state_handler_table_t channel_state_handlers = {
/*.on_init */ channel_on_init,
/*.on_ring */ channel_on_ring,
/*.on_execute */ channel_on_execute,
/*.on_hangup */ channel_on_hangup,
/*.on_loopback */ channel_on_loopback,
/*.on_transmit */ channel_on_transmit
};
static switch_io_routines_t channel_io_routines = {
/*.outgoing_channel */ channel_outgoing_channel,
/*.read_frame */ channel_read_frame,
/*.write_frame */ channel_write_frame,
/*.kill_channel */ channel_kill_channel,
/*.waitfor_read */ channel_waitfor_read,
/*.waitfor_write */ channel_waitfor_write,
/*.send_dtmf */ channel_send_dtmf,
/*.receive_message*/ channel_receive_message
};
SWITCH_MODULE_LOAD_FUNCTION(mod_iax_load)
{
if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "OH OH no pool\n");
return SWITCH_STATUS_TERM;
}
module_pool = pool;
/* connect my internal structure to the blank pointer passed to me */
*module_interface = &channel_module_interface;
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
channel_endpoint_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_ENDPOINT_INTERFACE);
channel_endpoint_interface->interface_name = modname;
channel_endpoint_interface->io_routines = &channel_io_routines;
channel_endpoint_interface->state_handler = &channel_state_handlers;
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
@@ -1091,7 +1074,7 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_iax_runtime)
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) {
if ((session = switch_core_session_request(channel_endpoint_interface, NULL)) != 0) {
private_t *tech_pvt;
switch_channel_t *channel;
@@ -782,7 +782,7 @@ static switch_api_interface_t channel_api_interface = {
/*.next */ &channel_call_interface
};
static const switch_state_handler_table_t channel_event_handlers = {
static switch_state_handler_table_t channel_event_handlers = {
/*.on_init */ channel_on_init,
/*.on_ring */ channel_on_ring,
/*.on_execute */ channel_on_execute,
@@ -791,7 +791,7 @@ static const switch_state_handler_table_t channel_event_handlers = {
/*.on_transmit */ channel_on_transmit
};
static const switch_io_routines_t channel_io_routines = {
static switch_io_routines_t channel_io_routines = {
/*.outgoing_channel */ channel_outgoing_channel,
/*.read_frame */ channel_read_frame,
/*.write_frame */ channel_write_frame,
@@ -802,7 +802,7 @@ static const switch_io_routines_t channel_io_routines = {
/*.receive_message */ channel_receive_message
};
static const switch_endpoint_interface_t channel_endpoint_interface = {
static switch_endpoint_interface_t channel_endpoint_interface = {
/*.interface_name */ "portaudio",
/*.io_routines */ &channel_io_routines,
/*.event_handlers */ &channel_event_handlers,
@@ -810,7 +810,7 @@ static const switch_endpoint_interface_t channel_endpoint_interface = {
/*.next */ NULL
};
static const switch_loadable_module_interface_t channel_module_interface = {
static switch_loadable_module_interface_t channel_module_interface = {
/*.module_name */ modname,
/*.endpoint_interface */ &channel_endpoint_interface,
/*.timer_interface */ NULL,
+8 -8
View File
@@ -43,7 +43,7 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_sofia_shutdown);
SWITCH_MODULE_DEFINITION(mod_sofia, mod_sofia_load, mod_sofia_shutdown, NULL);
struct mod_sofia_globals mod_sofia_globals;
const switch_endpoint_interface_t sofia_endpoint_interface;
switch_endpoint_interface_t sofia_endpoint_interface;
static switch_frame_t silence_frame = { 0 };
static char silence_data[13] = "";
@@ -465,7 +465,7 @@ static switch_status_t sofia_read_frame(switch_core_session_t *session, switch_f
if (switch_test_flag(tech_pvt, TFLAG_IO)) {
switch_status_t status;
if (!switch_test_flag(tech_pvt, TFLAG_RTP)) {
return SWITCH_STATUS_GENERR;
}
@@ -1264,7 +1264,7 @@ SWITCH_STANDARD_API(sofia_function)
}
static const switch_io_routines_t sofia_io_routines = {
static switch_io_routines_t sofia_io_routines = {
/*.outgoing_channel */ sofia_outgoing_channel,
/*.read_frame */ sofia_read_frame,
/*.write_frame */ sofia_write_frame,
@@ -1279,7 +1279,7 @@ static const switch_io_routines_t sofia_io_routines = {
/*.write_video_frame*/ sofia_write_video_frame
};
static const switch_state_handler_table_t sofia_event_handlers = {
static switch_state_handler_table_t sofia_event_handlers = {
/*.on_init */ sofia_on_init,
/*.on_ring */ sofia_on_ring,
/*.on_execute */ sofia_on_execute,
@@ -1288,7 +1288,7 @@ static const switch_state_handler_table_t sofia_event_handlers = {
/*.on_transmit */ sofia_on_transmit
};
const switch_endpoint_interface_t sofia_endpoint_interface = {
switch_endpoint_interface_t sofia_endpoint_interface = {
/*.interface_name */ "sofia",
/*.io_routines */ &sofia_io_routines,
/*.event_handlers */ &sofia_event_handlers,
@@ -1296,7 +1296,7 @@ const switch_endpoint_interface_t sofia_endpoint_interface = {
/*.next */ NULL
};
static const switch_chat_interface_t sofia_chat_interface = {
static switch_chat_interface_t sofia_chat_interface = {
/*.name */ SOFIA_CHAT_PROTO,
/*.sofia_presence_chat_send */ sofia_presence_chat_send,
@@ -1307,7 +1307,7 @@ static switch_status_t sofia_manage(char *relative_oid, switch_management_action
return SWITCH_STATUS_SUCCESS;
}
static const switch_management_interface_t sofia_management_interface = {
static switch_management_interface_t sofia_management_interface = {
/*.relative_oid */ "1",
/*.management_function */ sofia_manage
};
@@ -1320,7 +1320,7 @@ static switch_api_interface_t sofia_api_interface = {
/*.next */ NULL
};
static const switch_loadable_module_interface_t sofia_module_interface = {
static switch_loadable_module_interface_t sofia_module_interface = {
/*.module_name */ modname,
/*.endpoint_interface */ &sofia_endpoint_interface,
/*.timer_interface */ NULL,
+1 -1
View File
@@ -465,7 +465,7 @@ switch_call_cause_t sofia_glue_sip_cause_to_freeswitch(int status);
void sofia_glue_do_xfer_invite(switch_core_session_t *session);
uint8_t sofia_reg_handle_register(nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sip_t const *sip,
sofia_regtype_t regtype, char *key, uint32_t keylen, switch_event_t **v_event);
extern const switch_endpoint_interface_t sofia_endpoint_interface;
extern switch_endpoint_interface_t sofia_endpoint_interface;
void sofia_presence_set_chat_hash(private_object_t *tech_pvt, sip_t const *sip);
switch_status_t sofia_on_hangup(switch_core_session_t *session);
char *sofia_glue_get_url_from_contact(char *buf, uint8_t to_dup);
+4 -4
View File
@@ -963,7 +963,7 @@ static switch_status_t wanpipe_kill_channel(switch_core_session_t *session, int
}
static const switch_io_routines_t wanpipe_io_routines = {
static switch_io_routines_t wanpipe_io_routines = {
/*.outgoing_channel */ wanpipe_outgoing_channel,
/*.read_frame */ wanpipe_read_frame,
/*.write_frame */ wanpipe_write_frame,
@@ -974,7 +974,7 @@ static const switch_io_routines_t wanpipe_io_routines = {
/*.receive_message*/ wanpipe_receive_message
};
static const switch_state_handler_table_t wanpipe_state_handlers = {
static switch_state_handler_table_t wanpipe_state_handlers = {
/*.on_init */ wanpipe_on_init,
/*.on_ring */ wanpipe_on_ring,
/*.on_execute */ NULL,
@@ -983,7 +983,7 @@ static const switch_state_handler_table_t wanpipe_state_handlers = {
/*.on_transmit */ wanpipe_on_transmit
};
static const switch_endpoint_interface_t wanpipe_endpoint_interface = {
static switch_endpoint_interface_t wanpipe_endpoint_interface = {
/*.interface_name */ "wanpipe",
/*.io_routines */ &wanpipe_io_routines,
/*.state_handlers */ &wanpipe_state_handlers,
@@ -991,7 +991,7 @@ static const switch_endpoint_interface_t wanpipe_endpoint_interface = {
/*.next */ NULL
};
static const switch_loadable_module_interface_t wanpipe_module_interface = {
static switch_loadable_module_interface_t wanpipe_module_interface = {
/*.module_name */ modname,
/*.endpoint_interface */ &wanpipe_endpoint_interface,
/*.timer_interface */ NULL,
+4 -4
View File
@@ -441,7 +441,7 @@ static switch_status_t woomera_write_frame(switch_core_session_t *session, switc
return SWITCH_STATUS_GENERR;
}
static const switch_state_handler_table_t woomera_event_handlers = {
static switch_state_handler_table_t woomera_event_handlers = {
/*.on_init */ woomera_on_init,
/*.on_ring */ woomera_on_ring,
/*.on_execute */ woomera_on_execute,
@@ -450,7 +450,7 @@ static const switch_state_handler_table_t woomera_event_handlers = {
/*.on_transmit */ woomera_on_transmit
};
static const switch_io_routines_t woomera_io_routines = {
static switch_io_routines_t woomera_io_routines = {
/*.outgoing_channel */ woomera_outgoing_channel,
/*.read_frame */ woomera_read_frame,
/*.write_frame */ woomera_write_frame,
@@ -459,7 +459,7 @@ static const switch_io_routines_t woomera_io_routines = {
/*.waitfor_write */ woomera_waitfor_write
};
static const switch_endpoint_interface_t woomera_endpoint_interface = {
static switch_endpoint_interface_t woomera_endpoint_interface = {
/*.interface_name */ "woomera",
/*.io_routines */ &woomera_io_routines,
/*.event_handlers */ &woomera_event_handlers,
@@ -467,7 +467,7 @@ static const switch_endpoint_interface_t woomera_endpoint_interface = {
/*.next */ NULL
};
static const switch_loadable_module_interface_t woomera_module_interface = {
static switch_loadable_module_interface_t woomera_module_interface = {
/*.module_name */ modname,
/*.endpoint_interface */ &woomera_endpoint_interface,
/*.timer_interface */ NULL,