]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-6897: uuid_send_info enhancement that allows setting the Content-Type of the SIP...
authorMarkus von Arx <mkvonarx@gmail.com>
Tue, 7 Oct 2014 08:59:37 +0000 (10:59 +0200)
committerMarkus von Arx <mkvonarx@gmail.com>
Tue, 7 Oct 2014 08:59:37 +0000 (10:59 +0200)
src/mod/applications/mod_commands/mod_commands.c

index ef28528dde3b833b15486cc01e1e65c5a1988a28..6fc06ea07e0f64b2637c7671477303a406990584 100644 (file)
@@ -3786,25 +3786,31 @@ SWITCH_STANDARD_API(uuid_send_message_function)
        return SWITCH_STATUS_SUCCESS;
 }
 
-#define INFO_SYNTAX "<uuid>"
+#define INFO_SYNTAX "<uuid> [<mime_type> <mime_subtype>] <message>"
 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]))) {