Show username instead of extension - SIP Show Peer

Hi,

Instead of the marked extensions i need to show the name.

http://prntscr.com/fu4uu0 ~ Screenshot.

Thanks

There are no extensions in that screen shot (also, please include such information, as inline text, not out of line images).

If by username, you mean the user part of the address of record, that normally has to match the name in sip.conf.

I mean , instead of

101/101 172.125.186.180 D Yes Yes A 1025 OK (23 ms)

I need , 101/John 172.125.186.180 D Yes Yes A 1025 OK (23 ms)

I’m not sure what it would break but you could overload the defaultuser field for each peer with the name you wanted to show.

so in sip.conf for your peer

[101]
name=101
defaultuser=John

There are 100 of user ? Do i need to do that manually ?

Yes you would have to manually do it.

The alternative would be to modify the source of asterisk and recompile, I think it’s the PEERS_FORMAT2 format string in channels/chan_sip.c but I’m not 100% as to where the modification would need to be made.

Where is the file located and how to recompil

Get Outlook for Androidhttps://aka.ms/ghei36

The chan_sip.c file is located in the channels subdirectory of your asterisk source.

channels/chan_sip.c

You would modify it and then execute a make in the source directory and it should re-compile, then either copy the modified chan_sip.so file to the modules directory and restart asterisk or do a make install and restart asterisk.