Hi,
I'm trying to forward the original username of the peer via Kamailio dispatcher to the Asterisk and I can't get it working.
The scenario looks like this:
Client Phone (username 1) -> Asterisk Client ---trunk(test-trunk)--> Kamailio Dispatcher/RTPEngine --trunk--> Asterisk Final
Client is dialing via Asterisk Client with a simple extension: exten => _X.,1,Set(CALLERID(all)= 587555611 <587555611>) exten => _X.,n,Dial(SIP/${EXTEN}@test-trunk)
Asterisk Client is registering to the Kamailio with its own credentials and Kamailio is registering in the Asterisk Final
The problem is that I can't find a way to extract the original trunk username (like test-trunk) in the outgoing connection to the Asterisk Final (via Kamailio):
Since i'm using the CALLERID on the Asterisk Client all I can see on the Asterisk Final is:
INVITE sip:587322591@192.168.20.74 SIP/2.0 Record-Route: sip:587322591@192.168.20.74;lr;ftag=as52b874a1;nat=yes Via: SIP/2.0/UDP 192.168.20.74;branch=z9hG4bKc6e3.a77db1f002191ae3ee1a414b63d34a72.0 Via: SIP/2.0/UDP 192.168.21.228:5060;received=192.168.21.228;branch=z9hG4bK705ec94a;rport=5060 Max-Forwards: 69 From: "587555611" sip:587555611@192.168.21.228;tag=as52b874a1 To: sip:587322591@192.168.20.74 Contact: sip:587555611@192.168.21.228:5060;alias=192.168.21.228~5060~1 Call-ID: 433f9ff84cdb437f0d383797003c232f@192.168.21.228:5060 CSeq: 102 INVITE User-Agent: Asterisk PBX 16.29.0 Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE Supported: replaces, timer P-Asserted-Identity: "587555611" sip:587555611@192.168.21.228 Content-Type: application/sdp Content-Length: 268
There is no way I can forward the 'test-trunk' in the SIP header. I tried to add append_hf to ROUTE[relay] like append_hf("X-Trunk $au r\n"); but if the trunk is already registered then $au is null or the CALLERID value.
How to extract the original username (test-trunk) on the Asterisk Final? Do you have any ideas?
Thank you in advance ;)