Revision
14220
Author
mikej
Date
2009-07-13 10:50:05 -0500 (Mon, 13 Jul 2009)

Log Message

add sip_auto_answer_detected var set when we get intercom request on inbound invite.

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (14219 => 14220)


--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	2009-07-13 14:31:24 UTC (rev 14219)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	2009-07-13 15:50:05 UTC (rev 14220)
@@ -4781,6 +4781,9 @@
 		} 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 @@
 
 	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);
 	}