PJSIP channelstats command truncates 20-digit SIP numbers to 18 digits

When using the pjsip show channelstats command, the displayed SIP numbers are truncated to 18 digits. In our system, SIP numbers are 20 digits long, and full visibility is required for accurate analysis. Is there any way to obtain and display the entire 20-digit SIP number through the CLI or another method?

Example output:

xxxxxx*CLI> pjsip show channelstats

                                             ...........Receive......... .........Transmit..........
 BridgeId ChannelId ........ UpTime.. Codec.   Count    Lost Pct  Jitter   Count    Lost Pct  Jitter RTT....
 ===========================================================================================================

 db75b401 250000001800000006 00:00:08 ulaw      332       0    0   0.000    353       0    0   0.000   0.000
 db75b401 250000001800000006 00:00:08 ulaw      324       0    0   0.000    345       0    0   0.002   0.000
 db75b401 250000001800000006 00:00:09 ulaw      349       0    0   0.000    347       0    0   0.001   0.000

Objects found: 3

actual SIP numbers are, “25000000180000000628”, “25000000180000000629”, “25000000180000000630”. But as shown above, the ChannelId column does not display the full 20 digits.

Could you let us know if there’s a configuration or a workaround to retrieve the complete SIP number?

Asterisk version: 18.21.0

How are you using the information? CLI command output is generally intended for real time human consumption, and there are likely to other methods better suited to machine processing.

Asterisk is open source, so you can modify the format in the source code, and rebuild.

Asterisk 18 has security fixes only status.

Thank you for your reply.

Our system uses confbridge to enable group calls. Occasionally, there are devices that fail to establish an audio connection due to a bug in our application. We need to provide a warning for these devices, and we are considering using channelstats for this purpose.

Regarding the version, we are also using the 20.x series, and the same issue occurs. Apologies for mentioning an older version earlier.

We would like to know if there are any alternatives to modifying the source code. If there are no other options, we will consider making source code changes.

There is almost certainly something you can do with AMI, but I’d have to spend significant time searching for, it and clarifying requirement details, with you.

Try:
pjsip show endpoints

It has more space to show the channel info.