[asterisk-commits] mmichelson: branch group/CCSS r236801 - /team/group/CCSS/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Dec 29 15:51:37 CST 2009


Author: mmichelson
Date: Tue Dec 29 15:51:35 2009
New Revision: 236801

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=236801
Log:
Use proper request URI during a CC recall.


Modified:
    team/group/CCSS/channels/chan_sip.c

Modified: team/group/CCSS/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/channels/chan_sip.c?view=diff&rev=236801&r1=236800&r2=236801
==============================================================================
--- team/group/CCSS/channels/chan_sip.c (original)
+++ team/group/CCSS/channels/chan_sip.c Tue Dec 29 15:51:35 2009
@@ -6783,10 +6783,28 @@
 	struct varshead *headp;
 	struct ast_var_t *current;
 	const char *referer = NULL;   /* SIP referrer */
+	struct sip_monitor_instance *monitor_instance = NULL;
+	int cc_core_id;
+	char uri[SIPBUFSIZE] = "";
 
 	if ((ast->_state != AST_STATE_DOWN) && (ast->_state != AST_STATE_RESERVED)) {
 		ast_log(LOG_WARNING, "sip_call called on %s, neither down nor reserved\n", ast->name);
 		return -1;
+	}
+
+	if (ast_cc_is_recall(ast, &cc_core_id)) {
+		/* If this is a CC recall, then we have a particular
+		 * URI that we are supposed to send the INVITE to. We
+		 * get this information from the corresponding sip_monitor_instance
+		 */
+		if (!(monitor_instance = find_sip_monitor_instance(cc_core_id))) {
+			/* UM... */
+			ast_log(LOG_WARNING, "This is a recall, but we can't find an appropriate sip_monitor_instance with core ID %d.\n", cc_core_id);
+			/* We'll still try to continue with things. They just may not work as planned... */
+		} else {
+			ast_copy_string(uri, monitor_instance->notify_uri, sizeof(uri));
+			ao2_ref(monitor_instance, -1);
+		}
 	}
 
 	/* Check whether there is vxml_url, distinctive ring variables */
@@ -6848,7 +6866,7 @@
 		int xmitres;
 
 		sip_pvt_lock(p);
-		xmitres = transmit_invite(p, SIP_INVITE, 1, 2, NULL);
+		xmitres = transmit_invite(p, SIP_INVITE, 1, 2, uri);
 		sip_pvt_unlock(p);
 		if (xmitres == XMIT_ERROR)
 			return -1;




More information about the asterisk-commits mailing list