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?
e.g. in chan->name this number of span only.
asterisk 13 DAHDI: DAHDI/I2/102-1
That information is only available inside the chan_dahdi channel driver. You cannot directly access that information outside that module. For another C module to get that information you will have to use the ast_str_substitute_variables() function to evaluate the “${CHANNEL(dahdi_channel)}” expression on a DAHDI channel.