skinny logging

This commit is contained in:
Nathan Neulinger 2013-06-23 14:58:25 -05:00
parent 0d4967b718
commit 4a267627f2
3 changed files with 39 additions and 8 deletions

View File

@ -459,6 +459,22 @@ void skinny_feature_get(listener_t *listener, uint32_t instance, struct feature_
/*****************************************************************************/
/* SKINNY MESSAGE SENDER */
/*****************************************************************************/
switch_status_t perform_send_keep_alive_ack(listener_t *listener,
const char *file, const char *func, int line)
{
skinny_message_t *message;
message = switch_core_alloc(listener->pool, 12);
message->type = KEEP_ALIVE_ACK_MESSAGE;
message->length = 4;
if ( listener->profile->debug >= 10 ) {
skinny_log_l_ffl(listener, file, func, line, SWITCH_LOG_DEBUG,
"Sending Keep Alive Ack\n", NULL);
}
return skinny_send_reply_quiet(listener, message);
}
switch_status_t perform_send_register_ack(listener_t *listener,
const char *file, const char *func, int line,
uint32_t keep_alive,

View File

@ -797,6 +797,10 @@ switch_status_t skinny_handle_request(listener_t *listener, skinny_message_t *re
/*****************************************************************************/
/* SKINNY MESSAGE HELPER */
/*****************************************************************************/
switch_status_t perform_send_keep_alive_ack(listener_t *listener,
const char *file, const char *func, int line);
#define send_keep_alive_ack(listener) perform_send_keep_alive_ack(listener, __FILE__, __SWITCH_FUNC__, __LINE__);
switch_status_t perform_send_register_ack(listener_t *listener,
const char *file, const char *func, int line,
uint32_t keep_alive,

View File

@ -935,11 +935,10 @@ switch_status_t skinny_handle_keep_alive_message(listener_t *listener, skinny_me
{
skinny_message_t *message;
message = switch_core_alloc(listener->pool, 12);
message->type = KEEP_ALIVE_ACK_MESSAGE;
message->length = 4;
keepalive_listener(listener, NULL);
skinny_send_reply(listener, message);
send_keep_alive_ack(listener);
return SWITCH_STATUS_SUCCESS;
}
@ -1435,8 +1434,7 @@ switch_status_t skinny_handle_speed_dial_stat_request(listener_t *listener, skin
memcpy(&message->data.speed_dial_res, button, sizeof(struct speed_dial_stat_res_message));
skinny_log_l(listener, SWITCH_LOG_DEBUG, "Handle Speed Dial Stat Request with Number (%s)\n",
request->data.speed_dial_req.number);
skinny_log_l(listener, SWITCH_LOG_DEBUG, "Handle Speed Dial Stat Request\n", NULL);
skinny_send_reply_quiet(listener, message);
return SWITCH_STATUS_SUCCESS;
@ -1857,6 +1855,9 @@ switch_status_t skinny_handle_soft_key_event_message(listener_t *listener, skinn
call_id = request->data.soft_key_event.call_id;
}
skinny_log_l(listener, SWITCH_LOG_DEBUG, "Soft Key Event (%s) with Line Instance (%d), Call ID (%d)\n",
request->data.soft_key_event.event, line_instance, call_id);
switch(request->data.soft_key_event.event) {
case SOFTKEY_REDIAL:
status = skinny_create_incoming_session(listener, &line_instance, &session);
@ -1943,7 +1944,10 @@ switch_status_t skinny_handle_unregister(listener_t *listener, skinny_message_t
message->type = UNREGISTER_ACK_MESSAGE;
message->length = 4 + sizeof(message->data.unregister_ack);
message->data.unregister_ack.unregister_status = 0; /* OK */
skinny_send_reply(listener, message);
skinny_log_l(listener, SWITCH_LOG_DEBUG, "Handle Unregister with Status (%d)\n", message->data.unregister_ack.unregister_status);
skinny_send_reply_quiet(listener, message);
/* Close socket */
switch_clear_flag_locked(listener, LFLAG_RUNNING);
@ -1976,7 +1980,9 @@ switch_status_t skinny_handle_soft_key_template_request(listener_t *listener, sk
message->data.soft_key_template.soft_key[i].soft_key_event = soft_key_template_default_events[i];
}
skinny_send_reply(listener, message);
skinny_log_l(listener, SWITCH_LOG_DEBUG, "Handle Soft Key Template Request with Default Template\n", NULL);
skinny_send_reply_quiet(listener, message);
return SWITCH_STATUS_SUCCESS;
}
@ -1997,6 +2003,9 @@ switch_status_t skinny_headset_status_message(listener_t *listener, skinny_messa
switch_safe_free(sql);
}
skinny_log_l(listener, SWITCH_LOG_DEBUG, "Update headset accessory status (%s)\n",
skinny_accessory_state2str(request->data.headset_status.mode));
return SWITCH_STATUS_SUCCESS;
}
@ -2004,6 +2013,8 @@ switch_status_t skinny_handle_register_available_lines_message(listener_t *liste
{
skinny_check_data_length(request, sizeof(request->data.reg_lines));
skinny_log_l(listener, SWITCH_LOG_DEBUG, "Handle Register Available Lines\n", NULL);
/* Do nothing */
return SWITCH_STATUS_SUCCESS;
}