[asterisk-commits] tilghman: trunk r205086 - /trunk/channels/chan_sip.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jul 7 16:10:19 CDT 2009


Author: tilghman
Date: Tue Jul  7 16:10:14 2009
New Revision: 205086

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=205086
Log:
Permit setting custom headers from the peer definition.
(closes issue #14059)
 Reported by: fnordian

Modified:
    trunk/channels/chan_sip.c

Modified: trunk/channels/chan_sip.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=205086&r1=205085&r2=205086
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Tue Jul  7 16:10:14 2009
@@ -23970,7 +23970,7 @@
 	struct sip_peer tmp_peer;
 	const char *srvlookup = NULL;
 	static int deprecation_warning = 1;
-	int alt_fullcontact = alt ? 1 : 0;
+	int alt_fullcontact = alt ? 1 : 0, headercount = 0;
 	struct ast_str *fullcontact = ast_str_alloca(512);
 
 	if (!realtime || ast_test_flag(&global_flags[1], SIP_PAGE2_RTCACHEFRIENDS)) {
@@ -24294,6 +24294,10 @@
 			}
 		} else if (!strcasecmp(v->name, "setvar")) {
 			peer->chanvars = add_var(v->value, peer->chanvars);
+		} else if (!strcasecmp(v->name, "header")) {
+			char tmp[4096];
+			snprintf(tmp, sizeof(tmp), "__SIPADDHEADERpre%2d=%s", ++headercount, v->value);
+			peer->chanvars = add_var(tmp, peer->chanvars);
 		} else if (!strcasecmp(v->name, "qualify")) {
 			if (!strcasecmp(v->value, "no")) {
 				peer->maxms = 0;




More information about the asterisk-commits mailing list