I have tried following rule but somehow opensips challenging it from authentication
route[3]{ if ( $ru =~ "^sip:011[0-9]*@") { rewritehostport("65.65.65.65:5065"); xlog("Redirecting to SIP Provider... $ru\n"); exit; }; } U 198.198.198.198:56186 -> 182.182.182.182:5060 INVITE sip:0116663332...@sip.a1routes.com SIP/2.0. Via: SIP/2.0/UDP 198.198.198.198:56186 ;branch=z9hG4bK-524287-1---cf509553a10c6e60;rport. Max-Forwards: 70. Contact: <sip:1001@198.198.198.198:56186;transport=UDP>. To: <sip:0116663332...@sip.a1routes.com>. From: "1001"<sip:1...@sip.a1routes.com>;tag=3894f90f. Call-ID: rcKLOO3Z1CXYS2EtiCLt3w... CSeq: 1 INVITE. Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, SUBSCRIBE. Content-Type: application/sdp. Supported: replaces, norefersub. User-Agent: SessionTalk Version 4.52. Content-Length: 334. . v=0. o=- 1408648022732773 1408648022732773 IN IP4 10.199.232.27. s=-. c=IN IP4 10.199.232.27. t=0 0. m=audio 4004 RTP/AVP 3 102 0 8 9 101. a=rtpmap:3 GSM/8000. a=rtpmap:102 iLBC/8000. a=fmtp:102 mode=30. a=rtpmap:0 PCMU/8000. a=rtpmap:8 PCMA/8000. a=rtpmap:9 G722/8000. a=rtpmap:101 telephone-event/8000. a=fmtp:101 0-15. a=sendrecv. # U 182.182.182.182:5060 -> 198.198.198.198:56186 SIP/2.0 407 Proxy Authentication Required. Via: SIP/2.0/UDP 198.198.198.198:56186 ;received=198.198.198.198;branch=z9hG4bK-524287-1---cf509553a10c6e60;rport=56186. To: <sip:0116663332...@sip.a1routes.com >;tag=c223d9b6a566b5450d01aad8764c61fe.1e68. From: "1001"<sip:1...@sip.a1routes.com>;tag=3894f90f. Call-ID: rcKLOO3Z1CXYS2EtiCLt3w... CSeq: 1 INVITE. Proxy-Authenticate: Digest realm="sip.a1routes.com", nonce="53f6436f0000009672b0aa913a92b9afaecefe5810253453". Server: OpenSIPS (1.11.2-tls (x86_64/linux)). Content-Length: 0. . On Thu, Aug 21, 2014 at 7:37 AM, Yuriy Gorlichenko <ovoshl...@gmail.com> wrote: > rewritehost() sucessfully work with UAC. But As I know > 1) It statless function > 2) It read only string argumetns, and do not read variables > > > 2014-08-21 14:43 GMT+04:00 Satish Patel <satish....@gmail.com>: > > I will give it a try again today, can you please make sure my t_relay() >> syntax is correct? >> >> So t_relay will rewrite my host past right and send call to trunk. >> >> While ago I was using rewritehost() function but I think it's not working >> with UAC registrant module. >> >> >> Sent from my iPhone >> >> On Aug 21, 2014, at 3:53 AM, Daniel Tryba <dan...@pocos.nl> wrote: >> >> > On Thursday 21 August 2014 05:56:46 Satish Patel wrote: >> >> if ( $rU =~ "sip:1[0-9]@*") { >> > >> > Try $ru instead, $rU only contains the dialled "number". So >> > $ru =~ "sip:1[0-9]@*" >> > or >> > $rU =~ "1[0-9]" >> > >> > But note the regexp, that only matches the exact numbers 10 to 19, if >> you are >> > trying to match prefixes you are doing it wrong (tm). >> > >> > _______________________________________________ >> > SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list >> > sr-users@lists.sip-router.org >> > http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users >> >> _______________________________________________ >> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list >> sr-users@lists.sip-router.org >> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users >> > > > _______________________________________________ > SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list > sr-users@lists.sip-router.org > http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users > >
_______________________________________________ SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users