[asterisk-commits] oej: branch oej/lvm-diversion-302-1.8 r328416 - /team/oej/lvm-diversion-302-1...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jul 15 04:34:46 CDT 2011


Author: oej
Date: Fri Jul 15 04:34:41 2011
New Revision: 328416

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=328416
Log:
Add diversion header to 302 responses when using the transfer() dialplan application.
--Denna och nedanstående rader kommer inte med i loggmeddelandet--

M    channels/chan_sip.c

Modified:
    team/oej/lvm-diversion-302-1.8/channels/chan_sip.c

Modified: team/oej/lvm-diversion-302-1.8/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/lvm-diversion-302-1.8/channels/chan_sip.c?view=diff&rev=328416&r1=328415&r2=328416
==============================================================================
--- team/oej/lvm-diversion-302-1.8/channels/chan_sip.c (original)
+++ team/oej/lvm-diversion-302-1.8/channels/chan_sip.c Fri Jul 15 04:34:41 2011
@@ -1321,6 +1321,7 @@
 /*--- Misc functions */
 static void check_rtp_timeout(struct sip_pvt *dialog, time_t t);
 static int reload_config(enum channelreloadreason reason);
+static void add_diversion_header(struct sip_request *req, struct sip_pvt *pvt);
 static int expire_register(const void *data);
 static void *do_monitor(void *data);
 static int restart_monitor(void);
@@ -10125,6 +10126,11 @@
 	}
 	if (ast_test_flag(&p->flags[0], SIP_OFFER_CC)) {
 		add_cc_call_info_to_response(p, &resp);
+	}
+
+	/* If we are sending a 302 Redirect we can add a diversion header if the redirect information is set */
+	if ((!strncmp(msg, "302", 3) {
+		add_diversion_header(&resp, p);
 	}
 
 	/* If we are cancelling an incoming invite for some reason, add information




More information about the asterisk-commits mailing list