]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix another regression from 27c6d1111c8eb9929cedf707632b33405019e03a this probably...
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 4 Apr 2011 22:43:05 +0000 (17:43 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 4 Apr 2011 22:43:05 +0000 (17:43 -0500)
src/switch_channel.c

index 6830bd0bc6281f8ecf531e3dfdb8c3e1ee5ec13d..bc8daabbc6543207fd0c616f35cd94d08c7cb80d 100644 (file)
@@ -2771,17 +2771,27 @@ SWITCH_DECLARE(switch_status_t) switch_channel_execute_on(switch_channel_t *chan
                        
                if (!strncasecmp(var, variable_prefix, strlen(variable_prefix))) {
                        char *arg = NULL;
+                       char *p;
+                       int bg = 0;
                        x++;
 
                        app = switch_core_session_strdup(channel->session, val);
-                               
-                       if (strstr(app, "::")) {
+
+                       for(p = app; p && *p; p++) {
+                               if (*p == ' ') {
+                                       *p++ = '\0';
+                                       arg = p;
+                                       break;
+                               } else if (*p == ':' && (*(p+1) == ':')) {
+                                       bg++;
+                                       break;
+                               }
+                       }
+
+                       
+                       if (bg) {
                                switch_core_session_execute_application_async(channel->session, app, arg);
                        } else {
-                               if ((arg = strchr(app, ' '))) {
-                                       *arg++ = '\0';
-                               }
-                               
                                switch_core_session_execute_application(channel->session, app, arg);
                        }
                }