summaryrefslogtreecommitdiffstats
path: root/sys/i4b/layer3
diff options
context:
space:
mode:
authorhm <hm@FreeBSD.org>2002-08-12 07:53:55 +0000
committerhm <hm@FreeBSD.org>2002-08-12 07:53:55 +0000
commitbab2f90e8c83b6eb980a9fae5c06507af7c9aca5 (patch)
tree8e32105516b9c65156f2a1e551c1f5c865e99a5a /sys/i4b/layer3
parentbcb47193d3fd4d73dadf171a0537fa2e37fe348f (diff)
downloadFreeBSD-src-bab2f90e8c83b6eb980a9fae5c06507af7c9aca5.zip
FreeBSD-src-bab2f90e8c83b6eb980a9fae5c06507af7c9aca5.tar.gz
add support properly displaying and logging incoming telephone numbers (MSNs)
by looking at the "type of number" field and providing configurable hooks to correct the numbers accordingly. See keywords add-prefix, prefix-national and prefix-international in isdnd.rc(5). This feature was implemented by Christian Ullrich <chris@chrullrich.de>
Diffstat (limited to 'sys/i4b/layer3')
-rw-r--r--sys/i4b/layer3/i4b_q931.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/sys/i4b/layer3/i4b_q931.c b/sys/i4b/layer3/i4b_q931.c
index 52c5b87..a3647aa 100644
--- a/sys/i4b/layer3/i4b_q931.c
+++ b/sys/i4b/layer3/i4b_q931.c
@@ -29,7 +29,7 @@
*
* $FreeBSD$
*
- * last edit-date: [Sat Mar 9 19:36:45 2002]
+ * last edit-date: [Sun Aug 11 19:18:08 2002]
*
*---------------------------------------------------------------------------*/
@@ -427,6 +427,20 @@ i4b_decode_q931_cs0_ie(int unit, call_desc_t *cd, int msg_len, u_char *msg_ptr)
cd->scr_ind = (msg_ptr[3] & 0x03) + SCR_USR_NOSC;
cd->prs_ind = ((msg_ptr[3] >> 5) & 0x03) + PRS_ALLOWED;
}
+
+ /* type of number (source) */
+ switch ((msg_ptr[2] & 0x70) >> 4)
+ {
+ case 1:
+ cd->src_ton = TON_INTERNAT;
+ break;
+ case 2:
+ cd->src_ton = TON_NATIONAL;
+ break;
+ default:
+ cd->src_ton = TON_OTHER;
+ break;
+ }
NDBGL3(L3_P_MSG, "IEI_CALLINGPN = %s", cd->src_telno);
break;
@@ -439,6 +453,21 @@ i4b_decode_q931_cs0_ie(int unit, call_desc_t *cd, int msg_len, u_char *msg_ptr)
case IEI_CALLEDPN: /* called party number */
memcpy(cd->dst_telno, &msg_ptr[3], min(TELNO_MAX, msg_ptr[1]-1));
cd->dst_telno[min(TELNO_MAX, msg_ptr[1] - 1)] = '\0';
+
+ /* type of number (destination) */
+ switch ((msg_ptr[2] & 0x70) >> 4)
+ {
+ case 1:
+ cd->dst_ton = TON_INTERNAT;
+ break;
+ case 2:
+ cd->dst_ton = TON_NATIONAL;
+ break;
+ default:
+ cd->dst_ton = TON_OTHER;
+ break;
+ }
+
NDBGL3(L3_P_MSG, "IEI_CALLED = %s", cd->dst_telno);
break;
OpenPOWER on IntegriCloud