]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
skinny logging
authorNathan Neulinger <nneul@neulinger.org>
Sun, 23 Jun 2013 19:58:25 +0000 (14:58 -0500)
committerNathan Neulinger <nneul@neulinger.org>
Sun, 23 Jun 2013 19:58:25 +0000 (14:58 -0500)
src/mod/endpoints/mod_skinny/skinny_protocol.c
src/mod/endpoints/mod_skinny/skinny_protocol.h
src/mod/endpoints/mod_skinny/skinny_server.c

index 189a15c2f1b93c95813b265527e1cb79ca01b77e..7de43a7aa156b191d6f48949ab991a784b5b1e88 100644 (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,
index 25c82ba12d9177ae183f1f3e703a1c8db549c17b..8e4b2074ec4715b180b27c78432a8b0bfe7bd7e3 100644 (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,
index bd0667e9a2af8e9ea4193fea9a80f5a780988411..fed0ac86b9ecc4537d3daeb9407b8a595663f814 100644 (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;
 }