[Freeswitch-svn] [commit] r11042 - freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax
FreeSWITCH SVN
gmaruzz at freeswitch.org
Thu Jan 1 05:15:13 PST 2009
Author: gmaruzz
Date: Thu Jan 1 08:15:13 2009
New Revision: 11042
Log:
skypiax: all remaining switch_log_printf are now converted to skypiax equivalent funcs
Modified:
freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/mod_skypiax.c
freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c
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 Thu Jan 1 08:15:13 2009
@@ -63,11 +63,12 @@
static switch_status_t skypiax_codec(private_t * tech_pvt, int sample_rate, int codec_ms)
{
+ skypiax_interface_t *p = NULL;
if (switch_core_codec_init
(&tech_pvt->read_codec, "L16", NULL, sample_rate, codec_ms, 1,
SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL,
NULL) != SWITCH_STATUS_SUCCESS) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n");
+ ERRORA( "Can't load codec?\n", SKYPIAX_P_LOG);
return SWITCH_STATUS_FALSE;
}
@@ -75,7 +76,7 @@
(&tech_pvt->write_codec, "L16", NULL, sample_rate, codec_ms, 1,
SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL,
NULL) != SWITCH_STATUS_SUCCESS) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n");
+ ERRORA( "Can't load codec?\n", SKYPIAX_P_LOG);
switch_core_codec_destroy(&tech_pvt->read_codec);
return SWITCH_STATUS_FALSE;
}
@@ -109,9 +110,9 @@
}
if (skypiax_codec(tech_pvt, SAMPLERATE_SKYPIAX, 20) != SWITCH_STATUS_SUCCESS) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "skypiax_docec FAILED\n");
+ ERRORA( "skypiax_docec FAILED\n", SKYPIAX_P_LOG);
} else {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "skypiax_codec SUCCESS\n");
+ DEBUGA_SKYPE( "skypiax_codec SUCCESS\n", SKYPIAX_P_LOG);
}
DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG);
@@ -126,6 +127,7 @@
{
switch_channel_t *channel;
private_t *tech_pvt = NULL;
+ skypiax_interface_t *p = NULL;
tech_pvt = switch_core_session_get_private(session);
assert(tech_pvt != NULL);
@@ -143,7 +145,7 @@
globals.calls++;
switch_mutex_unlock(globals.mutex);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL INIT\n",
+ DEBUGA_SKYPE( "%s CHANNEL INIT\n", SKYPIAX_P_LOG,
switch_channel_get_name(channel));
return SWITCH_STATUS_SUCCESS;
}
@@ -152,7 +154,7 @@
{
switch_channel_t *channel = NULL;
private_t *tech_pvt = NULL;
- skypiax_interface_t *p;
+ skypiax_interface_t *p = NULL;
char msg_to_skype[256];
channel = switch_core_session_get_channel(session);
@@ -183,7 +185,7 @@
switch_core_codec_destroy(&tech_pvt->write_codec);
}
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL HANGUP\n",
+ DEBUGA_SKYPE( "%s CHANNEL HANGUP\n", SKYPIAX_P_LOG,
switch_channel_get_name(channel));
switch_mutex_lock(globals.mutex);
globals.calls--;
@@ -199,6 +201,7 @@
{
switch_channel_t *channel = NULL;
private_t *tech_pvt = NULL;
+ skypiax_interface_t *p = NULL;
channel = switch_core_session_get_channel(session);
assert(channel != NULL);
@@ -206,7 +209,7 @@
tech_pvt = switch_core_session_get_private(session);
assert(tech_pvt != NULL);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL ROUTING\n",
+ DEBUGA_SKYPE( "%s CHANNEL ROUTING\n", SKYPIAX_P_LOG,
switch_channel_get_name(channel));
return SWITCH_STATUS_SUCCESS;
@@ -217,6 +220,7 @@
switch_channel_t *channel = NULL;
private_t *tech_pvt = NULL;
+ skypiax_interface_t *p = NULL;
channel = switch_core_session_get_channel(session);
assert(channel != NULL);
@@ -224,7 +228,7 @@
tech_pvt = switch_core_session_get_private(session);
assert(tech_pvt != NULL);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s CHANNEL EXECUTE\n",
+ DEBUGA_SKYPE( "%s CHANNEL EXECUTE\n", SKYPIAX_P_LOG,
switch_channel_get_name(channel));
return SWITCH_STATUS_SUCCESS;
@@ -234,6 +238,7 @@
{
switch_channel_t *channel = NULL;
private_t *tech_pvt = NULL;
+ skypiax_interface_t *p = NULL;
channel = switch_core_session_get_channel(session);
assert(channel != NULL);
@@ -243,16 +248,16 @@
switch (sig) {
case SWITCH_SIG_KILL:
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
- "%s CHANNEL got SWITCH_SIG_KILL\n",
+ DEBUGA_SKYPE(
+ "%s CHANNEL got SWITCH_SIG_KILL\n", SKYPIAX_P_LOG,
switch_channel_get_name(channel));
switch_clear_flag_locked(tech_pvt, TFLAG_IO);
switch_clear_flag_locked(tech_pvt, TFLAG_VOICE);
switch_set_flag_locked(tech_pvt, TFLAG_HANGUP);
break;
case SWITCH_SIG_BREAK:
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
- "%s CHANNEL got SWITCH_SIG_BREAK\n",
+ DEBUGA_SKYPE(
+ "%s CHANNEL got SWITCH_SIG_BREAK\n", SKYPIAX_P_LOG,
switch_channel_get_name(channel));
switch_set_flag_locked(tech_pvt, TFLAG_BREAK);
break;
@@ -265,13 +270,15 @@
static switch_status_t channel_on_exchange_media(switch_core_session_t * session)
{
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL LOOPBACK\n");
+ skypiax_interface_t *p = NULL;
+ DEBUGA_SKYPE( "CHANNEL LOOPBACK\n", SKYPIAX_P_LOG);
return SWITCH_STATUS_SUCCESS;
}
static switch_status_t channel_on_soft_execute(switch_core_session_t * session)
{
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL TRANSMIT\n");
+ skypiax_interface_t *p = NULL;
+ DEBUGA_SKYPE( "CHANNEL TRANSMIT\n", SKYPIAX_P_LOG);
return SWITCH_STATUS_SUCCESS;
}
@@ -291,6 +298,7 @@
switch_channel_t *channel = NULL;
private_t *tech_pvt = NULL;
switch_byte_t *data;
+ skypiax_interface_t *p = NULL;
channel = switch_core_session_get_channel(session);
assert(channel != NULL);
@@ -302,35 +310,35 @@
if (skypiax_skypeaudio_read(tech_pvt) != SWITCH_STATUS_SUCCESS) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
- "skypiax_skypeaudio_read ERROR\n");
+ ERRORA(
+ "skypiax_skypeaudio_read ERROR\n", SKYPIAX_P_LOG);
} else {
switch_set_flag_locked(tech_pvt, TFLAG_VOICE);
- //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "skypiax_skypeaudio_read SUCCESS\n");
+ //ERRORA( "skypiax_skypeaudio_read SUCCESS\n");
}
while (switch_test_flag(tech_pvt, TFLAG_IO)) {
if (switch_test_flag(tech_pvt, TFLAG_BREAK)) {
switch_clear_flag(tech_pvt, TFLAG_BREAK);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
- "CHANNEL READ FRAME goto CNG\n");
+ DEBUGA_SKYPE(
+ "CHANNEL READ FRAME goto CNG\n", SKYPIAX_P_LOG);
goto cng;
}
if (!switch_test_flag(tech_pvt, TFLAG_IO)) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
- "CHANNEL READ FRAME not IO\n");
+ DEBUGA_SKYPE(
+ "CHANNEL READ FRAME not IO\n", SKYPIAX_P_LOG);
return SWITCH_STATUS_FALSE;
}
- //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "============>\n");
+ //DEBUGA_SKYPE( "============>\n");
if (switch_test_flag(tech_pvt, TFLAG_IO) && switch_test_flag(tech_pvt, TFLAG_VOICE)) {
switch_clear_flag_locked(tech_pvt, TFLAG_VOICE);
if (!tech_pvt->read_frame.datalen) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
- "CHANNEL READ CONTINUE\n");
+ DEBUGA_SKYPE(
+ "CHANNEL READ CONTINUE\n", SKYPIAX_P_LOG);
continue;
}
*frame = &tech_pvt->read_frame;
@@ -342,12 +350,12 @@
return SWITCH_STATUS_SUCCESS;
}
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL READ no TFLAG_IO\n");
+ DEBUGA_SKYPE( "CHANNEL READ no TFLAG_IO\n", SKYPIAX_P_LOG);
return SWITCH_STATUS_FALSE;
}
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL READ FALSE\n");
+ DEBUGA_SKYPE( "CHANNEL READ FALSE\n", SKYPIAX_P_LOG);
return SWITCH_STATUS_FALSE;
cng:
@@ -370,7 +378,7 @@
unsigned int sent;
struct skypiax_interface *p = NULL;
- //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "CHANNEL WRITE FRAME\n");
+ //DEBUGA_SKYPE( "CHANNEL WRITE FRAME\n");
channel = switch_core_session_get_channel(session);
assert(channel != NULL);
@@ -465,13 +473,14 @@
{
struct private_object *tech_pvt = switch_core_session_get_private(session);
char *body = switch_event_get_body(event);
+ skypiax_interface_t *p = NULL;
switch_assert(tech_pvt != NULL);
if (!body) {
body = "";
}
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "event: |||%s|||\n", body);
+ WARNINGA( "event: |||%s|||\n", SKYPIAX_P_LOG, body);
return SWITCH_STATUS_SUCCESS;
}
@@ -507,6 +516,7 @@
private_t *tech_pvt;
switch_channel_t *channel;
switch_caller_profile_t *caller_profile;
+ skypiax_interface_t *p = NULL;
switch_core_session_add_stream(*new_session, NULL);
if ((tech_pvt =
@@ -516,8 +526,8 @@
channel = switch_core_session_get_channel(*new_session);
skypiax_tech_init(tech_pvt, *new_session, NULL);
} else {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT,
- "Hey where is my memory pool?\n");
+ ERRORA(
+ "Hey where is my memory pool?\n", SKYPIAX_P_LOG);
switch_core_session_destroy(new_session);
return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
}
@@ -532,7 +542,7 @@
switch_channel_set_caller_profile(channel, caller_profile);
tech_pvt->caller_profile = caller_profile;
} else {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Doh! no caller profile\n");
+ ERRORA( "Doh! no caller profile\n", SKYPIAX_P_LOG);
switch_core_session_destroy(new_session);
return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
}
@@ -632,44 +642,44 @@
char *val = (char *) switch_xml_attr_soft(param, "value");
if (!strcasecmp(var, "debug")) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "globals.debug=%d\n",
+ DEBUGA_SKYPE( "globals.debug=%d\n", SKYPIAX_P_LOG,
globals.debug);
globals.debug = atoi(val);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "globals.debug=%d\n",
+ DEBUGA_SKYPE( "globals.debug=%d\n", SKYPIAX_P_LOG,
globals.debug);
} else if (!strcasecmp(var, "hold-music")) {
switch_set_string(globals.hold_music, val);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "globals.hold_music=%s\n",
+ DEBUGA_SKYPE( "globals.hold_music=%s\n", SKYPIAX_P_LOG,
globals.hold_music);
} else if (!strcmp(var, "port")) {
globals.port = atoi(val);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "globals.port=%d\n",
+ DEBUGA_SKYPE( "globals.port=%d\n", SKYPIAX_P_LOG,
globals.port);
} else if (!strcmp(var, "ip")) {
set_global_ip(val);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "globals.ip=%s\n",
+ DEBUGA_SKYPE( "globals.ip=%s\n", SKYPIAX_P_LOG,
globals.ip);
} else if (!strcmp(var, "codec-master")) {
if (!strcasecmp(val, "us")) {
switch_set_flag(&globals, GFLAG_MY_CODEC_PREFS);
}
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
- "codec-master globals.debug=%d\n", globals.debug);
+ DEBUGA_SKYPE(
+ "codec-master globals.debug=%d\n", SKYPIAX_P_LOG, globals.debug);
} else if (!strcmp(var, "dialplan")) {
set_global_dialplan(val);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "globals.dialplan=%s\n",
+ DEBUGA_SKYPE( "globals.dialplan=%s\n", SKYPIAX_P_LOG,
globals.dialplan);
} else if (!strcmp(var, "codec-prefs")) {
set_global_codec_string(val);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
- "globals.codec_string=%s\n", globals.codec_string);
+ DEBUGA_SKYPE(
+ "globals.codec_string=%s\n", SKYPIAX_P_LOG, globals.codec_string);
globals.codec_order_last =
switch_separate_string(globals.codec_string, ',', globals.codec_order,
SWITCH_MAX_CODECS);
} else if (!strcmp(var, "codec-rates")) {
set_global_codec_rates_string(val);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
- "globals.codec_rates_string=%s\n", globals.codec_rates_string);
+ DEBUGA_SKYPE(
+ "globals.codec_rates_string=%s\n", SKYPIAX_P_LOG, globals.codec_rates_string);
globals.codec_rates_last =
switch_separate_string(globals.codec_rates_string, ',', globals.codec_rates,
SWITCH_MAX_CODECS);
@@ -741,50 +751,50 @@
}
if (!skype_user) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
- "interface missing REQUIRED param 'skype_user'\n");
+ ERRORA(
+ "interface missing REQUIRED param 'skype_user'\n", SKYPIAX_P_LOG);
continue;
}
if (!skype_password) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
- "interface missing REQUIRED param 'skype_password'\n");
+ ERRORA(
+ "interface missing REQUIRED param 'skype_password'\n", SKYPIAX_P_LOG);
continue;
}
if (!X11_display) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
- "interface missing REQUIRED param 'X11_display'\n");
+ ERRORA(
+ "interface missing REQUIRED param 'X11_display'\n", SKYPIAX_P_LOG);
continue;
}
if (!tcp_cli_port) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
- "interface missing REQUIRED param 'tcp_cli_port'\n");
+ ERRORA(
+ "interface missing REQUIRED param 'tcp_cli_port'\n", SKYPIAX_P_LOG);
continue;
}
if (!tcp_srv_port) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
- "interface missing REQUIRED param 'tcp_srv_port'\n");
+ ERRORA(
+ "interface missing REQUIRED param 'tcp_srv_port'\n", SKYPIAX_P_LOG);
continue;
}
if (!id) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
- "interface missing REQUIRED param 'id'\n");
+ ERRORA(
+ "interface missing REQUIRED param 'id'\n", SKYPIAX_P_LOG);
continue;
}
if (switch_is_number(id)) {
interface_id = atoi(id);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "interface_id=%d\n",
+ DEBUGA_SKYPE( "interface_id=%d\n", SKYPIAX_P_LOG,
interface_id);
} else {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
- "interface param 'id' MUST be a number, now id='%s'\n", id);
+ ERRORA(
+ "interface param 'id' MUST be a number, now id='%s'\n", SKYPIAX_P_LOG, id);
continue;
}
if (!name) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
- "interface missing param 'name', not nice, but works\n");
+ WARNINGA(
+ "interface missing param 'name', not nice, but works\n", SKYPIAX_P_LOG);
}
if (!tonegroup) {
@@ -800,7 +810,7 @@
}
if (name) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "name=%s\n", name);
+ DEBUGA_SKYPE( "name=%s\n", SKYPIAX_P_LOG, name);
}
#ifndef WIN32
if (!XInitThreads()) {
@@ -818,8 +828,8 @@
memset(&newconf, '\0', sizeof(newconf));
globals.SKYPIAX_INTERFACES[interface_id] = newconf;
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
- "CONFIGURING interface_id=%d\n", interface_id);
+ DEBUGA_SKYPE(
+ "CONFIGURING interface_id=%d\n", SKYPIAX_P_LOG, interface_id);
switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].interface_id, id);
if (name) {
switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].name, name);
@@ -846,38 +856,38 @@
switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].context, context);
switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].dialplan, dialplan);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
- "interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].X11_display=%s\n",
+ DEBUGA_SKYPE(
+ "interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].X11_display=%s\n", SKYPIAX_P_LOG,
interface_id,
globals.SKYPIAX_INTERFACES[interface_id].X11_display);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
- "interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].skype_user=%s\n",
+ DEBUGA_SKYPE(
+ "interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].skype_user=%s\n", SKYPIAX_P_LOG,
interface_id,
globals.SKYPIAX_INTERFACES[interface_id].skype_user);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
- "interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].skype_password=%s\n",
+ DEBUGA_SKYPE(
+ "interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].skype_password=%s\n", SKYPIAX_P_LOG,
interface_id,
globals.SKYPIAX_INTERFACES[interface_id].skype_password);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
- "interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].tcp_cli_port=%d\n",
+ DEBUGA_SKYPE(
+ "interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].tcp_cli_port=%d\n", SKYPIAX_P_LOG,
interface_id,
globals.SKYPIAX_INTERFACES[interface_id].tcp_cli_port);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
- "interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].tcp_srv_port=%d\n",
+ DEBUGA_SKYPE(
+ "interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].tcp_srv_port=%d\n", SKYPIAX_P_LOG,
interface_id,
globals.SKYPIAX_INTERFACES[interface_id].tcp_srv_port);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
- "interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].name=%s\n",
+ DEBUGA_SKYPE(
+ "interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].name=%s\n", SKYPIAX_P_LOG,
interface_id, globals.SKYPIAX_INTERFACES[interface_id].name);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
- "interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].context=%s\n",
+ DEBUGA_SKYPE(
+ "interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].context=%s\n", SKYPIAX_P_LOG,
interface_id, globals.SKYPIAX_INTERFACES[interface_id].context);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
- "interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].dialplan=%s\n",
+ DEBUGA_SKYPE(
+ "interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].dialplan=%s\n", SKYPIAX_P_LOG,
interface_id,
globals.SKYPIAX_INTERFACES[interface_id].dialplan);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO,
- "STARTING interface_id=%d\n", interface_id);
+ NOTICA(
+ "STARTING interface_id=%d\n", SKYPIAX_P_LOG, interface_id);
switch_threadattr_create(&do_skype_thd_attr, skypiax_module_pool);
//switch_threadattr_detach_set(do_skype_thd_attr, 1);
@@ -905,12 +915,12 @@
skypiax_skypeaudio_init(&globals.SKYPIAX_INTERFACES[interface_id]);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE,
- "STARTED interface_id=%d\n", interface_id);
+ NOTICA(
+ "STARTED interface_id=%d\n", SKYPIAX_P_LOG, interface_id);
} else {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
- "interface id %d is higher than SKYPIAX_MAX_INTERFACES (%d)\n",
+ ERRORA(
+ "interface id %d is higher than SKYPIAX_MAX_INTERFACES (%d)\n", SKYPIAX_P_LOG,
interface_id, SKYPIAX_MAX_INTERFACES);
continue;
}
@@ -919,20 +929,20 @@
for (i = 0; i < SKYPIAX_MAX_INTERFACES; i++) {
if (strlen(globals.SKYPIAX_INTERFACES[i].name)) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
- "i=%d globals.SKYPIAX_INTERFACES[%d].interface_id=%s\n", i, i,
+ DEBUGA_SKYPE(
+ "i=%d globals.SKYPIAX_INTERFACES[%d].interface_id=%s\n", SKYPIAX_P_LOG, i, i,
globals.SKYPIAX_INTERFACES[i].interface_id);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
- "i=%d globals.SKYPIAX_INTERFACES[%d].X11_display=%s\n", i, i,
+ DEBUGA_SKYPE(
+ "i=%d globals.SKYPIAX_INTERFACES[%d].X11_display=%s\n", SKYPIAX_P_LOG, i, i,
globals.SKYPIAX_INTERFACES[i].X11_display);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
- "i=%d globals.SKYPIAX_INTERFACES[%d].name=%s\n", i, i,
+ DEBUGA_SKYPE(
+ "i=%d globals.SKYPIAX_INTERFACES[%d].name=%s\n", SKYPIAX_P_LOG, i, i,
globals.SKYPIAX_INTERFACES[i].name);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
- "i=%d globals.SKYPIAX_INTERFACES[%d].context=%s\n", i, i,
+ DEBUGA_SKYPE(
+ "i=%d globals.SKYPIAX_INTERFACES[%d].context=%s\n", SKYPIAX_P_LOG, i, i,
globals.SKYPIAX_INTERFACES[i].context);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
- "i=%d globals.SKYPIAX_INTERFACES[%d].dialplan=%s\n", i, i,
+ DEBUGA_SKYPE(
+ "i=%d globals.SKYPIAX_INTERFACES[%d].dialplan=%s\n", SKYPIAX_P_LOG, i, i,
globals.SKYPIAX_INTERFACES[i].dialplan);
}
}
Modified: freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c
==============================================================================
--- freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c (original)
+++ freeswitch/branches/gmaruzz/src/mod/endpoints/mod_skypiax/skypiax_protocol.c Thu Jan 1 08:15:13 2009
@@ -1024,12 +1024,12 @@
//disp = XOpenDisplay(getenv("DISPLAY"));
disp = XOpenDisplay(p->X11_display);
if (!disp) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
- "Cannot open X Display '%s', exiting skype thread\n",
+ ERRORA(
+ "Cannot open X Display '%s', exiting skype thread\n", SKYPIAX_P_LOG,
p->X11_display);
return NULL;
} else {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "X Display '%s' opened\n",
+ DEBUGA_SKYPE( "X Display '%s' opened\n", SKYPIAX_P_LOG,
p->X11_display);
}
@@ -1401,7 +1401,7 @@
if (channel) {
switch_dtmf_t dtmf =
{ (char) value[0], switch_core_default_dtmf_duration(0) };
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%c DTMF %s\n",
+ NOTICA("%c DTMF %s\n", SKYPIAX_P_LOG,
dtmf.digit, switch_channel_get_name(channel));
switch_mutex_lock(tech_pvt->flag_mutex);
switch_channel_queue_dtmf(channel, &dtmf);
@@ -1615,8 +1615,8 @@
private_t *tech_pvt = NULL;
switch_channel_t *channel = NULL;
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE,
- "New Inbound Channel!\n");
+ NOTICA(
+ "New Inbound Channel!\n", SKYPIAX_P_LOG);
if ((session =
switch_core_session_request(skypiax_endpoint_interface,
@@ -1629,8 +1629,8 @@
channel = switch_core_session_get_channel(session);
skypiax_tech_init(tech_pvt, session, p);
} else {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT,
- "Hey where is my memory pool?\n");
+ ERRORA(
+ "Hey where is my memory pool?\n", SKYPIAX_P_LOG);
switch_core_session_destroy(&session);
break;
}
@@ -1654,8 +1654,8 @@
switch_channel_set_state(channel, CS_INIT);
if (switch_core_session_thread_launch(session) !=
SWITCH_STATUS_SUCCESS) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT,
- "Error spawning thread\n");
+ ERRORA(
+ "Error spawning thread\n", SKYPIAX_P_LOG);
switch_core_session_destroy(&session);
}
}
More information about the Freeswitch-svn
mailing list