I have a requirement where i need to append caller number in channel to be able to identify the calls anywhere, example: currently the call coming from provider and its connecting through PJSIP with my diaplan but in asterisk console I can only see the pjsip+uniqueid, i want the calls to be displayed as pjsip+callernumber+uniqueid in queue and pjsip channel to identify which call is in which state or position.
curently: pjsip-0000000b What i want: /pjsip-791919291-0000000b
As I had some thoughts on how you would have to change the code, I will add to that.
The safest way would be to change the code in all the places where this information was output.
It might be possible to change chan_pjsip, but I suspect that the caller ID isn’t known at the time that the channel name is assigned.
There is a low level API, but it carries warnings that would, I think, make it effectively unusable on a live system, and it is not exposed by the CHANNEL function, even though the documentation for that fails to say whether name is read-only or read-write, and almost certainly because it would be unsafe to implement.
After playing with some commands and reading the book and posts from the forum I figured it out a way to identify the caller number with its channel and caller number for all calls on both queue and in any point in diaplan (Using PHP did it automate).
Number of calls not in queues: 1
[{“Channel”:“PJSIP/pjsip-0000000b”,“CallerIDNum”:“772124215”}]