[Freeswitch-svn] [commit] r5736 - freeswitch/trunk/src/mod/endpoints/mod_sofia

Freeswitch SVN silik0n at freeswitch.org
Fri Sep 21 12:27:41 EDT 2007


Author: silik0n
Date: Fri Sep 21 12:27:41 2007
New Revision: 5736

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c

Log:
Add Support for http://tools.ietf.org/id/draft-levy-sip-diversion-08.txt never rolled into an RFC but people use it anyway


Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	Fri Sep 21 12:27:41 2007
@@ -1994,6 +1994,16 @@
 				}
 			} else if (!strncasecmp(un->un_name, "Remote-Party-ID", 15)) {
 				process_rpid(un, tech_pvt);
+			} else if (!strncasecmp(un->un_name, "Diversion", 9)) {
+				// Basic Diversion Support for Diversion Indication in SIP
+				// draft-levy-sip-diversion-08
+				if (!switch_strlen_zero(un->un_value)) {
+					char *tmp_name;
+					if ((tmp_name = switch_mprintf("%s%s", SOFIA_SIP_HEADER_PREFIX, un->un_name))) {
+						switch_channel_set_variable(channel, tmp_name, un->un_value);
+						free(tmp_name);
+					}
+				}
 			} else if (!strncasecmp(un->un_name, "X-", 2) || !strncasecmp(un->un_name, "P-", 2)) {
 				if (!switch_strlen_zero(un->un_value)) {
 					char *new_name;



More information about the Freeswitch-svn mailing list