diff --git a/src/mod/endpoints/mod_skinny/mod_skinny.c b/src/mod/endpoints/mod_skinny/mod_skinny.c index 6cd46fc49a..bc35c9b70a 100644 --- a/src/mod/endpoints/mod_skinny/mod_skinny.c +++ b/src/mod/endpoints/mod_skinny/mod_skinny.c @@ -105,7 +105,7 @@ static char active_lines_sql[] = /*****************************************************************************/ /* TEXT FUNCTIONS */ /*****************************************************************************/ -char *skinny_expand_textid(const char *str) +char *skinny_format_message(const char *str) { char *tmp; switch_size_t i; @@ -131,6 +131,9 @@ char *skinny_expand_textid(const char *str) } switch_safe_free(old); i++; + } else if ( !switch_isprint(str[i]) ) { + tmp = switch_mprintf("%s\\x%.2X", old, str[i]); + switch_safe_free(old); } else { tmp = switch_mprintf("%s%c", old, str[i]); switch_safe_free(old); diff --git a/src/mod/endpoints/mod_skinny/mod_skinny.h b/src/mod/endpoints/mod_skinny/mod_skinny.h index 60616020cf..91598f56bb 100644 --- a/src/mod/endpoints/mod_skinny/mod_skinny.h +++ b/src/mod/endpoints/mod_skinny/mod_skinny.h @@ -333,7 +333,7 @@ switch_endpoint_interface_t *skinny_get_endpoint_interface(); /* TEXT FUNCTIONS */ /*****************************************************************************/ #define skinny_textid2raw(label) (label > 0 ? switch_mprintf("\200%c", label) : switch_mprintf("")) -char *skinny_expand_textid(const char *str); +char *skinny_format_message(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 d33d3369f2..9a032599a6 100644 --- a/src/mod/endpoints/mod_skinny/skinny_protocol.c +++ b/src/mod/endpoints/mod_skinny/skinny_protocol.c @@ -1018,7 +1018,7 @@ 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); + tmp = skinny_format_message(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", @@ -1140,6 +1140,7 @@ switch_status_t perform_send_display_pri_notify(listener_t *listener, char *notify) { skinny_message_t *message; + char *tmp; skinny_create_message(message, DISPLAY_PRI_NOTIFY_MESSAGE, display_pri_notify); @@ -1147,9 +1148,13 @@ switch_status_t perform_send_display_pri_notify(listener_t *listener, message->data.display_pri_notify.priority = priority; strncpy(message->data.display_pri_notify.notify, notify, 32); + tmp = skinny_format_message(notify); + skinny_log_l_ffl(listener, file, func, line, SWITCH_LOG_DEBUG, "Send Display Pri Notify with Timeout (%d), Priority (%d), Message (%s)\n", - message_timeout, priority, notify); + message_timeout, priority, tmp); + + switch_safe_free(tmp); return skinny_send_reply_quiet(listener, message, SWITCH_TRUE); }