Set log levels on many existing log messages. A huge thanks to James Martelletti for going through all the log calls to do this.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1173 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris committed 2006-04-16 06:05:53 +00:00
1 parent fd7bf0eaaa
commit 026e8d39ca
34 files changed
+387 -387

No files matched your search

@@ -181,12 +181,12 @@ static void get_codecs(struct private_object *tech_pvt)
SWITCH_MAX_CODECS,
globals.codec_order,
globals.codec_order_last)) <= 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "NO codecs?\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "NO codecs?\n");
return;
}
} else if (((tech_pvt->num_codecs =
switch_loadable_module_get_codecs(switch_core_session_get_pool(tech_pvt->session), tech_pvt->codecs, SWITCH_MAX_CODECS))) <= 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "NO codecs?\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "NO codecs?\n");
return;
}
}
@@ -314,7 +314,7 @@ static int do_candidates(struct private_object *tech_pvt, int force)
cand[0].port = tech_pvt->stun_port;
} else {
if (!stun_ip) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Stun Failed! NO STUN SERVER!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Stun Failed! NO STUN SERVER!\n");
switch_channel_hangup(channel);
return -1;
}
@@ -327,11 +327,11 @@ static int do_candidates(struct private_object *tech_pvt, int force)
SWITCH_STUN_DEFAULT_PORT,
&err,
switch_core_session_get_pool(tech_pvt->session)) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Stun Failed! %s:%d [%s]\n", stun_ip, SWITCH_STUN_DEFAULT_PORT, err);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Stun Failed! %s:%d [%s]\n", stun_ip, SWITCH_STUN_DEFAULT_PORT, err);
switch_channel_hangup(channel);
return -1;
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Stun Success %s:%d\n", cand[0].address, cand[0].port);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Stun Success %s:%d\n", cand[0].address, cand[0].port);
}
cand[0].type = "stun";
tech_pvt->stun_ip = switch_core_session_strdup(tech_pvt->session, cand[0].address);
@@ -983,7 +983,7 @@ static switch_status channel_outgoing_channel(switch_core_session *session, swit
tech_pvt->codec_index = -1;
tech_pvt->local_port = switch_rtp_request_port();
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Hey where is my memory pool?\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Hey where is my memory pool?\n");
switch_core_session_destroy(new_session);
return SWITCH_STATUS_GENERR;
}
@@ -1195,7 +1195,7 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
assert(handle != NULL);
if (!(profile = ldl_handle_get_private(handle))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "ERROR NO PROFILE!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ERROR NO PROFILE!\n");
return LDL_STATUS_FALSE;
}
@@ -1263,11 +1263,11 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi
switch(signal) {
case LDL_SIGNAL_NONE:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "ERROR\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "ERROR\n");
break;
case LDL_SIGNAL_MSG:
if (msg) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "MSG [%s]\n", msg);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "MSG [%s]\n", msg);
if (*msg == '+') {
switch_channel_queue_dtmf(channel, msg + 1);
}
+41 -41
View File
@@ -263,7 +263,7 @@ static switch_status exosip_on_init(switch_core_session *session)
char *stun_ip = globals.extip + 5;
if (!stun_ip) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Stun Failed! NO STUN SERVER\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Stun Failed! NO STUN SERVER\n");
switch_channel_hangup(channel);
return SWITCH_STATUS_FALSE;
}
@@ -273,11 +273,11 @@ static switch_status exosip_on_init(switch_core_session *session)
SWITCH_STUN_DEFAULT_PORT,
&err,
switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Stun Failed! %s:%d [%s]\n", stun_ip, SWITCH_STUN_DEFAULT_PORT, err);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Stun Failed! %s:%d [%s]\n", stun_ip, SWITCH_STUN_DEFAULT_PORT, err);
switch_channel_hangup(channel);
return SWITCH_STATUS_FALSE;
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Stun Success [%s]:[%d]\n", ip, sdp_port);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Stun Success [%s]:[%d]\n", ip, sdp_port);
} else {
ip = globals.extip;
}
@@ -341,7 +341,7 @@ static switch_status exosip_on_init(switch_core_session *session)
eXosip_lock();
if ((dest_uri =
(char *) switch_core_session_alloc(session, strlen(tech_pvt->caller_profile->destination_number) + 10)) == 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "AIEEEE!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "AIEEEE!\n");
assert(dest_uri != NULL);
}
sprintf(dest_uri, "sip:%s", tech_pvt->caller_profile->destination_number);
@@ -477,7 +477,7 @@ static switch_status activate_rtp(struct private_object *tech_pvt)
bw *= 8;
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Activating RTP %s:%d->%s:%d codec: %u ms: %d\n",
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Activating RTP %s:%d->%s:%d codec: %u ms: %d\n",
tech_pvt->local_sdp_audio_ip,
tech_pvt->local_sdp_audio_port,
tech_pvt->remote_sdp_audio_ip,
@@ -486,13 +486,13 @@ static switch_status activate_rtp(struct private_object *tech_pvt)
if (tech_pvt->realm) {
if (!(key = (char *) switch_core_hash_find(globals.srtp_hash, tech_pvt->realm))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "undefined Realm %s\n", tech_pvt->realm);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "undefined Realm %s\n", tech_pvt->realm);
switch_channel_hangup(channel);
switch_set_flag(tech_pvt, TFLAG_BYE);
switch_clear_flag(tech_pvt, TFLAG_IO);
return SWITCH_STATUS_FALSE;
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "using Realm %s\n", tech_pvt->realm);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "using Realm %s\n", tech_pvt->realm);
}
}
@@ -512,7 +512,7 @@ static switch_status activate_rtp(struct private_object *tech_pvt)
switch_set_flag(tech_pvt, TFLAG_RTP);
} else {
switch_channel *channel = switch_core_session_get_channel(tech_pvt->session);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "RTP REPORTS ERROR: [%s]\n", err);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "RTP REPORTS ERROR: [%s]\n", err);
switch_channel_hangup(channel);
switch_set_flag(tech_pvt, TFLAG_BYE);
switch_clear_flag(tech_pvt, TFLAG_IO);
@@ -884,7 +884,7 @@ static switch_status exosip_receive_message(switch_core_session *session, switch
char *buf = NULL;
osip_message_t *progress = NULL;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Asked to send early media by %s\n", msg->from);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Asked to send early media by %s\n", msg->from);
/* Transmit 183 Progress with SDP */
eXosip_lock();
@@ -963,7 +963,7 @@ static switch_status exosip_outgoing_channel(switch_core_session *session, switc
switch_core_session_set_private(*new_session, tech_pvt);
tech_pvt->session = *new_session;
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Hey where is my memory pool?\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Hey where is my memory pool?\n");
switch_core_session_destroy(new_session);
return SWITCH_STATUS_GENERR;
}
@@ -1029,7 +1029,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_modul
if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "OH OH no pool\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "OH OH no pool\n");
return SWITCH_STATUS_TERM;
}
@@ -1095,7 +1095,7 @@ static switch_status exosip_create_call(eXosip_event_t * event)
switch_core_session_set_private(session, tech_pvt);
tech_pvt->session = session;
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Hey where is my memory pool?\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Hey where is my memory pool?\n");
switch_core_session_destroy(&session);
return SWITCH_STATUS_MEMERR;
}
@@ -1154,7 +1154,7 @@ static switch_status exosip_create_call(eXosip_event_t * event)
if ((remote_sdp = eXosip_get_sdp_info(event->request)) == 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Cannot Find Remote SDP!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot Find Remote SDP!\n");
exosip_on_hangup(session);
switch_core_session_destroy(&session);
return SWITCH_STATUS_GENERR;
@@ -1175,7 +1175,7 @@ static switch_status exosip_create_call(eXosip_event_t * event)
if (!strncasecmp(globals.extip, "stun:", 5)) {
char *stun_ip = globals.extip + 5;
if (!stun_ip) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Stun Failed! NO STUN SERVER\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Stun Failed! NO STUN SERVER\n");
switch_channel_hangup(channel);
return SWITCH_STATUS_FALSE;
}
@@ -1185,11 +1185,11 @@ static switch_status exosip_create_call(eXosip_event_t * event)
SWITCH_STUN_DEFAULT_PORT,
&err,
switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Stun Failed! %s:%d [%s]\n", stun_ip, SWITCH_STUN_DEFAULT_PORT, err);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Stun Failed! %s:%d [%s]\n", stun_ip, SWITCH_STUN_DEFAULT_PORT, err);
switch_channel_hangup(channel);
return SWITCH_STATUS_FALSE;
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Stun Success [%s]:[%d]\n", ip, sdp_port);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Stun Success [%s]:[%d]\n", ip, sdp_port);
} else {
ip = globals.extip;
}
@@ -1236,7 +1236,7 @@ static switch_status exosip_create_call(eXosip_event_t * event)
while (0 == osip_rfc3264_match(tech_pvt->sdp_config, remote_sdp, audio_tab, video_tab, t38_tab, app_tab, mline)) {
if (audio_tab[0] == NULL && video_tab[0] == NULL && t38_tab[0] == NULL && app_tab[0] == NULL) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Got no compatible codecs!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Got no compatible codecs!\n");
break;
}
for (pos = 0; audio_tab[pos] != NULL; pos++) {
@@ -1287,7 +1287,7 @@ static switch_status exosip_create_call(eXosip_event_t * event)
1,
SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE,
NULL, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Can't load codec?\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n");
switch_channel_hangup(channel);
return SWITCH_STATUS_FALSE;
} else {
@@ -1298,7 +1298,7 @@ static switch_status exosip_create_call(eXosip_event_t * event)
1,
SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE,
NULL, switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Can't load codec?\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n");
switch_channel_hangup(channel);
return SWITCH_STATUS_FALSE;
} else {
@@ -1306,7 +1306,7 @@ static switch_status exosip_create_call(eXosip_event_t * event)
tech_pvt->read_frame.rate = rate;
switch_set_flag(tech_pvt, TFLAG_USING_CODEC);
ms = tech_pvt->write_codec.implementation->microseconds_per_frame / 1000;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Activate Inbound Codec %s/%d %d ms\n", dname, rate, ms);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Activate Inbound Codec %s/%d %d ms\n", dname, rate, ms);
tech_pvt->read_frame.codec = &tech_pvt->read_codec;
switch_core_session_set_read_codec(session, &tech_pvt->read_codec);
switch_core_session_set_write_codec(session, &tech_pvt->write_codec);
@@ -1328,7 +1328,7 @@ static switch_status exosip_create_call(eXosip_event_t * event)
return SWITCH_STATUS_FALSE;
}
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Cannot Create new Inbound Channel!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot Create new Inbound Channel!\n");
return SWITCH_STATUS_FALSE;
}
@@ -1343,7 +1343,7 @@ static void destroy_call_by_event(eXosip_event_t * event)
switch_channel *channel = NULL;
if ((tech_pvt = get_pvt_by_call_id(event->cid)) == 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Um in case you are interested, Can't find the pvt [%d]!\n",
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Um in case you are interested, Can't find the pvt [%d]!\n",
event->cid);
return;
}
@@ -1386,7 +1386,7 @@ static switch_status parse_sdp_media(sdp_media_t * media, char **dname, char **d
*dname = strdup("L16");
*drate = strdup("8000");
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Found negotiated codec Payload: %s Name: %s Rate: %s\n",
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Found negotiated codec Payload: %s Name: %s Rate: %s\n",
*dpayload, *dname, *drate);
break;
}
@@ -1409,7 +1409,7 @@ static void handle_answer(eXosip_event_t * event)
if ((tech_pvt = get_pvt_by_call_id(event->cid)) == 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Um in case you are interested, Can't find the pvt!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Um in case you are interested, Can't find the pvt!\n");
return;
}
@@ -1417,14 +1417,14 @@ static void handle_answer(eXosip_event_t * event)
assert(channel != NULL);
if (!event->response) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Someone answered... with no SDP information - WTF?!?\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Someone answered... with no SDP information - WTF?!?\n");
switch_channel_hangup(channel);
return;
}
/* Get all of the remote SDP elements... stuff */
if ((remote_sdp = eXosip_get_sdp_info(event->response)) == 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Cant Find SDP?\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cant Find SDP?\n");
switch_channel_hangup(channel);
return;
}
@@ -1458,7 +1458,7 @@ static void handle_answer(eXosip_event_t * event)
1,
SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE,
NULL, switch_core_session_get_pool(tech_pvt->session)) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Can't load codec?\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n");
switch_channel_hangup(channel);
return;
} else {
@@ -1470,7 +1470,7 @@ static void handle_answer(eXosip_event_t * event)
SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE,
NULL,
switch_core_session_get_pool(tech_pvt->session)) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Can't load codec?\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n");
switch_channel_hangup(channel);
return;
} else {
@@ -1478,7 +1478,7 @@ static void handle_answer(eXosip_event_t * event)
tech_pvt->read_frame.rate = rate;
switch_set_flag(tech_pvt, TFLAG_USING_CODEC);
ms = tech_pvt->write_codec.implementation->microseconds_per_frame / 1000;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Activate Outbound Codec %s/%d %d ms\n", dname, rate, ms);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Activate Outbound Codec %s/%d %d ms\n", dname, rate, ms);
tech_pvt->read_frame.codec = &tech_pvt->read_codec;
switch_core_session_set_read_codec(tech_pvt->session, &tech_pvt->read_codec);
switch_core_session_set_write_codec(tech_pvt->session, &tech_pvt->write_codec);
@@ -1641,7 +1641,7 @@ static int config_exosip(int reload)
if (!switch_config_open_file(&cfg, cf)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "open of %s failed\n", cf);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "open of %s failed\n", cf);
return SWITCH_STATUS_TERM;
}
@@ -1724,12 +1724,12 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void)
}
if (eXosip_init()) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "eXosip_init initialization failed!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "eXosip_init initialization failed!\n");
return SWITCH_STATUS_TERM;
}
if (eXosip_listen_addr(IPPROTO_UDP, NULL, globals.port, AF_INET, 0)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "eXosip_listen_addr failed!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "eXosip_listen_addr failed!\n");
return SWITCH_STATUS_TERM;
}
@@ -1755,14 +1755,14 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void)
switch (event->type) {
case EXOSIP_CALL_INVITE:
if (exosip_create_call(event) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "invite failure\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "invite failure\n");
destroy_call_by_event(event);
}
break;
case EXOSIP_CALL_REINVITE:
/* See what the reinvite is about - on hold or whatever */
//handle_reinvite(event);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Got a reinvite.\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Got a reinvite.\n");
break;
case EXOSIP_CALL_MESSAGE_NEW:
if (event->request != NULL && MSG_IS_REFER(event->request)) {
@@ -1773,7 +1773,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void)
/* If audio is not flowing and this has SDP - fire it up! */
break;
case EXOSIP_CALL_ANSWERED:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "The call was answered.\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "The call was answered.\n");
handle_answer(event);
break;
case EXOSIP_CALL_PROCEEDING:
@@ -1783,7 +1783,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void)
//handle_ringing(event);
break;
case EXOSIP_CALL_REDIRECTED:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Call was redirect\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Call was redirect\n");
break;
case EXOSIP_CALL_CLOSED:
destroy_call_by_event(event);
@@ -1792,24 +1792,24 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void)
destroy_call_by_event(event);
break;
case EXOSIP_CALL_NOANSWER:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "The call was not answered.\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "The call was not answered.\n");
destroy_call_by_event(event);
break;
case EXOSIP_CALL_REQUESTFAILURE:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Request failure\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Request failure\n");
destroy_call_by_event(event);
break;
case EXOSIP_CALL_SERVERFAILURE:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Server failure\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Server failure\n");
destroy_call_by_event(event);
break;
case EXOSIP_CALL_GLOBALFAILURE:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Global failure\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Global failure\n");
destroy_call_by_event(event);
break;
/* Registration related stuff */
case EXOSIP_REGISTRATION_NEW:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Received registration attempt\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Received registration attempt\n");
break;
default:
/* Unknown event... casually absorb it for now */
+30 -30
View File
@@ -191,7 +191,7 @@ static unsigned short iax_build_codec_rates(void)
samples |= IAX_RATE_48KHZ;
break;
default:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "I don't know rate %d\n", rate);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "I don't know rate %d\n", rate);
break;
}
}
@@ -221,13 +221,13 @@ static switch_status iax_set_codec(struct private_object *tech_pvt, struct iax_s
SWITCH_MAX_CODECS,
globals.codec_order,
globals.codec_order_last)) <= 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "NO codecs?\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "NO codecs?\n");
return SWITCH_STATUS_GENERR;
}
} else
if (((num_codecs =
switch_loadable_module_get_codecs(switch_core_session_get_pool(tech_pvt->session), codecs, SWITCH_MAX_CODECS))) <= 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "NO codecs?\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "NO codecs?\n");
return SWITCH_STATUS_GENERR;
}
@@ -274,7 +274,7 @@ static switch_status iax_set_codec(struct private_object *tech_pvt, struct iax_s
strncat(pref_str, x == len - 1 ? ")" : ",", sizeof(pref_str));
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Codec Prefs Detected: %s\n", pref_str);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Codec Prefs Detected: %s\n", pref_str);
for (x = 0; x < len; x++) {
if ((prefs[x] & mixed_cap)) {
@@ -310,7 +310,7 @@ static switch_status iax_set_codec(struct private_object *tech_pvt, struct iax_s
}
if (!dname && !chosen) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "NO codecs?\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "NO codecs?\n");
return SWITCH_STATUS_GENERR;
}
@@ -352,7 +352,7 @@ static switch_status iax_set_codec(struct private_object *tech_pvt, struct iax_s
1,
SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE,
NULL, switch_core_session_get_pool(tech_pvt->session)) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Can't load codec?\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n");
return SWITCH_STATUS_GENERR;
} else {
if (switch_core_codec_init(&tech_pvt->write_codec,
@@ -362,7 +362,7 @@ static switch_status iax_set_codec(struct private_object *tech_pvt, struct iax_s
1,
SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE,
NULL, switch_core_session_get_pool(tech_pvt->session)) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Can't load codec?\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n");
switch_core_codec_destroy(&tech_pvt->read_codec);
return SWITCH_STATUS_GENERR;
} else {
@@ -371,7 +371,7 @@ static switch_status iax_set_codec(struct private_object *tech_pvt, struct iax_s
ms = tech_pvt->write_codec.implementation->microseconds_per_frame / 1000;
rate = tech_pvt->write_codec.implementation->samples_per_second;
tech_pvt->read_frame.rate = rate;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Activate Codec %s/%d %d ms\n", dname, rate, ms);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Activate Codec %s/%d %d ms\n", dname, rate, ms);
tech_pvt->read_frame.codec = &tech_pvt->read_codec;
switch_core_session_set_read_codec(tech_pvt->session, &tech_pvt->read_codec);
switch_core_session_set_write_codec(tech_pvt->session, &tech_pvt->write_codec);
@@ -404,7 +404,7 @@ static switch_status channel_kill_channel(switch_core_session *session, int sig)
static void iax_err_cb(const char *s)
{
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, "IAX ERR: %s", s);
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_ERROR, "IAX ERR: %s", s);
}
static void iax_out_cb(const char *s)
@@ -739,7 +739,7 @@ static switch_status channel_outgoing_channel(switch_core_session *session, swit
switch_core_session_set_private(*new_session, tech_pvt);
tech_pvt->session = *new_session;
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Hey where is my memory pool?\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Hey where is my memory pool?\n");
switch_core_session_destroy(new_session);
return SWITCH_STATUS_GENERR;
}
@@ -754,7 +754,7 @@ static switch_status channel_outgoing_channel(switch_core_session *session, swit
switch_channel_set_caller_profile(channel, caller_profile);
tech_pvt->caller_profile = caller_profile;
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Doh! no caller profile\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Doh! no caller profile\n");
switch_core_session_destroy(new_session);
return SWITCH_STATUS_GENERR;
}
@@ -792,7 +792,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_modul
{
if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "OH OH no pool\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "OH OH no pool\n");
return SWITCH_STATUS_TERM;
}
@@ -822,7 +822,7 @@ static switch_status load_config(void)
memset(&globals, 0, sizeof(globals));
if (!switch_config_open_file(&cfg, cf)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "open of %s failed\n", cf);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "open of %s failed\n", cf);
return SWITCH_STATUS_TERM;
}
@@ -878,7 +878,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void)
iax_enable_debug();
}
if (iax_init(globals.ip, globals.port) < 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Error Binding Port!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Binding Port!\n");
return SWITCH_STATUS_TERM;
}
@@ -886,7 +886,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void)
iax_set_output(iax_out_cb);
//netfd = iax_get_fd();
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "IAX Ready Port %d\n", globals.port);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "IAX Ready Port %d\n", globals.port);
if (switch_event_create(&s_event, SWITCH_EVENT_PUBLISH) == SWITCH_STATUS_SUCCESS) {
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "service", "_iax2._udp");
@@ -913,12 +913,12 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void)
}
switch (iaxevent->etype) {
case IAX_EVENT_REGACK:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Registration completed successfully.\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Registration completed successfully.\n");
//if (iaxevent->ies.refresh)
//refresh = iaxevent->ies.refresh;
break;
case IAX_EVENT_REGREJ:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Registration failed.\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Registration failed.\n");
break;
case IAX_EVENT_TIMEOUT:
break;
@@ -929,16 +929,16 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void)
if (iax_set_codec(tech_pvt, iaxevent->session, &format, &cap, &iaxevent->ies.samprate, IAX_SET) !=
SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "WTF? %u %u\n", iaxevent->ies.format,
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "WTF? %u %u\n", iaxevent->ies.format,
iaxevent->ies.capability);
}
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Call accepted.\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Call accepted.\n");
break;
case IAX_EVENT_RINGA:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Ringing heard.\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Ringing heard.\n");
break;
case IAX_EVENT_PONG:
// informative only
@@ -949,10 +949,10 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void)
switch_channel *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_DEBUG, "WTF Mutiple Answer %s?\n",
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "WTF Mutiple Answer %s?\n",
switch_channel_get_name(channel));
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Answer %s\n",
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Answer %s\n",
switch_channel_get_name(channel));
switch_channel_answer(channel);
}
@@ -962,7 +962,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void)
break;
case IAX_EVENT_CONNECT:
// incoming call detected
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE,
"Incoming call connected %s, %s, %s %u/%u\n",
iaxevent->ies.called_number,
iaxevent->ies.calling_number,
@@ -971,7 +971,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void)
if (iaxevent) {
switch_core_session *session;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "New Inbound Channel %s!\n",
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;
@@ -986,7 +986,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void)
switch_core_session_set_private(session, tech_pvt);
tech_pvt->session = session;
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Hey where is my memory pool?\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Hey where is my memory pool?\n");
switch_core_session_destroy(&session);
break;
}
@@ -1025,7 +1025,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void)
}
break;
case IAX_EVENT_REJECT:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Rejected call.\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Rejected call.\n");
case IAX_EVENT_BUSY:
case IAX_EVENT_HANGUP:
if (tech_pvt) {
@@ -1034,7 +1034,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void)
switch_clear_flag(tech_pvt, TFLAG_IO);
switch_clear_flag(tech_pvt, TFLAG_VOICE);
if ((channel = switch_core_session_get_channel(tech_pvt->session)) != 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Hangup %s\n", switch_channel_get_name(channel));
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Hangup %s\n", switch_channel_get_name(channel));
switch_set_flag(tech_pvt, TFLAG_HANGUP);
switch_channel_hangup(channel);
//switch_thread_cond_signal(tech_pvt->cond);
@@ -1047,7 +1047,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void)
break;
case IAX_EVENT_CNG:
// pseudo-silence
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "sending silence\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "sending silence\n");
break;
case IAX_EVENT_VOICE:
if (tech_pvt && (tech_pvt->read_frame.datalen = iaxevent->datalen) != 0) {
@@ -1065,7 +1065,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void)
}
break;
case IAX_EVENT_TRANSFER:
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Call transfer occurred.\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Call transfer occurred.\n");
//session[0] = iaxevent->session;
break;
case IAX_EVENT_DTMF:
@@ -1074,7 +1074,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_runtime(void)
if ((channel = switch_core_session_get_channel(tech_pvt->session)) != 0) {
char str[2] = { (char)iaxevent->subclass };
if (globals.debug) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s DTMF %s\n", str,
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "%s DTMF %s\n", str,
switch_channel_get_name(channel));
}
switch_channel_queue_dtmf(channel, str);
+4 -4
View File
@@ -196,7 +196,7 @@ static switch_status channel_outgoing_channel(switch_core_session *session, swit
switch_core_session_set_private(*new_session, tech_pvt);
tech_pvt->session = *new_session;
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Hey where is my memory pool?\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Hey where is my memory pool?\n");
switch_core_session_destroy(new_session);
return SWITCH_STATUS_GENERR;
}
@@ -209,7 +209,7 @@ static switch_status channel_outgoing_channel(switch_core_session *session, swit
snprintf(name, sizeof(name), "Opal/%s-%04x", caller_profile->destination_number, rand() & 0xffff);
switch_channel_set_name(channel, name);
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Doh! no caller profile\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Doh! no caller profile\n");
switch_core_session_destroy(new_session);
return SWITCH_STATUS_GENERR;
}
@@ -355,7 +355,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_modul
memset(&globals, 0, sizeof(globals));
if (!switch_config_open_file(&cfg, cf)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "open of %s failed\n", cf);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "open of %s failed\n", cf);
return SWITCH_STATUS_TERM;
}
@@ -374,7 +374,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_modul
if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "OH OH no pool\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "OH OH no pool\n");
return SWITCH_STATUS_TERM;
}
+37 -37
View File
@@ -491,7 +491,7 @@ static switch_status channel_outgoing_channel(switch_core_session *session, swit
switch_core_session_set_private(*new_session, tech_pvt);
tech_pvt->session = *new_session;
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Hey where is my memory pool?\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Hey where is my memory pool?\n");
switch_core_session_destroy(new_session);
return SWITCH_STATUS_GENERR;
}
@@ -507,7 +507,7 @@ static switch_status channel_outgoing_channel(switch_core_session *session, swit
switch_channel_set_caller_profile(channel, caller_profile);
tech_pvt->caller_profile = caller_profile;
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Doh! no caller profile\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Doh! no caller profile\n");
switch_core_session_destroy(new_session);
return SWITCH_STATUS_GENERR;
}
@@ -527,7 +527,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_modul
{
if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "OH OH no pool\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "OH OH no pool\n");
return SWITCH_STATUS_TERM;
}
@@ -540,7 +540,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_modul
dump_info();
if (switch_event_reserve_subclass(MY_EVENT_RINGING) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Couldn't register subclass!");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Couldn't register subclass!");
return SWITCH_STATUS_GENERR;
}
@@ -561,7 +561,7 @@ static switch_status load_config(void)
memset(&globals, 0, sizeof(globals));
if (!switch_config_open_file(&cfg, cf)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "open of %s failed\n", cf);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "open of %s failed\n", cf);
return SWITCH_STATUS_TERM;
}
@@ -632,7 +632,7 @@ static int get_dev_by_name(char *name, int in)
numDevices = Pa_CountDevices();
if (numDevices < 0) {
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, "ERROR: Pa_CountDevices returned 0x%x\n", numDevices);
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_ERROR, "ERROR: Pa_CountDevices returned 0x%x\n", numDevices);
return -2;
}
@@ -658,55 +658,55 @@ static int dump_info(void)
PaError err;
numDevices = Pa_CountDevices();
if (numDevices < 0) {
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, "ERROR: Pa_CountDevices returned 0x%x\n", numDevices);
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_ERROR, "ERROR: Pa_CountDevices returned 0x%x\n", numDevices);
err = numDevices;
goto error;
}
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, "Number of devices = %d\n", numDevices);
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_INFO, "Number of devices = %d\n", numDevices);
for (i = 0; i < numDevices; i++) {
pdi = Pa_GetDeviceInfo(i);
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, "---------------------------------------------- #%d", i);
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_INFO, "---------------------------------------------- #%d", i);
if (i == Pa_GetDefaultInputDeviceID())
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, " DefaultInput");
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_INFO, " DefaultInput");
if (i == Pa_GetDefaultOutputDeviceID())
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, " DefaultOutput");
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, "\nName = %s\n", pdi->name);
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, "Max Inputs = %d", pdi->maxInputChannels);
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, ", Max Outputs = %d\n", pdi->maxOutputChannels);
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_INFO, " DefaultOutput");
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_INFO, "\nName = %s\n", pdi->name);
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_INFO, "Max Inputs = %d", pdi->maxInputChannels);
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_INFO, ", Max Outputs = %d\n", pdi->maxOutputChannels);
if (pdi->numSampleRates == -1) {
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, "Sample Rate Range = %f to %f\n", pdi->sampleRates[0],
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_INFO, "Sample Rate Range = %f to %f\n", pdi->sampleRates[0],
pdi->sampleRates[1]);
} else {
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, "Sample Rates =");
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_INFO, "Sample Rates =");
for (j = 0; j < pdi->numSampleRates; j++) {
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, " %8.2f,", pdi->sampleRates[j]);
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_INFO, " %8.2f,", pdi->sampleRates[j]);
}
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, "\n");
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_INFO, "\n");
}
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, "Native Sample Formats = ");
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_INFO, "Native Sample Formats = ");
if (pdi->nativeSampleFormats & paInt8)
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, "paInt8, ");
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_INFO, "paInt8, ");
if (pdi->nativeSampleFormats & paUInt8)
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, "paUInt8, ");
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_INFO, "paUInt8, ");
if (pdi->nativeSampleFormats & paInt16)
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, "paInt16, ");
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_INFO, "paInt16, ");
if (pdi->nativeSampleFormats & paInt32)
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, "paInt32, ");
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_INFO, "paInt32, ");
if (pdi->nativeSampleFormats & paFloat32)
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, "paFloat32, ");
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_INFO, "paFloat32, ");
if (pdi->nativeSampleFormats & paInt24)
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, "paInt24, ");
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_INFO, "paInt24, ");
if (pdi->nativeSampleFormats & paPackedInt24)
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, "paPackedInt24, ");
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, "\n");
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_INFO, "paPackedInt24, ");
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_INFO, "\n");
}
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, "----------------------------------------------\n");
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_INFO, "----------------------------------------------\n");
return 0;
error:
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, "An error occured while using the portaudio stream\n");
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, "Error number: %d\n", err);
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, "Error message: %s\n", Pa_GetErrorText(err));
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_ERROR, "An error occured while using the portaudio stream\n");
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_ERROR, "Error number: %d\n", err);
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_ERROR, "Error message: %s\n", Pa_GetErrorText(err));
return err;
}
@@ -726,7 +726,7 @@ static switch_status engage_device(struct private_object *tech_pvt)
1,
SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE,
NULL, switch_core_session_get_pool(tech_pvt->session)) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Can't load codec?\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n");
return SWITCH_STATUS_FALSE;
} else {
if (switch_core_codec_init(&tech_pvt->write_codec,
@@ -736,12 +736,12 @@ static switch_status engage_device(struct private_object *tech_pvt)
1,
SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE,
NULL, switch_core_session_get_pool(tech_pvt->session)) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Can't load codec?\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n");
switch_core_codec_destroy(&tech_pvt->read_codec);
return SWITCH_STATUS_FALSE;
}
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Loaded codec L16 %dhz %dms on %s\n", sample_rate, codec_ms,
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Loaded codec L16 %dhz %dms on %s\n", sample_rate, codec_ms,
switch_channel_get_name(channel));
tech_pvt->read_frame.rate = sample_rate;
tech_pvt->read_frame.codec = &tech_pvt->read_codec;
@@ -758,12 +758,12 @@ static switch_status engage_device(struct private_object *tech_pvt)
if ((tech_pvt->err =
OpenAudioStream(&tech_pvt->audio_out, sample_rate, SAMPLE_TYPE, PABLIO_WRITE | PABLIO_MONO, -1,
tech_pvt->outdev)) != paNoError) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Can't open audio out [%d]!\n", tech_pvt->outdev);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't open audio out [%d]!\n", tech_pvt->outdev);
CloseAudioStream(tech_pvt->audio_in);
tech_pvt->audio_in = NULL;
}
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Can't open audio in [%d]!\n", tech_pvt->indev);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't open audio in [%d]!\n", tech_pvt->indev);
}
switch_mutex_unlock(globals.device_lock);
@@ -803,7 +803,7 @@ static switch_status place_call(char *dest, char *out, size_t outlen)
switch_core_session_set_private(session, tech_pvt);
tech_pvt->session = session;
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Hey where is my memory pool?\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Hey where is my memory pool?\n");
switch_core_session_destroy(&session);
return SWITCH_STATUS_FALSE;
}
+46 -46
View File
@@ -250,7 +250,7 @@ static switch_status wanpipe_on_init(switch_core_session *session)
mtu_mru = sangoma_tdm_get_usr_mtu_mru(tech_pvt->socket, &tdm_api);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "ADJUSTED MTU AFTER SETTING IT TO %d is %d %d [%s]\n", new_mtu, mtu_mru, err, strerror(err));
if (mtu_mru != globals.mtu) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Failure to adjust MTU\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failure to adjust MTU\n");
switch_channel_hangup(channel);
return SWITCH_STATUS_FALSE;
}
@@ -259,7 +259,7 @@ static switch_status wanpipe_on_init(switch_core_session *session)
if (switch_core_codec_init
(&tech_pvt->read_codec, "L16", rate, 20, 1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL,
switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s Cannot set read codec\n", switch_channel_get_name(channel));
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s Cannot set read codec\n", switch_channel_get_name(channel));
switch_channel_hangup(channel);
return SWITCH_STATUS_FALSE;
}
@@ -267,7 +267,7 @@ static switch_status wanpipe_on_init(switch_core_session *session)
if (switch_core_codec_init
(&tech_pvt->write_codec, "L16", rate, 20, 1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL,
switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s Cannot set read codec\n", switch_channel_get_name(channel));
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s Cannot set read codec\n", switch_channel_get_name(channel));
switch_channel_hangup(channel);
return SWITCH_STATUS_FALSE;
}
@@ -537,13 +537,13 @@ static switch_status wanpipe_write_frame(switch_core_session *session, switch_fr
result = sangoma_sendmsg_socket(tech_pvt->socket,
&tech_pvt->hdrframe, sizeof(tech_pvt->hdrframe), dtmf, bread, 0);
if (result < 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
"Bad Write %d bytes returned %d (%s)!\n", bread,
result, strerror(errno));
if (errno == EBUSY) {
continue;
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Write Failed!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Write Failed!\n");
status = SWITCH_STATUS_GENERR;
break;
} else {
@@ -579,13 +579,13 @@ static switch_status wanpipe_write_frame(switch_core_session *session, switch_fr
result = sangoma_sendmsg_socket(tech_pvt->socket,
&tech_pvt->hdrframe, sizeof(tech_pvt->hdrframe), bp, towrite, 0);
if (result < 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
"Bad Write frame len %u write %d bytes returned %d (%s)!\n", frame->datalen,
globals.mtu, result, strerror(errno));
if (errno == EBUSY) {
continue;
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Write Failed!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Write Failed!\n");
status = SWITCH_STATUS_GENERR;
break;
} else {
@@ -616,7 +616,7 @@ static switch_status wanpipe_send_dtmf(switch_core_session *session, char *digit
if (!tech_pvt->dtmf_buffer) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Allocate DTMF Buffer....");
if (switch_buffer_create(switch_core_session_get_pool(session), &tech_pvt->dtmf_buffer, 3192) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, "FAILURE!\n");
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_ERROR, "Failed to allocate DTMF Buffer!\n");
return SWITCH_STATUS_FALSE;
} else {
switch_log_printf(SWITCH_CHANNEL_LOG_CLEAN, SWITCH_LOG_DEBUG, "SUCCESS!\n");
@@ -716,7 +716,7 @@ static switch_status wanpipe_outgoing_channel(switch_core_session *session, swit
}
outbound_profile->destination_number++;
} else if (!globals.configured_spans) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Error No Spans Configured.\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error No Spans Configured.\n");
return SWITCH_STATUS_FALSE;
}
@@ -732,7 +732,7 @@ static switch_status wanpipe_outgoing_channel(switch_core_session *session, swit
switch_core_session_set_private(*new_session, tech_pvt);
tech_pvt->session = *new_session;
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Hey where is my memory pool?\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Hey where is my memory pool?\n");
switch_core_session_destroy(new_session);
return SWITCH_STATUS_GENERR;
}
@@ -755,7 +755,7 @@ static switch_status wanpipe_outgoing_channel(switch_core_session *session, swit
if (num && *num > 47 && *num < 58) {
span = atoi(num);
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Invlid Syntax\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invlid Syntax\n");
switch_core_session_destroy(new_session);
return SWITCH_STATUS_GENERR;
}
@@ -773,13 +773,13 @@ static switch_status wanpipe_outgoing_channel(switch_core_session *session, swit
} else if (num && *num > 47 && *num < 58) {
channo = atoi(num);
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Invlid Syntax\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invlid Syntax\n");
switch_core_session_destroy(new_session);
return SWITCH_STATUS_GENERR;
}
caller_profile->destination_number = p;
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Invlid Syntax\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invlid Syntax\n");
switch_core_session_destroy(new_session);
return SWITCH_STATUS_GENERR;
}
@@ -793,7 +793,7 @@ static switch_status wanpipe_outgoing_channel(switch_core_session *session, swit
sangoma_span_chan_fromif(bchan, &span, &chan);
if (sangoma_span_chan_fromif(bchan, &span, &chan)) {
if ((tech_pvt->socket = sangoma_open_tdmapi_span_chan(span, chan)) < 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Can't open fd!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't open fd!\n");
switch_core_session_destroy(new_session);
return SWITCH_STATUS_GENERR;
}
@@ -802,7 +802,7 @@ static switch_status wanpipe_outgoing_channel(switch_core_session *session, swit
switch_channel_set_name(channel, name);
switch_channel_set_caller_profile(channel, caller_profile);
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Invalid address\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid address\n");
switch_core_session_destroy(new_session);
return SWITCH_STATUS_GENERR;
}
@@ -831,7 +831,7 @@ static switch_status wanpipe_outgoing_channel(switch_core_session *session, swit
}
if (channo <= 0 || channo == (SANGOMA_MAX_CHAN_PER_SPAN)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "No Free Channels!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "No Free Channels!\n");
channo = 0;
}
}
@@ -842,7 +842,7 @@ static switch_status wanpipe_outgoing_channel(switch_core_session *session, swit
} while(autospan && span < MAX_SPANS && !spri && !channo);
if (!spri || channo == 0 || channo == (SANGOMA_MAX_CHAN_PER_SPAN)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "No Free Channels!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "No Free Channels!\n");
switch_core_session_destroy(new_session);
return SWITCH_STATUS_GENERR;
}
@@ -875,7 +875,7 @@ static switch_status wanpipe_outgoing_channel(switch_core_session *session, swit
}
if ((tech_pvt->socket = sangoma_open_tdmapi_span_chan(spri->span, channo)) < 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Can't open fd!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't open fd!\n");
switch_core_session_destroy(new_session);
pri_sr_free(sr);
return SWITCH_STATUS_GENERR;
@@ -886,7 +886,7 @@ static switch_status wanpipe_outgoing_channel(switch_core_session *session, swit
}
}
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Doh! no caller profile\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Doh! no caller profile\n");
switch_core_session_destroy(new_session);
return SWITCH_STATUS_GENERR;
}
@@ -905,7 +905,7 @@ static switch_status wanpipe_outgoing_channel(switch_core_session *session, swit
static void s_pri_error(struct pri *pri, char *s)
{
if (globals.debug) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, s);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, s);
}
}
@@ -924,7 +924,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_modul
pri_set_message(s_pri_message);
if (switch_core_new_memory_pool(&module_pool) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "OH OH no pool\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "OH OH no pool\n");
return SWITCH_STATUS_TERM;
}
@@ -982,7 +982,7 @@ static int on_hangup(struct sangoma_pri *spri, sangoma_pri_event_t event_type, p
chanmap->map[event->hangup.channel] = NULL;
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "-- Hanging up channel s%dc%d\n", spri->span, event->hangup.channel);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "-- Hanging up channel s%dc%d\n", spri->span, event->hangup.channel);
return 0;
}
@@ -996,12 +996,12 @@ static int on_answer(struct sangoma_pri *spri, sangoma_pri_event_t event_type, p
chanmap = spri->private_info;
if ((session = chanmap->map[event->answer.channel])) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "-- Answer on channel s%dc%d\n", spri->span, event->answer.channel);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "-- Answer on channel s%dc%d\n", spri->span, event->answer.channel);
channel = switch_core_session_get_channel(session);
assert(channel != NULL);
switch_channel_answer(channel);
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "-- Answer on channel s%dc%d but it's not in use?\n", spri->span, event->answer.channel);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "-- Answer on channel s%dc%d but it's not in use?\n", spri->span, event->answer.channel);
}
return 0;
@@ -1019,14 +1019,14 @@ static int on_proceed(struct sangoma_pri *spri, sangoma_pri_event_t event_type,
if ((session = chanmap->map[event->proceeding.channel])) {
switch_caller_profile *originator;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "-- Proceeding on channel s%dc%d\n", spri->span, event->proceeding.channel);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "-- Proceeding on channel s%dc%d\n", spri->span, event->proceeding.channel);
channel = switch_core_session_get_channel(session);
assert(channel != NULL);
if ((originator = switch_channel_get_originator_caller_profile(channel))) {
switch_core_session_message msg;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "-- Passing progress to Originator %s\n", originator->chan_name);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "-- Passing progress to Originator %s\n", originator->chan_name);
msg.message_id = SWITCH_MESSAGE_INDICATE_PROGRESS;
msg.from = switch_channel_get_name(channel);
@@ -1038,7 +1038,7 @@ static int on_proceed(struct sangoma_pri *spri, sangoma_pri_event_t event_type,
//switch_channel_answer(channel);
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "-- Proceeding on channel s%dc%d but it's not in use?\n", spri->span, event->proceeding.channel);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "-- Proceeding on channel s%dc%d but it's not in use?\n", spri->span, event->proceeding.channel);
}
return 0;
@@ -1087,12 +1087,12 @@ static int on_ring(struct sangoma_pri *spri, sangoma_pri_event_t event_type, pri
chanmap = spri->private_info;
if (chanmap->map[event->ring.channel]) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "--Duplicate Ring on channel s%dc%d (ignored)\n",
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "--Duplicate Ring on channel s%dc%d (ignored)\n",
spri->span, event->ring.channel);
return 0;
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "-- Ring on channel s%dc%d (from %s to %s)\n", spri->span, event->ring.channel,
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "-- Ring on channel s%dc%d (from %s to %s)\n", spri->span, event->ring.channel,
event->ring.callingnum, event->ring.callednum);
@@ -1114,7 +1114,7 @@ static int on_ring(struct sangoma_pri *spri, sangoma_pri_event_t event_type, pri
switch_channel_set_name(channel, name);
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Hey where is my memory pool?\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Hey where is my memory pool?\n");
switch_core_session_destroy(&session);
return 0;
}
@@ -1146,7 +1146,7 @@ static int on_ring(struct sangoma_pri *spri, sangoma_pri_event_t event_type, pri
tech_pvt->span = spri->span;
if ((fd = sangoma_open_tdmapi_span_chan(spri->span, event->ring.channel)) < 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Can't open fd!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't open fd!\n");
}
//sangoma_tdm_set_hw_period(fd, &tdm_api, 480);
@@ -1156,7 +1156,7 @@ static int on_ring(struct sangoma_pri *spri, sangoma_pri_event_t event_type, pri
switch_channel_set_state(channel, CS_INIT);
switch_core_session_thread_launch(session);
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Cannot Create new Inbound Channel!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot Create new Inbound Channel!\n");
}
@@ -1176,7 +1176,7 @@ static int on_restart(struct sangoma_pri *spri, sangoma_pri_event_t event_type,
struct channel_map *chanmap;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "-- Restarting s%dc%d\n", spri->span, event->restart.channel);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "-- Restarting s%dc%d\n", spri->span, event->restart.channel);
if (event->restart.channel < 1) {
return 0;
@@ -1188,12 +1188,12 @@ static int on_restart(struct sangoma_pri *spri, sangoma_pri_event_t event_type,
if ((session = chanmap->map[event->restart.channel])) {
switch_channel *channel;
channel = switch_core_session_get_channel(session);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Hanging Up channel %s\n", switch_channel_get_name(channel));
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Hanging Up channel %s\n", switch_channel_get_name(channel));
switch_channel_hangup(channel);
}
if ((fd = sangoma_open_tdmapi_span_chan(spri->span, event->restart.channel)) < 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Can't open fd [%s]!\n", strerror(errno));
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't open fd [%s]!\n", strerror(errno));
} else {
close(fd);
}
@@ -1204,7 +1204,7 @@ static int on_dchan_up(struct sangoma_pri *spri, sangoma_pri_event_t event_type,
{
if (!switch_test_flag(spri, SANGOMA_PRI_READY)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Span %d D-Chan UP!\n", spri->span);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Span %d D-Chan UP!\n", spri->span);
switch_set_flag(spri, SANGOMA_PRI_READY);
}
@@ -1215,7 +1215,7 @@ static int on_dchan_down(struct sangoma_pri *spri, sangoma_pri_event_t event_typ
{
if (switch_test_flag(spri, SANGOMA_PRI_READY)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Span %d D-Chan DOWN!\n", spri->span);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Span %d D-Chan DOWN!\n", spri->span);
switch_clear_flag(spri, SANGOMA_PRI_READY);
}
@@ -1288,7 +1288,7 @@ static switch_status config_wanpipe(int reload)
if (!switch_config_open_file(&cfg, cf)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "open of %s failed\n", cf);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "open of %s failed\n", cf);
return SWITCH_STATUS_TERM;
}
@@ -1309,13 +1309,13 @@ static switch_status config_wanpipe(int reload)
if (!strcmp(var, "span")) {
current_span = atoi(val);
if (current_span <= 0 || current_span > MAX_SPANS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Invalid SPAN!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid SPAN!\n");
current_span = 0;
continue;
}
if (!SPANS[current_span]) {
if (!(SPANS[current_span] = switch_core_alloc(module_pool, sizeof(*SPANS[current_span])))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "MEMORY ERROR\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "MEMORY ERROR\n");
break;;
}
SPANS[current_span]->span = current_span;
@@ -1323,7 +1323,7 @@ static switch_status config_wanpipe(int reload)
} else {
if (!current_span) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Invalid option %s when no span defined.\n", var);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid option %s when no span defined.\n", var);
continue;
}
@@ -1343,14 +1343,14 @@ static switch_status config_wanpipe(int reload)
SPANS[current_span]->bchans |= (1 << x);
}
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Invalid bchan range!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid bchan range!\n");
}
} else {
int i = atoi(val);
if (i > 0 && i < 31) {
SPANS[current_span]->bchans |= (1 << i);
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Invalid bchan!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid bchan!\n");
}
}
} else if (!strcmp(var, "node")) {
@@ -1369,7 +1369,7 @@ static switch_status config_wanpipe(int reload)
if (mtu >= 10 && mtu < 960) {
SPANS[current_span]->mtu = mtu;
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Invalid MTU (%s)!\n", val);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Invalid MTU (%s)!\n", val);
}
}
}
@@ -1395,10 +1395,10 @@ static switch_status config_wanpipe(int reload)
SPANS[current_span]->pswitch,
SPANS[current_span]->node,
globals.debug)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Cannot launch span %d\n", current_span);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Cannot launch span %d\n", current_span);
continue;
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Launch span %d\n", current_span);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Launch span %d\n", current_span);
pri_thread_launch(&SPANS[current_span]->spri);
globals.configured_spans++;
}
+25 -25
View File
@@ -212,7 +212,7 @@ static switch_status woomerachan_on_init(switch_core_session *session)
if (switch_core_codec_init
(&tech_pvt->read_codec, "L16", rate, 30, 1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL,
switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s Cannot set read codec\n", switch_channel_get_name(channel));
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s Cannot set read codec\n", switch_channel_get_name(channel));
switch_channel_hangup(channel);
return SWITCH_STATUS_FALSE;
}
@@ -220,7 +220,7 @@ static switch_status woomerachan_on_init(switch_core_session *session)
if (switch_core_codec_init
(&tech_pvt->write_codec, "L16", rate, 30, 1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL,
switch_core_session_get_pool(session)) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s Cannot set read codec\n", switch_channel_get_name(channel));
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s Cannot set read codec\n", switch_channel_get_name(channel));
switch_channel_hangup(channel);
return SWITCH_STATUS_FALSE;
}
@@ -483,7 +483,7 @@ static switch_status woomerachan_outgoing_channel(switch_core_session *session,
switch_core_session_set_private(*new_session, tech_pvt);
tech_pvt->session = *new_session;
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Hey where is my memory pool?\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Hey where is my memory pool?\n");
switch_core_session_destroy(new_session);
return SWITCH_STATUS_GENERR;
}
@@ -499,7 +499,7 @@ static switch_status woomerachan_outgoing_channel(switch_core_session *session,
switch_channel_set_caller_profile(channel, caller_profile);
tech_pvt->caller_profile = caller_profile;
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Doh! no caller profile\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Doh! no caller profile\n");
switch_core_session_destroy(new_session);
return SWITCH_STATUS_GENERR;
}
@@ -527,7 +527,7 @@ static void tech_destroy(private_object * tech_pvt)
WOOMERA_RECORD_SEPERATOR);
if (woomera_message_parse
(tech_pvt->command_channel, &wmsg, WOOMERA_HARD_TIMEOUT, tech_pvt->profile, &tech_pvt->event_queue) < 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "{%s} Already Disconnected\n", tech_pvt->profile->name);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "{%s} Already Disconnected\n", tech_pvt->profile->name);
}
woomera_printf(tech_pvt->profile, tech_pvt->command_channel, "bye%s", WOOMERA_RECORD_SEPERATOR);
@@ -551,7 +551,7 @@ static void woomera_printf(woomera_profile * profile, switch_socket_t *socket, c
#endif
va_end(ap);
if (res == -1) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Out of memory\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Out of memory\n");
} else {
if (profile && globals.debug) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Send Message: {%s} [%s/%d]\n%s\n%s", profile->name,
@@ -596,7 +596,7 @@ static int woomera_enqueue_event(woomera_event_queue * event_queue, woomera_mess
}
return 1;
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Memory Allocation Error!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Memory Allocation Error!\n");
}
return 0;
@@ -704,14 +704,14 @@ static int woomera_message_parse(switch_socket_t *fd, woomera_message * wmsg, in
cur++;
wmsg->mval = atoi(buf);
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Malformed Message!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Malformed Message!\n");
break;
}
}
if (cur) {
strncpy(wmsg->command, cur, WOOMERA_STRLEN);
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Malformed Message!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Malformed Message!\n");
break;
}
} else {
@@ -820,7 +820,7 @@ static int woomera_locate_socket(woomera_profile * profile, switch_socket_t **wo
if (!woomera_profile_thread_running(profile, 0, 0)) {
break;
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "{%s} Cannot Reconnect to Woomera! retry in 5 seconds\n",
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "{%s} Cannot Reconnect to Woomera! retry in 5 seconds\n",
profile->name);
switch_sleep(WOOMERA_RECONNECT_TIME);
}
@@ -830,7 +830,7 @@ static int woomera_locate_socket(woomera_profile * profile, switch_socket_t **wo
woomera_printf(profile, *woomera_socket, "LISTEN%s", WOOMERA_RECORD_SEPERATOR);
if (woomera_message_parse(*woomera_socket,
&wmsg, WOOMERA_HARD_TIMEOUT, profile, &profile->event_queue) < 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "{%s} HELP! Woomera is broken!\n", profile->name);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ALERT, "{%s} HELP! Woomera is broken!\n", profile->name);
globals.panic = 1;
woomera_profile_thread_running(&default_profile, 1, 0);
switch_sleep(WOOMERA_RECONNECT_TIME);
@@ -881,7 +881,7 @@ static int tech_activate(private_object * tech_pvt)
if ((connect_woomera(&tech_pvt->command_channel, tech_pvt->profile, 0))) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "connected to woomera!\n");
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Can't connect to woomera!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Can't connect to woomera!\n");
switch_sleep(WOOMERA_RECONNECT_TIME);
return -1;
}
@@ -906,14 +906,14 @@ static int tech_activate(private_object * tech_pvt)
woomera_printf(tech_pvt->profile, tech_pvt->command_channel, "LISTEN%s", WOOMERA_RECORD_SEPERATOR);
if (woomera_message_parse(tech_pvt->command_channel,
&wmsg, WOOMERA_HARD_TIMEOUT, tech_pvt->profile, &tech_pvt->event_queue) < 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "{%s} HELP! Woomera is broken!\n",
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ALERT, "{%s} HELP! Woomera is broken!\n",
tech_pvt->profile->name);
switch_set_flag(tech_pvt, TFLAG_ABORT);
globals.panic = 1;
}
}
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Where's my tech_pvt?\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Where's my tech_pvt?\n");
}
return 0;
@@ -968,7 +968,7 @@ static void *woomera_channel_thread_run(switch_thread *thread, void *obj)
if (woomera_message_parse
(tech_pvt->command_channel, &wmsg, WOOMERA_HARD_TIMEOUT, tech_pvt->profile,
&tech_pvt->event_queue) < 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "{%s} HELP! Woomera is broken!\n",
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ALERT, "{%s} HELP! Woomera is broken!\n",
tech_pvt->profile->name);
switch_set_flag(tech_pvt, TFLAG_ABORT);
globals.panic = 1;
@@ -984,7 +984,7 @@ static void *woomera_channel_thread_run(switch_thread *thread, void *obj)
if (woomera_message_parse
(tech_pvt->command_channel, &wmsg, WOOMERA_HARD_TIMEOUT, tech_pvt->profile,
&tech_pvt->event_queue) < 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "{%s} HELP! Woomera is broken!\n",
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ALERT, "{%s} HELP! Woomera is broken!\n",
tech_pvt->profile->name);
switch_set_flag(tech_pvt, TFLAG_ABORT);
globals.panic = 1;
@@ -1082,7 +1082,7 @@ static void *woomera_channel_thread_run(switch_thread *thread, void *obj)
if (woomera_message_parse(tech_pvt->command_channel,
&wmsg, WOOMERA_HARD_TIMEOUT, tech_pvt->profile, &tech_pvt->event_queue) < 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "{%s} HELP! Woomera is broken!\n",
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ALERT, "{%s} HELP! Woomera is broken!\n",
tech_pvt->profile->name);
switch_set_flag(tech_pvt, TFLAG_ABORT);
globals.panic = 1;
@@ -1117,7 +1117,7 @@ static void *woomera_channel_thread_run(switch_thread *thread, void *obj)
switch_core_session_get_pool(tech_pvt->session)) !=
SWITCH_STATUS_SUCCESS) {
if (globals.debug) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
WOOMERA_DEBUG_PREFIX "{%s} Cannot resolve %s\n",
tech_pvt->profile->name, ip);
}
@@ -1159,7 +1159,7 @@ static void *woomera_thread_run(void *obj)
while (woomera_profile_thread_running(profile, 0, 0)) {
/* listen on socket and handle events */
if (globals.panic == 2) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Woomera is disabled!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Woomera is disabled!\n");
switch_sleep(WOOMERA_RECONNECT_TIME);
continue;
}
@@ -1178,7 +1178,7 @@ static void *woomera_thread_run(void *obj)
if (globals.panic) {
if (globals.panic != 2) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Help I'm in a state of panic!\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ALERT, "Help I'm in a state of panic!\n");
globals.panic = 0; //fix
}
woomera_socket_close(&profile->woomera_socket);
@@ -1192,7 +1192,7 @@ static void *woomera_thread_run(void *obj)
/* if we are not stingy with threads we can block forever */
0, profile, NULL))) != 0)) {
if (res < 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "{%s} HELP! I lost my connection to woomera!\n",
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ALERT, "{%s} HELP! I lost my connection to woomera!\n",
profile->name);
woomera_socket_close(&profile->woomera_socket);
@@ -1228,7 +1228,7 @@ static void *woomera_thread_run(void *obj)
name = woomera_message_header(&wmsg, "Channel-Name");
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "New Inbound Channel %s!\n", name);
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;
@@ -1243,7 +1243,7 @@ static void *woomera_thread_run(void *obj)
switch_core_session_set_private(session, tech_pvt);
tech_pvt->session = session;
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Hey where is my memory pool?\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Hey where is my memory pool?\n");
switch_core_session_destroy(&session);
break;
}
@@ -1305,7 +1305,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_modul
globals.next_woomera_port = WOOMERA_MIN_PORT;
if (!switch_config_open_file(&cfg, cf)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "open of %s failed\n", cf);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "open of %s failed\n", cf);
return SWITCH_STATUS_TERM;
}
@@ -1362,7 +1362,7 @@ SWITCH_MOD_DECLARE(switch_status) switch_module_load(const switch_loadable_modul
if (switch_mutex_init(&default_profile.iolock, SWITCH_MUTEX_NESTED, module_pool) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "OH OH no lock\n");
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "OH OH no lock\n");
return SWITCH_STATUS_TERM;
}