Summary:ASTERISK-02087: [post-1.0] [patch] Allow Caller TON to be retrieved in the dialplan
Reporter:Tilghman Lesher (tilghman)Labels:
Date Opened:2004-07-22 13:52:32Date Closed:2008-01-15 15:03:57.000-0600
Versions:Frequency of
Environment:Attachments:( 0) 20040722__callerton.diff.txt
Description:Caller TON (type of number) should provide the necessary information to know if the incoming callerid on a PRI is NANPA, International, or other.


Useful for distinguishing callerid of 5252345678 between
525-234-5678 (Wisconsin) and +52 5-234-5678 (Mexico).
Comments:By: Olle Johansson (oej) 2004-07-22 15:01:40

I might be missing something, but how do you retrieve this value in the dial plan?

By: Olle Johansson (oej) 2004-07-22 15:05:51

Sorry, new variable ${CALLERTON} :-)

From Cisco.com they list the following types, how are they represented in this solution?
# National—refer to ITU-T Recommendation I.330
# International—refer to ITU-T Recommendation I.330
# Subscriber (local)—refer to ITU-T Recommendation I.330
# Network specific—an administrative or service number that is specific to the serving network (for example, a number used to access an operator)
# Unknown—the user or the network has no knowledge of the type of number.

By: Tilghman Lesher (tilghman) 2004-07-22 17:16:23

The return values are all defined in libpri:

libpri/libpri.h:#define PRI_TON_UNKNOWN         0x0
libpri/libpri.h:#define PRI_TON_INTERNATIONAL   0x1
libpri/libpri.h:#define PRI_TON_NATIONAL        0x2
libpri/libpri.h:#define PRI_TON_NET_SPECIFIC    0x3
libpri/libpri.h:#define PRI_TON_SUBSCRIBER      0x4
libpri/libpri.h:#define PRI_TON_ABBREVIATED     0x6
libpri/libpri.h:#define PRI_TON_RESERVED        0x7
libpri/q931.c:  { PRI_TON_UNKNOWN, "Unknown Number Type" },
libpri/q931.c:  { PRI_TON_INTERNATIONAL, "International Number" },
libpri/q931.c:  { PRI_TON_NATIONAL, "National Number" },
libpri/q931.c:  { PRI_TON_NET_SPECIFIC, "Network Specific Number" },
libpri/q931.c:  { PRI_TON_SUBSCRIBER, "Subscriber Number" },
libpri/q931.c:  { PRI_TON_ABBREVIATED, "Abbreviated number" },
libpri/q931.c:  { PRI_TON_RESERVED, "Reserved Number" },

By: Olle Johansson (oej) 2004-07-23 17:26:11

Related to bug ASTERISK-1716

By: Tilghman Lesher (tilghman) 2004-07-28 17:21:37

Patch definitely doesn't work.  I'll probably need the help of someone more intimately familiar with PRI to understand what's wrong.  Perhaps I'm looking at the wrong field?

By: Malcolm Davenport (mdavenport) 2004-07-30 14:36:07

Added to CVS.  Thank you.

By: Malcolm Davenport (mdavenport) 2004-07-30 15:07:01

scratch that...

By: mostart (mostart) 2004-08-02 06:52:10

just added one line to pbx.c for me it works now..

edited on: 08-02-04 06:37

By: mostart (mostart) 2004-08-02 07:06:47

Sorry, I don't really know how to build a proper diff file for this project, but I guess you'll find my addition anyway. Maybe one could give me the diff syntax for the proper patch file.

By: Mark Spencer (markster) 2004-08-02 09:26:33

Either this has to be done without changing the channel structure or it will have to wait until post 1.0

By: mostart (mostart) 2004-08-02 09:40:47

It would be very nice to also make PRI_NPI available

By: Tilghman Lesher (tilghman) 2004-08-02 10:51:29

Patch confirmed.  Amazing I missed that one line.

Mark, yes, I agree, let's wait until post-1.0.

By: Mark Spencer (markster) 2004-10-01 21:03:59


By: Russell Bryant (russell) 2004-10-01 23:18:36

not included in the 1.0 branch - feature

By: Digium Subversion (svnbot) 2008-01-15 15:03:57.000-0600

Repository: asterisk
Revision: 3541

U   trunk/channels/Makefile
U   trunk/channels/chan_zap.c
U   trunk/include/asterisk/channel.h
U   trunk/pbx.c

r3541 | malcolmd | 2008-01-15 15:03:57 -0600 (Tue, 15 Jan 2008) | 2 lines

chan_h323 Makefile change for Bug ASTERISK-2036.  Also back out changes for Bug ASTERISK-2087..next time read carefully. :)