/*.application_interface*/ &bridge_application_interface
};
-SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_module_interface **interface) {
+SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_module_interface **interface, char *filename) {
/* connect my internal structure to the blank pointer passed to me */
*interface = &mod_bridgecall_module_interface;
/*.application_interface =*/ NULL
};
-SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_module_interface **interface) {
+SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_module_interface **interface, char *filename) {
/* connect my internal structure to the blank pointer passed to me */
*interface = &demo_dialplan_module_interface;
return SWITCH_STATUS_SUCCESS;
}
-SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_module_interface **interface) {
+SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_module_interface **interface, char *filename) {
/* NOTE: **interface is **_interface because the common lib redefines interface to struct in some situations */
if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
return SWITCH_STATUS_SUCCESS;
}
-SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_module_interface **interface) {
+SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_module_interface **interface, char *filename) {
/* NOTE: **interface is **_interface because the common lib redefines interface to struct in some situations */
if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
return SWITCH_STATUS_SUCCESS;
}
-SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_module_interface **_interface) {
+SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_module_interface **_interface, char *filename) {
/* NOTE: **interface is **_interface because the common lib redefines interface to struct in some situations */
if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
};
-SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_module_interface **interface) {
+SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_module_interface **interface, char *filename) {
/* connect my internal structure to the blank pointer passed to me */
*interface = &g711_module_interface;
};
-SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_module_interface **interface) {
+SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_module_interface **interface, char *filename) {
if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
switch_console_printf(SWITCH_CHANNEL_CONSOLE, "OH OH no pool\n");
int netfd;
int refresh;
struct iax_event *iaxevent = 0;
- struct private_object *tech_pvt = NULL;
-
+
load_config();
if ((res = iax_init(globals.port) < 0)) {
if (!(iaxevent = iax_get_event(0))) {
switch_yield(100);
} else {
+ struct private_object *tech_pvt = iax_get_private(iaxevent->session);
+
if (globals.debug && iaxevent->etype != IAX_EVENT_VOICE) {
switch_console_printf(SWITCH_CHANNEL_CONSOLE, "Event %d [%s]!\n",
iaxevent->etype, IAXNAMES[iaxevent->etype]);
case IAX_EVENT_TIMEOUT:
break;
case IAX_EVENT_ACCEPT:
- if ((tech_pvt = iax_get_private(iaxevent->session))) {
+ if (tech_pvt) {
unsigned int cap = iax_session_get_capability(iaxevent->session);
unsigned int format = iaxevent->ies.format;
break;
case IAX_EVENT_ANSWER:
// the other side answered our call
- if ((tech_pvt = iax_get_private(iaxevent->session))) {
+ if (tech_pvt) {
switch_channel *channel;
if ((channel = switch_core_session_get_channel(tech_pvt->session))) {
switch_console_printf(SWITCH_CHANNEL_CONSOLE, "Answer %s\n", switch_channel_get_name(channel));
break;
case IAX_EVENT_BUSY:
case IAX_EVENT_HANGUP:
- if ((tech_pvt = iax_get_private(iaxevent->session))) {
+ if (tech_pvt) {
switch_channel *channel;
switch_clear_flag(tech_pvt, TFLAG_IO);
switch_console_printf(SWITCH_CHANNEL_CONSOLE, "sending silence\n");
break;
case IAX_EVENT_VOICE:
- if ((tech_pvt = iax_get_private(iaxevent->session)) &&
- (tech_pvt->read_frame.datalen = iaxevent->datalen)) {
+ if (tech_pvt && (tech_pvt->read_frame.datalen = iaxevent->datalen)) {
memcpy(tech_pvt->read_frame.data, iaxevent->data, iaxevent->datalen);
switch_console_printf(SWITCH_CHANNEL_CONSOLE, "Rejected call.\n");
break;
case IAX_EVENT_DTMF:
- if ((tech_pvt = iax_get_private(iaxevent->session))) {
+ if (tech_pvt) {
switch_channel *channel;
if ((channel = switch_core_session_get_channel(tech_pvt->session))) {
char str[2] = {iaxevent->subclass};
running = -1;
+ iax_shutdown();
+
while (running) {
if (x++ > 1000) {
break;
}
*/
-SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_module_interface **interface) {
+SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_module_interface **interface, char *filename) {
switch_config cfg;
char *var, *val;
/*.application_interface*/ &playback_application_interface
};
-SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_module_interface **interface) {
+SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_module_interface **interface, char *filename) {
/* connect my internal structure to the blank pointer passed to me */
*interface = &mod_playback_module_interface;
};
-SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_module_interface **interface) {
+SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_module_interface **interface, char *filename) {
/* connect my internal structure to the blank pointer passed to me */
*interface = &raw_module_interface;
/*.application_interface*/ NULL
};
-switch_status switch_module_load(switch_loadable_module_interface **interface) {
+switch_status switch_module_load(switch_loadable_module_interface **interface, char *filename) {
/* connect my internal structure to the blank pointer passed to me */
*interface = &skel_module_interface;
/*.switch_application_interface*/ NULL
};
-SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_module_interface **interface) {
+SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_module_interface **interface, char *filename) {
/* connect my internal structure to the blank pointer passed to me */
*interface = &mod_timers_module_interface;
/*.application_interface*/ NULL
};
-switch_status switch_module_load(switch_loadable_module_interface **interface) {
+switch_status switch_module_load(switch_loadable_module_interface **interface, char *filename) {
/* connect my internal structure to the blank pointer passed to me */
*interface = &speex_module_interface;
/*.application_interface*/ NULL
};
-Public switch_status switch_module_load(const switch_loadable_module_interface **interface) {
+Public switch_status switch_module_load(const switch_loadable_module_interface **interface, chanr *filename) {
if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
return SWITCH_STATUS_SUCCESS;
}
-SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_module_interface **interface) {
+SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_module_interface **interface, char *filename) {
switch_config cfg;
char *var, *val;
char *filename;
const switch_loadable_module_interface *interface;
void *lib;
- switch_status (*switch_module_load) (switch_loadable_module_interface **);
+ switch_status (*switch_module_load) (switch_loadable_module_interface **, char *);
switch_status (*switch_module_reload) (void);
switch_status (*switch_module_pause) (void);
switch_status (*switch_module_resume) (void);
apr_dso_handle_t *dso = NULL;
apr_status_t status;
apr_dso_handle_sym_t function_handle = NULL;
- switch_status (*load_func_ptr) (switch_loadable_module_interface **) = NULL;
+ switch_status (*load_func_ptr) (switch_loadable_module_interface **, char *) = NULL;
int loading = 1;
const char *err = NULL;
switch_loadable_module_interface *interface = NULL;
break;
}
- if (load_func_ptr(&interface) != SWITCH_STATUS_SUCCESS) {
+ if (load_func_ptr(&interface, filename) != SWITCH_STATUS_SUCCESS) {
err = "Module load routine returned an error";
interface = NULL;
break;
(void *) ptr);
}
}
-
+
if (new_module->interface->codec_interface) {
const switch_codec_implementation *impl;
const switch_codec_interface *ptr;