From 2060654809589ef25e17854443ec46fd7008e9fd Mon Sep 17 00:00:00 2001 From: Nathan Neulinger Date: Sun, 23 Jun 2013 16:11:54 -0500 Subject: [PATCH] skinny - add simple expansion of text strings by id in the logging msgs --- src/mod/endpoints/mod_skinny/mod_skinny.c | 38 +++++++++++++++++++ src/mod/endpoints/mod_skinny/mod_skinny.h | 3 +- .../endpoints/mod_skinny/skinny_protocol.c | 8 +++- 3 files changed, 47 insertions(+), 2 deletions(-) diff --git a/src/mod/endpoints/mod_skinny/mod_skinny.c b/src/mod/endpoints/mod_skinny/mod_skinny.c index 5071476e18..82e59420ae 100644 --- a/src/mod/endpoints/mod_skinny/mod_skinny.c +++ b/src/mod/endpoints/mod_skinny/mod_skinny.c @@ -102,6 +102,44 @@ static char active_lines_sql[] = " call_state INTEGER\n" ");\n"; +/*****************************************************************************/ +/* TEXT FUNCTIONS */ +/*****************************************************************************/ +char *skinny_expand_textid(const char *str) +{ + char *tmp; + int i; + + /* Look for \200, if found, next character indicates string id */ + char match = (char) 128; + + tmp = switch_mprintf(""); + + if (zstr(str)) { + return tmp; + } + + for (i=0; i 0 ? switch_mprintf("\200%c", label) : switch_mprintf("")) +char *skinny_expand_textid(const char *str); #endif /* _MOD_SKINNY_H */ diff --git a/src/mod/endpoints/mod_skinny/skinny_protocol.c b/src/mod/endpoints/mod_skinny/skinny_protocol.c index b475f8e687..a27bf47535 100644 --- a/src/mod/endpoints/mod_skinny/skinny_protocol.c +++ b/src/mod/endpoints/mod_skinny/skinny_protocol.c @@ -925,6 +925,8 @@ switch_status_t perform_send_display_prompt_status(listener_t *listener, uint32_t call_id) { skinny_message_t *message; + char *tmp; + message = switch_core_alloc(listener->pool, 12+sizeof(message->data.display_prompt_status)); message->type = DISPLAY_PROMPT_STATUS_MESSAGE; message->length = 4 + sizeof(message->data.display_prompt_status); @@ -933,9 +935,13 @@ switch_status_t perform_send_display_prompt_status(listener_t *listener, message->data.display_prompt_status.line_instance = line_instance; message->data.display_prompt_status.call_id = call_id; + tmp = skinny_expand_textid(display); + skinny_log_l_ffl(listener, file, func, line, SWITCH_LOG_DEBUG, "Send Display Prompt Status with Timeout (%d), Display (%s), Line Instance (%d), Call ID (%d)\n", - timeout, display, line_instance, call_id); + timeout, tmp, line_instance, call_id); + + switch_safe_free(tmp); return skinny_send_reply_quiet(listener, message); }