summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorMatthew Fredrickson <creslin@digium.com>2006-10-25 19:14:23 +0000
committerMatthew Fredrickson <creslin@digium.com>2006-10-25 19:14:23 +0000
commit67926b9ac439e1d0a0701c80af065e095f9fd46e (patch)
treec0f8879954ef7b122b4aba37ed6eb05bb51cf01c /channels
parent414f448b09820beb290def5c63a1d6f19c497ccc (diff)
Update changes to do US style point code parsing/formatting (xxx.xxx.xxx)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46251 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_zap.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index 012a2f551..e64c8bb5d 100644
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -7370,6 +7370,21 @@ static int pri_create_spanmap(int span, int trunkgroup, int logicalspan)
#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 @@ static int process_zap(struct ast_variable *v, int reload, int skipchannels)
} 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")) {