[asterisk-commits] oej: branch oej/calleridutf8 r89558 - in /team/oej/calleridutf8: channels/ fu...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Nov 25 06:27:35 CST 2007


Author: oej
Date: Sun Nov 25 06:27:35 2007
New Revision: 89558

URL: http://svn.digium.com/view/asterisk?view=rev&rev=89558
Log:
Implement domain in CALLERID() function

Modified:
    team/oej/calleridutf8/channels/chan_sip.c
    team/oej/calleridutf8/funcs/func_callerid.c

Modified: team/oej/calleridutf8/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/calleridutf8/channels/chan_sip.c?view=diff&rev=89558&r1=89557&r2=89558
==============================================================================
--- team/oej/calleridutf8/channels/chan_sip.c (original)
+++ team/oej/calleridutf8/channels/chan_sip.c Sun Nov 25 06:27:35 2007
@@ -1017,7 +1017,7 @@
 		AST_STRING_FIELD(peersecret);	/*!< Password */
 		AST_STRING_FIELD(peermd5secret);
 		AST_STRING_FIELD(cid_num);	/*!< Caller*ID number */
-		AST_STRING_FIELD(cid_name);	/*!< Caller*ID name */
+		AST_STRING_FIELD(cid_name);	/*!< Caller*ID name (utf8) */
 		AST_STRING_FIELD(via);		/*!< Via: header */
 		AST_STRING_FIELD(fullcontact);	/*!< The Contact: that the UA registers with us */
 			/* we only store the part in <brackets> in this field. */
@@ -4657,8 +4657,10 @@
 	tmp->priority = 1;
 	if (!ast_strlen_zero(i->uri))
 		pbx_builtin_setvar_helper(tmp, "SIPURI", i->uri);
-	if (!ast_strlen_zero(i->domain))
-		pbx_builtin_setvar_helper(tmp, "SIPDOMAIN", i->domain);
+	if (!ast_strlen_zero(i->domain)) {
+		pbx_builtin_setvar_helper(tmp, "SIPDOMAIN", i->domain);	/* This will be deprecated */
+		tmp->cid.cid_domain = ast_strdup(i->domain);
+	}
 	if (!ast_strlen_zero(i->callid))
 		pbx_builtin_setvar_helper(tmp, "SIPCALLID", i->callid);
 	if (i->rtp)

Modified: team/oej/calleridutf8/funcs/func_callerid.c
URL: http://svn.digium.com/view/asterisk/team/oej/calleridutf8/funcs/func_callerid.c?view=diff&rev=89558&r1=89557&r2=89558
==============================================================================
--- team/oej/calleridutf8/funcs/func_callerid.c (original)
+++ team/oej/calleridutf8/funcs/func_callerid.c Sun Nov 25 06:27:35 2007
@@ -89,6 +89,10 @@
 				snprintf(buf, len, "%d", chan->cid.cid_ani2);
 			} else if (chan->cid.cid_ani) {
 				ast_copy_string(buf, chan->cid.cid_ani, len);
+			}
+		} else if (!strncasecmp("domain", data, 4)) {
+			if (chan->cid.cid_domain) {
+				ast_copy_string(buf, chan->cid.cid_domain, len);
 			}
 		} else if (!strncasecmp("dnid", data, 4)) {
 			if (chan->cid.cid_dnid) {
@@ -183,7 +187,7 @@
 	.syntax = "CALLERID(datatype[,<optional-CID>])",
 	.desc =
 		"Gets or sets Caller*ID data on the channel.  The allowable datatypes\n"
-		"are \"all\", \"name\", \"num\", \"ANI\", \"DNID\", \"RDNIS\", \"pres\",\n"
+		"are \"all\", \"domain\", \"name\", \"num\", \"ANI\", \"DNID\", \"RDNIS\", \"pres\",\n"
 		"and \"ton\".\n"
 		"Uses channel callerid by default or optional callerid, if specified.\n",
 	.read = callerid_read,




More information about the asterisk-commits mailing list