Hello, I have a problem that my calls get rejected by he pstn gateway as my gateway is expecting a DID number instead of a 4 digit extension as the 'from user". Let me explain my situation:
1. I have set callfwd_busy in my user preference table. 2. In my failure route I check to see if callfwd_busy has been set, if it has then I execute the following script:
if (t_check_status("486|408")) {
$avp(dst_number) = $rU; if (avp_db_load("$avp(dst_number)", "$avp(callfwd_busy)")) { xlog("LOG: avp(callfwd_busy)=$avp(callfwd_busy), avp(dst_number)=$avp(dst_number)\n"); }
xlog("LOG: Failure route with $rU $avp(dst_number) \n"); $rU = $avp(callfwd_busy); $ru = "sip:" + $rU + "@" + $sel(cfg_get.pstn.gw_ip); route(RELAY); exit; }
When I call from extension 7004 to ext 7002 ( this has callfwd_busy set to a DID number) the trace looks as follows:
U 172.10.30.15:5080 -> 172.10.30.15:5060 SIP/2.0 486 Busy Here. Via: SIP/2.0/UDP 54.200.xx.yy:5060;branch=z9hG4bKee75.ab791c5.0;received=172.10.30.15. Via: SIP/2.0/UDP 192.168.1.8:5060;received=71.252.219.63;branch=z9hG4bK209939211;rport=1025. From: "7004" sip:7004@ajfmc1.myDomain.net;tag=1830267367. To: sip:7002@ajfmc1.myDomain.net;tag=as17cd0b40. Call-ID: 876294364-5060-74@BJC.BGI.B.I. CSeq: 731 INVITE. Server: Asterisk PBX 1.8.17.0. Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH. Supported: replaces, timer. Content-Length: 0.
U 172.10.30.15:5060 -> 172.10.30.15:5080 INVITE sip:18455981234@64.136.xx.yy:5060 SIP/2.0. Record-Route: sip:54.200.xx.xx;lr=on;ftag=1830267367;nat=yes. Via: SIP/2.0/UDP 54.200.xx.xx:5060;branch=z9hG4bKee75.ab791c5.1. Via: SIP/2.0/UDP 192.168.1.8:5060;received=71.252.xx.yy;branch=z9hG4bK209939211;rport=1025. From: "7004" sip:7004@ajfmc1.myDomain.net;tag=1830267367. To: sip:7002@ajfmc1.myDomain.net. Call-ID: 876294364-5060-74@BJC.BGI.B.I. CSeq: 731 INVITE. Contact: "7004" sip:7004@71.252.xx.yy:1025. Max-Forwards: 16. User-Agent: Grandstream HT701 1.0.4.8. Privacy: none. P-Preferred-Identity: "7004" sip:7004@ajfmc1.myDomain.net. Supported: replaces, path, timer, eventlist. Allow: INVITE, ACK, OPTIONS, CANCEL, BYE, SUBSCRIBE, NOTIFY, INFO, REFER, UPDATE. Content-Type: application/sdp. Accept: application/sdp, application/dtmf-relay. Content-Length: 453. . v=0. o=7004 8000 8000 IN IP4 172.10.30.1554.200.xx.xx. s=SIP Call. c=IN IP4 172.10.30.1554.200.xx.xx. t=0 0. m=audio 6248262482 RTP/AVP 0 18 4 8 2 97 101. a=sendrecv. a=rtpmap:0 PCMU/8000. a=ptime:20. a=rtpmap:18 G729/8000. a=fmtp:18 annexb=no. a=rtpmap:4 G723/8000. a=rtpmap:8 PCMA/8000. a=rtpmap:2 G726-32/8000. a=rtpmap:97 iLBC/8000. a=fmtp:97 mode=20. a=rtpmap:101 telephone-event/8000. a=fmtp:101 0-16,32-36,54. a=nortpproxy:yes. a=nortpproxy:yes.
# U 172.10.30.15:5080 -> 172.10.30.15:5060 SIP/2.0 503 Unavailable. Via: SIP/2.0/UDP 54.200.xx.xx:5060;branch=z9hG4bKee75.ab791c5.1;received=172.10.30.15. Via: SIP/2.0/UDP 192.168.1.8:5060;received=71.252.xx.yy;branch=z9hG4bK209939211;rport=1025. From: "7004" sip:7004@ajfmc1.myDomain.net;tag=1830267367. To: sip:7002@ajfmc1.myDomain.net;tag=as17cd0b40. Call-ID: 876294364-5060-74@BJC.BGI.B.I. CSeq: 731 INVITE. Server: Asterisk PBX 1.8.17.0. Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH. Supported: replaces, timer. Content-Length: 0.
It looks like my gateway is expecting to see a DID number in the from header. Can someone let me know how I can dot this? Thank you.
Arun
On 02/21/2014 07:46 PM, arun Jayaprakash wrote:
It looks like my gateway is expecting to see a DID number in the from header. Can someone let me know how I can dot this? Thank you.
The uac_replace_from() function exported by the 'uac' module can do this:
http://kamailio.org/docs/modules/4.1.x/modules/uac.html#uac.f.uac_replace_fr...
However, you should carefully give some consideration to whether you really want to change the value of the From header. It is quite inadvisable, and is not something proxies are formally permitted to do. The UAC module gets around this requirement through some rather complicated spoofing.
You might consider instead reconfiguring your UAC to send different From values, most likely by changing 'caller ID' settings in Asterisk, in your case. For instance, there is the 'callerid' option for sip,conf peers.
Alex, thank you for your pointers. I will work with Asterisk to see how I can change the caller ID instead of messing with the UAC module. Thanks again.
Regards, Arun
________________________________ From: Alex Balashov abalashov@evaristesys.com To: arun Jayaprakash jayaprakasharun@yahoo.com; Kamailio (SER) - Users Mailing List sr-users@lists.sip-router.org Sent: Friday, February 21, 2014 6:49 PM Subject: Re: [SR-Users] Change from_uri
On 02/21/2014 07:46 PM, arun Jayaprakash wrote:
It looks like my gateway is expecting to see a DID number in the from header. Can someone let me know how I can dot this? Thank you.
The uac_replace_from() function exported by the 'uac' module can do this:
http://kamailio.org/docs/modules/4.1.x/modules/uac.html#uac.f.uac_replace_fr...
However, you should carefully give some consideration to whether you really want to change the value of the From header. It is quite inadvisable, and is not something proxies are formally permitted to do. The UAC module gets around this requirement through some rather complicated spoofing.
You might consider instead reconfiguring your UAC to send different From values, most likely by changing 'caller ID' settings in Asterisk, in your case. For instance, there is the 'callerid' option for sip,conf peers.
-- Alex Balashov - Principal Evariste Systems LLC 235 E Ponce de Leon Ave Suite 106 Decatur, GA 30030 United States Tel: +1-678-954-0670 Web: http://www.evaristesys.com/, http://www.alexbalashov.com/
On Saturday 22 February 2014 02:16:01 arun Jayaprakash wrote:
You might want to check what happens when you fix the header: P-Preferred-Identity: "7004" sip:7004@ajfmc1.myDomain.net by simply deleting it and adding a correct one.
True! As most industrial equipment out there prefers PAI > RPID > From.
Daniel Tryba daniel@pocos.nl wrote:
-- Sent from my mobile, and thus lacking in the refinement one might expect from a fully fledged keyboard.
Alex Balashov - Principal Evariste Systems LLC 235 E Ponce de Leon Ave Suite 106 Decatur, GA 30030 United States Tel: +1-678-954-0671 Web: http://www.evaristesys.com/, http://www.alexbalashov.com