[svn-commits] mattf: trunk r46251 - in /trunk: channels/chan_zap.c
configs/zapata.conf.sample
svn-commits at lists.digium.com
svn-commits at lists.digium.com
Wed Oct 25 12:14:24 MST 2006
Author: mattf
Date: Wed Oct 25 14:14:23 2006
New Revision: 46251
URL: http://svn.digium.com/view/asterisk?rev=46251&view=rev
Log:
Update changes to do US style point code parsing/formatting (xxx.xxx.xxx)
Modified:
trunk/channels/chan_zap.c
trunk/configs/zapata.conf.sample
Modified: trunk/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_zap.c?rev=46251&r1=46250&r2=46251&view=diff
==============================================================================
--- trunk/channels/chan_zap.c (original)
+++ trunk/channels/chan_zap.c Wed Oct 25 14:14:23 2006
@@ -7370,6 +7370,21 @@
#endif
#ifdef HAVE_SS7
+
+static unsigned int parse_pointcode(char *pcstring)
+{
+ unsigned int code1, code2, code3;
+ int numvals;
+
+ numvals = sscanf(pcstring, "%d.%d.%d", &code1, &code2, &code3);
+ if (numvals == 1)
+ return code1;
+ if (numvals == 3)
+ return (code1 << 16) | (code2 << 8) | code3;
+
+ return 0;
+}
+
static struct zt_ss7 * ss7_resolve_linkset(int linkset)
{
if ((linkset < 0) || (linkset >= NUM_SPANS))
@@ -12073,11 +12088,11 @@
} else if (!strcasecmp(v->name, "linkset")) {
cur_linkset = atoi(v->value);
} else if (!strcasecmp(v->name, "pointcode")) {
- cur_pointcode = atoi(v->value);
+ cur_pointcode = parse_pointcode(v->value);
} else if (!strcasecmp(v->name, "adjpointcode")) {
- cur_adjpointcode = atoi(v->value);
+ cur_adjpointcode = parse_pointcode(v->value);
} else if (!strcasecmp(v->name, "defaultdpc")) {
- cur_defaultdpc = atoi(v->value);
+ cur_defaultdpc = parse_pointcode(v->value);
} else if (!strcasecmp(v->name, "cicbeginswith")) {
cur_cicbeginswith = atoi(v->value);
} else if (!strcasecmp(v->name, "networkindicator")) {
Modified: trunk/configs/zapata.conf.sample
URL: http://svn.digium.com/view/asterisk/trunk/configs/zapata.conf.sample?rev=46251&r1=46250&r2=46251&view=diff
==============================================================================
--- trunk/configs/zapata.conf.sample (original)
+++ trunk/configs/zapata.conf.sample Wed Oct 25 14:14:23 2006
@@ -666,15 +666,18 @@
; All settings apply to linkset 1
linkset = 1
-; Point code of the linkset
+; Point code of the linkset. For ITU, this is the decimal number
+; format of the point code. For ANSI, this can either be in decimal
+; number format or in the xxx.xxx.xxx format
pointcode = 1
; Point code of node adjacent to this signaling link (Possibly the STP between you and
-; your destination)
+; your destination). Point code format follows the same rules as above.
adjpointcode = 2
; Default point code that you would like to assign to outgoing messages (in case of
-; routing through STPs, or using A links)
+; routing through STPs, or using A links). Point code format follows the same rules
+; as above.
defaultdpc = 3
; Begin CIC (Circuit indication codes) count with this number
More information about the svn-commits
mailing list