In asterisk 1.4 number of channel was specified in chan->name. e.g. number 62:
asterisk 1.4 ZAPTEL: Zap/62-1
How to get actual number of channel in asterisk 13 in c-language? e.g. in chan->name this number of span only.
asterisk 13 DAHDI: DAHDI/I2/102-1
Here is what R.Mudget say about extentons.conf:
You can use the AMI action DAHDIShowChannels to get the current channel mapping. There is an AMI event that you can look for: Event: DAHDIChannel Channel: name Uniqueid: id DAHDISpan: 5 DAHDIChannel: 23 It is generated whenever a call is assigned to a B channel or a call moves to a different B channel. There is also the CHANNEL() dialplan function: CHANNEL(dahdi_channel) CHANNEL(dahdi_span) CHANNEL(dahdi_type) The DAHDIChannel event and CHANNEL() function are mentioned in the UPGRADE.txt file. Richard
But how do I get an actual number of channel in c-language API?
Simplest way answer this question is read source code(writed in c/c++) of chan_dahdi and see how dahdi_channel variable is set in YOUR dahdi/asterisk combination.
You also can use ami from c/c++, but that is not optimal.
In general you should not see number of channel in channel-name unless you setuped one-channel-one-span.