[Freeswitch-branches] [commit] r10246 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax
Freeswitch SVN
gmaruzz at freeswitch.org
Wed Nov 5 07:00:59 EST 2008
Author: gmaruzz
Date: Wed Nov 5 07:00:58 2008
New Revision: 10246
Modified:
freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/Makefile
freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c
Log:
skypiax: compile, do not execute (it's not linked to libs)
Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/Makefile
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/Makefile (original)
+++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/Makefile Wed Nov 5 07:00:58 2008
@@ -1,2 +1,4 @@
MODNAME=mod_skypiax
+#LOCAL_CFLAGS=-I$(OZ_DIR)/src/include -I$(OZ_DIR)/src/isdn/include
+MOD_CFLAGS=-I../../../../libs/openzap/src/include -I../../../../libs/openzap/src/isdn/include
include ../../../../build/modmake.rules
Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c (original)
+++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c Wed Nov 5 07:00:58 2008
@@ -26,7 +26,7 @@
* Anthony Minessale II <anthmct at yahoo.com>
*
*
- * mod_openzap.c -- OPENZAP Endpoint Module
+ * mod_skypiax.c -- OPENZAP Endpoint Module
*
*/
#include <switch.h>
@@ -36,14 +36,14 @@
#define __FUNCTION__ __SWITCH_FUNC__
#endif
-#define OPENZAP_VAR_PREFIX "openzap_"
+#define OPENZAP_VAR_PREFIX "skypiax_"
#define OPENZAP_VAR_PREFIX_LEN 8
-SWITCH_MODULE_LOAD_FUNCTION(mod_openzap_load);
-SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_openzap_shutdown);
-SWITCH_MODULE_DEFINITION(mod_openzap, mod_openzap_load, mod_openzap_shutdown, NULL);
+SWITCH_MODULE_LOAD_FUNCTION(mod_skypiax_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skypiax_shutdown);
+SWITCH_MODULE_DEFINITION(mod_skypiax, mod_skypiax_load, mod_skypiax_shutdown, NULL);
-switch_endpoint_interface_t *openzap_endpoint_interface;
+switch_endpoint_interface_t *skypiax_endpoint_interface;
static switch_memory_pool_t *module_pool = NULL;
@@ -861,7 +861,7 @@
}
-switch_state_handler_table_t openzap_state_handlers = {
+switch_state_handler_table_t skypiax_state_handlers = {
/*.on_init */ channel_on_init,
/*.on_routing */ channel_on_routing,
/*.on_execute */ channel_on_execute,
@@ -870,7 +870,7 @@
/*.on_soft_execute */ channel_on_soft_execute
};
-switch_io_routines_t openzap_io_routines = {
+switch_io_routines_t skypiax_io_routines = {
/*.outgoing_channel */ channel_outgoing_channel,
/*.read_frame */ channel_read_frame,
/*.write_frame */ channel_write_frame,
@@ -997,7 +997,7 @@
}
}
- if ((*new_session = switch_core_session_request(openzap_endpoint_interface, pool)) != 0) {
+ if ((*new_session = switch_core_session_request(skypiax_endpoint_interface, pool)) != 0) {
private_t *tech_pvt;
switch_channel_t *channel;
switch_caller_profile_t *caller_profile;
@@ -1013,7 +1013,7 @@
goto fail;
}
- snprintf(name, sizeof(name), "OpenZAP/%u:%u/%s", zchan->span_id, zchan->chan_id, dest);
+ snprintf(name, sizeof(name), "Skypiax/%u:%u/%s", zchan->span_id, zchan->chan_id, dest);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Connect outbound channel %s\n", name);
switch_channel_set_name(channel, name);
zchan->caller_data = caller_data;
@@ -1068,7 +1068,7 @@
*sp = NULL;
- if (!(session = switch_core_session_request(openzap_endpoint_interface, NULL))) {
+ if (!(session = switch_core_session_request(skypiax_endpoint_interface, NULL))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Initilization Error!\n");
return ZAP_FAIL;
}
@@ -1099,7 +1099,7 @@
}
tech_pvt->caller_profile = switch_caller_profile_new(switch_core_session_get_pool(session),
- "OpenZAP",
+ "Skypiax",
SPAN_CONFIG[sigmsg->channel->span_id].dialplan,
sigmsg->channel->caller_data.cid_name,
sigmsg->channel->caller_data.cid_num.digits,
@@ -1121,7 +1121,7 @@
switch_set_flag(tech_pvt->caller_profile, SWITCH_CPF_HIDE_NAME | SWITCH_CPF_HIDE_NUMBER);
}
- snprintf(name, sizeof(name), "OpenZAP/%u:%u/%s", sigmsg->channel->span_id, sigmsg->channel->chan_id, tech_pvt->caller_profile->destination_number);
+ snprintf(name, sizeof(name), "Skypiax/%u:%u/%s", sigmsg->channel->span_id, sigmsg->channel->chan_id, tech_pvt->caller_profile->destination_number);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Connect inbound channel %s\n", name);
switch_channel_set_name(channel, name);
switch_channel_set_caller_profile(channel, tech_pvt->caller_profile);
@@ -1542,7 +1542,7 @@
static switch_status_t load_config(void)
{
- char *cf = "openzap.conf";
+ char *cf = "skypiax.conf";
switch_xml_t cfg, xml, settings, param, spans, myspan;
memset(&globals, 0, sizeof(globals));
@@ -1649,7 +1649,7 @@
}
if (zstatus != ZAP_SUCCESS) {
- zap_log(ZAP_LOG_ERROR, "Error finding OpenZAP span id:%s name:%s\n", switch_str_nil(id), switch_str_nil(name));
+ zap_log(ZAP_LOG_ERROR, "Error finding Skypiax span id:%s name:%s\n", switch_str_nil(id), switch_str_nil(name));
continue;
}
@@ -1664,7 +1664,7 @@
"hotline", hotline,
"enable_callerid", enable_callerid,
TAG_END) != ZAP_SUCCESS) {
- zap_log(ZAP_LOG_ERROR, "Error starting OpenZAP span %d\n", span_id);
+ zap_log(ZAP_LOG_ERROR, "Error starting Skypiax span %d\n", span_id);
continue;
}
@@ -1764,7 +1764,7 @@
}
if (zstatus != ZAP_SUCCESS) {
- zap_log(ZAP_LOG_ERROR, "Error finding OpenZAP span id:%s name:%s\n", switch_str_nil(id), switch_str_nil(name));
+ zap_log(ZAP_LOG_ERROR, "Error finding Skypiax span id:%s name:%s\n", switch_str_nil(id), switch_str_nil(name));
continue;
}
@@ -1778,7 +1778,7 @@
"digit_timeout", &to,
"max_dialstr", &max,
TAG_END) != ZAP_SUCCESS) {
- zap_log(ZAP_LOG_ERROR, "Error starting OpenZAP span %d\n", span_id);
+ zap_log(ZAP_LOG_ERROR, "Error starting Skypiax span %d\n", span_id);
continue;
}
@@ -1875,7 +1875,7 @@
}
if (zstatus != ZAP_SUCCESS) {
- zap_log(ZAP_LOG_ERROR, "Error finding OpenZAP span id:%s name:%s\n", switch_str_nil(id), switch_str_nil(name));
+ zap_log(ZAP_LOG_ERROR, "Error finding Skypiax span id:%s name:%s\n", switch_str_nil(id), switch_str_nil(name));
continue;
}
@@ -1895,7 +1895,7 @@
"q921loglevel", q921loglevel,
"q931loglevel", q931loglevel,
TAG_END) != ZAP_SUCCESS) {
- zap_log(ZAP_LOG_ERROR, "Error starting OpenZAP span %d mode: %d dialect: %d error: %s\n", span_id, mode, dialect, span->last_error);
+ zap_log(ZAP_LOG_ERROR, "Error starting Skypiax span %d mode: %d dialect: %d error: %s\n", span_id, mode, dialect, span->last_error);
continue;
}
@@ -1967,7 +1967,7 @@
}
if (zstatus != ZAP_SUCCESS) {
- zap_log(ZAP_LOG_ERROR, "Error finding OpenZAP span id:%s name:%s\n", switch_str_nil(id), switch_str_nil(name));
+ zap_log(ZAP_LOG_ERROR, "Error finding Skypiax span id:%s name:%s\n", switch_str_nil(id), switch_str_nil(name));
continue;
}
@@ -1981,7 +1981,7 @@
"remote_ip", remote_ip,
"remote_port", &remote_port,
TAG_END) != ZAP_SUCCESS) {
- zap_log(ZAP_LOG_ERROR, "Error starting OpenZAP span %d error: %s\n", span_id, span->last_error);
+ zap_log(ZAP_LOG_ERROR, "Error starting Skypiax span %d error: %s\n", span_id, span->last_error);
continue;
}
@@ -2039,7 +2039,7 @@
}
#define OZ_SYNTAX "list || dump <span_id> [<chan_id>]"
-SWITCH_STANDARD_API(oz_function)
+SWITCH_STANDARD_API(sk_function)
{
char *mycmd = NULL, *argv[10] = { 0 };
int argc = 0;
@@ -2055,7 +2055,7 @@
if (!strcasecmp(argv[0], "dump")) {
if (argc < 2) {
- stream->write_function(stream, "-ERR Usage: oz dump <span_id> [<chan_id>]\n");
+ stream->write_function(stream, "-ERR Usage: sk dump <span_id> [<chan_id>]\n");
goto end;
} else {
int32_t span_id, chan_id = 0;
@@ -2120,7 +2120,7 @@
}
}
} else {
- stream->write_function(stream, "-ERR Usage: oz list || dump <span_id> [<chan_id>]\n");
+ stream->write_function(stream, "-ERR Usage: sk list || dump <span_id> [<chan_id>]\n");
}
end:
@@ -2136,8 +2136,8 @@
private_t *tech_pvt;
int x = 0;
- if (!switch_core_session_check_interface(session, openzap_endpoint_interface)) {
- zap_log(ZAP_LOG_ERROR, "This application is only for OpenZAP channels.\n");
+ if (!switch_core_session_check_interface(session, skypiax_endpoint_interface)) {
+ zap_log(ZAP_LOG_ERROR, "This application is only for Skypiax channels.\n");
return;
}
@@ -2148,7 +2148,7 @@
}
-SWITCH_MODULE_LOAD_FUNCTION(mod_openzap_load)
+SWITCH_MODULE_LOAD_FUNCTION(mod_skypiax_load)
{
switch_api_interface_t *commands_api_interface;
@@ -2159,7 +2159,7 @@
zap_global_set_logger(zap_logger);
if (zap_global_init() != ZAP_SUCCESS) {
- zap_log(ZAP_LOG_ERROR, "Error loading OpenZAP\n");
+ zap_log(ZAP_LOG_ERROR, "Error loading Skypiax\n");
return SWITCH_STATUS_TERM;
}
@@ -2169,12 +2169,12 @@
}
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
- openzap_endpoint_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_ENDPOINT_INTERFACE);
- openzap_endpoint_interface->interface_name = "openzap";
- openzap_endpoint_interface->io_routines = &openzap_io_routines;
- openzap_endpoint_interface->state_handler = &openzap_state_handlers;
+ skypiax_endpoint_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_ENDPOINT_INTERFACE);
+ skypiax_endpoint_interface->interface_name = "skypiax";
+ skypiax_endpoint_interface->io_routines = &skypiax_io_routines;
+ skypiax_endpoint_interface->state_handler = &skypiax_state_handlers;
- SWITCH_ADD_API(commands_api_interface, "oz", "OpenZAP commands", oz_function, OZ_SYNTAX);
+ SWITCH_ADD_API(commands_api_interface, "sk", "Skypiax commands", sk_function, OZ_SYNTAX);
SWITCH_ADD_APP(app_interface, "disable_ec", "Disable Echo Canceller", "Disable Echo Canceller", disable_ec_function, "", SAF_NONE);
@@ -2182,7 +2182,7 @@
return SWITCH_STATUS_SUCCESS;
}
-SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_openzap_shutdown)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skypiax_shutdown)
{
zap_global_destroy();
return SWITCH_STATUS_NOUNLOAD;
More information about the Freeswitch-branches
mailing list