[asterisk-commits] oej: branch oej/peer-chanvars r111609 - /team/oej/peer-chanvars/channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Mar 28 09:52:29 CDT 2008


Author: oej
Date: Fri Mar 28 09:52:28 2008
New Revision: 111609

URL: http://svn.digium.com/view/asterisk?view=rev&rev=111609
Log:
Adding chanvar to SIPPEER() function. Not tested yet...

Modified:
    team/oej/peer-chanvars/channels/chan_sip.c

Modified: team/oej/peer-chanvars/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/peer-chanvars/channels/chan_sip.c?view=diff&rev=111609&r1=111608&r2=111609
==============================================================================
--- team/oej/peer-chanvars/channels/chan_sip.c (original)
+++ team/oej/peer-chanvars/channels/chan_sip.c Fri Mar 28 09:52:28 2008
@@ -11834,6 +11834,14 @@
 		ast_copy_string(buf, peer->cid_num, len);
 	} else  if (!strcasecmp(colname, "codecs")) {
 		ast_getformatname_multiple(buf, len -1, peer->capability);
+	} else  if (!strncasecmp(colname, "chanvar[", 8)) {
+		char *chanvar=colname + 8;
+		struct ast_variable *v;
+	
+		chanvar = strsep(&chanvar, "]");
+		for (v = peer->chanvars ; v ; v = v->next)
+			if (strcasecmp(v->name, chanvar) == 0)
+				ast_copy_string(buf, v->value, sizeof(buf));
 	} else  if (!strncasecmp(colname, "codec[", 6)) {
 		char *codecnum;
 		int index = 0, codec = 0;
@@ -11874,6 +11882,7 @@
 	"- language              Default language for peer\n"
 	"- accountcode           Account code for this peer\n"
 	"- useragent             Current user agent id for peer\n"
+	"- chanvar[name]         A channel variable configured with setvar for this peer.\n"
 	"- codec[x]              Preferred codec index number 'x' (beginning with zero).\n"
 	"\n"
 };




More information about the asterisk-commits mailing list