From: Anthony Minessale Date: Mon, 28 Feb 2011 18:43:05 +0000 (-0600) Subject: add sip_execute_on_image variable similar to execute_on_answer etc so you can run... X-Git-Tag: v1.2-rc1~181^2~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53fc3f7f78355e4ba574468fc5f351848273b6ae;p=thirdparty%2Ffreeswitch.git add sip_execute_on_image variable similar to execute_on_answer etc so you can run t38_gateway or rxfax etc when you get a T.38 re-invite but no CNG tone or you want to ignore the tone and only react when getting a T.38 re-invite --- diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index ac4196adfc..76feba856e 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -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; }