From eaaf9468df366429c56366618df9e9be8457ea52 Mon Sep 17 00:00:00 2001 From: Markus von Arx Date: Tue, 7 Oct 2014 10:59:37 +0200 Subject: [PATCH] FS-6897: uuid_send_info enhancement that allows setting the Content-Type of the SIP INFO message --- src/mod/applications/mod_commands/mod_commands.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/mod/applications/mod_commands/mod_commands.c b/src/mod/applications/mod_commands/mod_commands.c index ef28528dde..6fc06ea07e 100644 --- a/src/mod/applications/mod_commands/mod_commands.c +++ b/src/mod/applications/mod_commands/mod_commands.c @@ -3786,25 +3786,31 @@ SWITCH_STANDARD_API(uuid_send_message_function) return SWITCH_STATUS_SUCCESS; } -#define INFO_SYNTAX "" +#define INFO_SYNTAX " [ ] " SWITCH_STANDARD_API(uuid_send_info_function) { switch_status_t status = SWITCH_STATUS_FALSE; - char *mycmd = NULL, *argv[2] = { 0 }; + char *mycmd = NULL, *argv[4] = { 0 }; int argc = 0; if (!zstr(cmd) && (mycmd = strdup(cmd))) { argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0]))); } - if (argc < 1) { + if (argc < 1 || argc == 3) { stream->write_function(stream, "-USAGE: %s\n", INFO_SYNTAX); } else { switch_core_session_message_t msg = { 0 }; switch_core_session_t *lsession = NULL; msg.message_id = SWITCH_MESSAGE_INDICATE_INFO; - msg.string_array_arg[2] = argv[1]; + if (argc > 3) { + msg.string_array_arg[0] = argv[1]; + msg.string_array_arg[1] = argv[2]; + msg.string_array_arg[2] = argv[3]; + } else { + msg.string_array_arg[2] = argv[1]; + } msg.from = __FILE__; if ((lsession = switch_core_session_locate(argv[0]))) {