[asterisk-commits] oej: trunk r336505 - in /trunk: ./ channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Sep 19 08:57:27 CDT 2011


Author: oej
Date: Mon Sep 19 08:57:26 2011
New Revision: 336505

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=336505
Log:
Merged revisions 336502 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r336502 | oej | 2011-09-19 15:38:53 +0200 (Mån, 19 Sep 2011) | 12 lines
  
  Merged revisions 336501 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r336501 | oej | 2011-09-19 15:33:50 +0200 (Mån, 19 Sep 2011) | 5 lines
    
    Add diversion header to a 302 redirect response if we have diversion data 
    
    (closes issue ASTERISK-18143)
    	patch by oej
  ........
................

Modified:
    trunk/   (props changed)
    trunk/channels/chan_sip.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-10-merged' - no diff available.

Modified: trunk/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=336505&r1=336504&r2=336505
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Mon Sep 19 08:57:26 2011
@@ -1342,6 +1342,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);
@@ -10371,6 +10372,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