]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add sip_execute_on_image variable similar to execute_on_answer etc so you can run...
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 28 Feb 2011 18:43:05 +0000 (12:43 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 28 Feb 2011 18:43:05 +0000 (12:43 -0600)
src/mod/endpoints/mod_sofia/sofia_glue.c

index ac4196adfc780dccd22ce72708aeb366ef2f1ce0..76feba856ee8d922871533444883c5d1ffe146f4 100644 (file)
@@ -3820,6 +3820,7 @@ static switch_t38_options_t *tech_process_udptl(private_object_t *tech_pvt, sdp_
 {
        switch_t38_options_t *t38_options = switch_channel_get_private(tech_pvt->channel, "t38_options");
        sdp_attribute_t *attr;
+       const char *var;
 
        if (!t38_options) {
                t38_options = switch_core_session_alloc(tech_pvt->session, sizeof(switch_t38_options_t));
@@ -3899,6 +3900,21 @@ static switch_t38_options_t *tech_process_udptl(private_object_t *tech_pvt, sdp_
        switch_channel_set_private(tech_pvt->channel, "t38_options", t38_options);
        switch_channel_set_app_flag_key("T38", tech_pvt->channel, CF_APP_T38);
 
+       if ((var = switch_channel_get_variable(tech_pvt->channel, "sip_execute_on_image"))) {
+               char *app, *arg = NULL;
+               app = switch_core_session_strdup(tech_pvt->session, var);
+               
+               if (strstr(app, "::")) {
+                       switch_core_session_execute_application_async(tech_pvt->session, app, arg);
+               } else {
+                       if ((arg = strchr(app, ' '))) {
+                               *arg++ = '\0';
+                       }
+                       
+                       switch_core_session_execute_application(tech_pvt->session, app, arg);
+               }               
+       }
+
        return t38_options;
 }