Hey man, I give like this but still not happening anything different.
Let me explain the scenario, When I double enter after Originate script then It’s made the first call to 1106 as anonymous@anonymous.invalid When I picked up/ Answer call to that, its ring to 1102 as 1106@192.168.1.4 and When I answer that call I can communicate bidirectionally.
But still, on another device screen, I see caller name anonymous.
Hey did you understand my point? Or anything I should add for more details.
When you use originate, you create two channels. In your case you create a call to PJSIP/1106 this call originates from within asterisk, and without running any kind of dial plan beforehand it just plain dials PJSIP/1106. If you want to control variables, you can use the Local/1106@someContext form to dial instead.
[someContext]
exten => 1106,1,Set(CallerID(num)=1106)
same => n,Set(CallerID(name)=Something)
same => n,Dial(PJSIP/1106)
Local/ will instruct Asterisk to run the dialplan for the specified extension@context, instead of just dialing the PJSIP endpoint directly. This allows you to set the required variables on the channel, before actually calling the device. When using PJSIP Asterisk uses whatever is set at that point in time, when using originate, not many, if any, variables are set in advance, and you get things like missing caller ID, and other “funny” stuff. I had to do similar tricks to make it possible for our customers to upload a document through a webinterface, and have it sent as a fax to the recipient. (Apparently FAX is still a thing in 2021… )