[Asterisk-Users] chan_capi-cm and type of number problem (ToN)

Armin Schindler armin at melware.de
Wed May 17 03:33:40 MST 2006


On Wed, 17 May 2006, Klaus Darilion wrote:
> Armin Schindler wrote:
> > On Tue, 16 May 2006, Klaus Darilion wrote:
> > > Hi!
> > > 
> > > I have problems with the ToN configurations in chan_capi-cm. I
> > > understand how
> > > incoming calls are rewritten using national and international prefix.
> > > But for
> > > outgoing calls - what is the ToN?
> > 
> > I never really needed ton in TE mode, but when your card is in NT mode,
> > setting the ton may be important.
> > 
> > > Further, is there any debug info of the Ton? "capi debug" and the
> > > divactrl
> > > dchannel both show the CLI and CDLI, but do not show the ToN.
> > 
> > The ton is a byte prepended to the callerid and can be seen when looking
> > at the capi messages. On outgoing call when 'capi debug' is set, the
> > presentation and ton value is shown as well.
> 
> Hi Armin!
> 
> I think the capi debug is too verbose. When I debug, I'm mostly interested in
> D-channel info, not B-channel. What do you think about splitting this into
> "capi debug dchannel" and
> "capi debug"

on 'capi debug' you see messages for your set verbose level only.
With 'set verbose 5' you see the 'dchannel' stuff, with 'set verbose 9'
you see everything.
 
> > > How can I set the ToN? I suspect chan_capi to use the received ToN
> > > also for
> > > outgoing calls when bridging calls. How can I verify this?
> > 
> > When using a newer Asterisk with cid_ton (I think 1.2.x has them), then
> > chan-capi will set ton on incoming call and on outgoing call, this value
> > is used as well. So it is bridged.
> 
> This is IMO a strange thing, combined with the default behavior of national
> and internationalprefix.
> 
> e.g. a call is received with CLI=4912345 TON=international
> default internationalprefix=00

Yes, but that can be changed in capi.conf.
 
> Thus, chan_capi rewrites the number to 004912345, cid_ton is still
> international.
> 
> When this call is bridged to the PBX, it sends CLI=004912345 TON=international
> 
> Thus, if the number is rewritten, IMO also the context should be rewritten to
> UNKNOWN.

The user has two possibilities:
a) use the chan-capi feature of automatically prepend the prefixes according to TON
b) don't use automatic prefix setting in capi.conf and do your own stuff 
   according to CALLERTON in your dialplan

both should not be mixed, because (as you stated above) will cause double 
changes. a) is for standard usage (one ISDN port, no NT-mode), b) is the 
professional version.
 
> > Since Asterisk does not provide (as far as I know) a possibility to
> > change that cid_ton value, chan-capi will overwrite that value with the
> > value in
> > variable ${CALLERTON}, if set.
> 
> As I see this must be a number. Using strings (INTERNATIONAL, LOCAL, NATIONAL)
> would be nice too.

Hmm, you can device variables with that in your dialplan. Or Asterisk 
provides them...
 
> Not sure if I understand the source code right: CALLERTON will be read to set
> callers TON on outgoing calls, whereas CALLEDTON will be set on incoming
> called TON? Why not set both variables in incoming calls and read both
> variables on outgoing calls?

CALLEDTON is set by chan-capi for the TON of the called number, not the 
caller id! Normaly you don't need that TON and Asterisk doesn't provide
any feature for that.

The CALLERTON is the widely used TON and it is set to asterisks cid_ton 
internal variable, which can be read via ${CALLERTON}. But since Asterisk 
does not set cid_ton when writing to CALLERTON, chan-capi evaluates this
variable by itself (when set).

Armin
 
> regards
> Klaus
> 
> > When you use the latest chan-capi from trunk (HEAD version), you can use
> > 'capi show channels' to see the ton as well.
> > 
> > Armin
> > 
> > _______________________________________________
> > --Bandwidth and Colocation provided by Easynews.com --
> > 
> > Asterisk-Users mailing list
> > To UNSUBSCRIBE or update options visit:
> > http://lists.digium.com/mailman/listinfo/asterisk-users
> 
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
> 
> Asterisk-Users mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
> 



More information about the asterisk-users mailing list