[asterisk-commits] oej: branch 10 r336502 - in /branches/10: ./ Makefile channels/chan_sip.c

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


Author: oej
Date: Mon Sep 19 08:38:53 2011
New Revision: 336502

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=336502
Log:
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:
    branches/10/   (props changed)
    branches/10/Makefile
    branches/10/channels/chan_sip.c

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

Modified: branches/10/Makefile
URL: http://svnview.digium.com/svn/asterisk/branches/10/Makefile?view=diff&rev=336502&r1=336501&r2=336502
==============================================================================
--- branches/10/Makefile (original)
+++ branches/10/Makefile Mon Sep 19 08:38:53 2011
@@ -286,7 +286,7 @@
 ifneq ($(findstring darwin,$(OSARCH)),)
   _ASTCFLAGS+=-D__Darwin__
   SOLINK=-bundle -Xlinker -macosx_version_min -Xlinker 10.4 -Xlinker -undefined -Xlinker dynamic_lookup -force_flat_namespace
-  ifeq ($(shell /usr/bin/sw_vers -productVersion | cut -c1-4),10.6)
+  ifeq ($(shell /usr/bin/sw_vers -productVersion | cut -c1-4),10.7)
     SOLINK+=/usr/lib/bundle1.o
   endif
   _ASTLDFLAGS+=-L/usr/local/lib

Modified: branches/10/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/channels/chan_sip.c?view=diff&rev=336502&r1=336501&r2=336502
==============================================================================
--- branches/10/channels/chan_sip.c (original)
+++ branches/10/channels/chan_sip.c Mon Sep 19 08:38:53 2011
@@ -1339,6 +1339,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);
@@ -10361,6 +10362,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