diff --git a/src/mod/endpoints/mod_skinny/skinny_protocol.c b/src/mod/endpoints/mod_skinny/skinny_protocol.c index 189a15c2f1..7de43a7aa1 100644 --- a/src/mod/endpoints/mod_skinny/skinny_protocol.c +++ b/src/mod/endpoints/mod_skinny/skinny_protocol.c @@ -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, diff --git a/src/mod/endpoints/mod_skinny/skinny_protocol.h b/src/mod/endpoints/mod_skinny/skinny_protocol.h index 25c82ba12d..8e4b2074ec 100644 --- a/src/mod/endpoints/mod_skinny/skinny_protocol.h +++ b/src/mod/endpoints/mod_skinny/skinny_protocol.h @@ -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, diff --git a/src/mod/endpoints/mod_skinny/skinny_server.c b/src/mod/endpoints/mod_skinny/skinny_server.c index 93e2f92866..b3a4f5683d 100644 --- a/src/mod/endpoints/mod_skinny/skinny_server.c +++ b/src/mod/endpoints/mod_skinny/skinny_server.c @@ -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; @@ -1856,6 +1854,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); @@ -1942,7 +1943,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); @@ -1975,7 +1979,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; } @@ -1996,6 +2002,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; } @@ -2003,6 +2012,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; }