From: Michael Jerris Date: Mon, 13 Jul 2009 15:50:05 +0000 (+0000) Subject: add sip_auto_answer_detected var set when we get intercom request on inbound invite. X-Git-Tag: v1.0.4~181 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85b2d07f683129ab06e73631f2a27a2e10905cae;p=thirdparty%2Ffreeswitch.git add sip_auto_answer_detected var set when we get intercom request on inbound invite. git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@14220 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 376d5271ef..2a3cdf033c 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -4781,6 +4781,9 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_ } else { destination_number = sip->sip_request->rq_url->url_user; } + if (sip->sip_request->rq_url->url_params && (sofia_glue_find_parameter(sip->sip_request->rq_url->url_params, "intercom=true"))) { + switch_channel_set_variable(channel, "sip_auto_answer_detected", "true"); + } } if (!destination_number && sip->sip_to && sip->sip_to->a_url) { @@ -4983,6 +4986,9 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_ if ((call_info = sip_call_info(sip))) { char *tmp = sip_header_as_string(profile->home, (void *) call_info); + if (call_info->ci_params && (msg_params_find(call_info->ci_params , "answer-after=0"))) { + switch_channel_set_variable(channel, "sip_auto_answer_detected", "true"); + } switch_channel_set_variable(channel, "sip_call_info", tmp); su_free(profile->home, tmp); }