[OpenSIPS-Users] proxy non-existing domain to another address
Leon de Rooij
leon at scarlet-internet.nl
Wed Dec 7 18:09:23 CET 2011
Hello all,
Sorry for the subject not being too clear, but let me explain what I'd like to achieve (not sure if it's possible at all?)
* A carrier (UA2) would like us to send them INVITEs with a domain (lets say foo.com) in the RURI and To header, while that domain is not resolvable through DNS.
* I'm originating the call from UA1 going through an OpenSIPS proxy towards UA2, so:
UA1 (1.1.1.1) ---> OpenSIPS (2.2.2.2) ---> UA2 (3.3.3.3)
I can get the INVITE proxied to UA2 without the domain:
* Packet from 1.1.1.1 to 2.2.2.2 :
INVITE sip:1234 at 3.3.3.3 SIP/2.0
Via: SIP/2.0/UDP 1.1.1.1:5060;rport;branch=z9hG4bKDtZ7Kyg6Zjm8Q
From: "" <sip:0000 at bar.com>;tag=3FggSgHr1Bp0r
To: <sip:1234 at 3.3.3.3>
* Packet from 2.2.2.2 to 3.3.3.3 :
INVITE sip:1234 at 3.3.3.3 SIP/2.0
Record-Route: <sip:2.2.2.2;lr>
Via: SIP/2.0/UDP 2.2.2.2;branch=z9hG4bKd3ca.89665b.0
Via: SIP/2.0/UDP 1.1.1.1:5060;received=1.1.1.1;rport=5060;branch=z9hG4bKDtZ7Kyg6Zjm8Q
From: "" <sip:0000 at bar.com>;tag=3FggSgHr1Bp0r
To: <sip:1234 at 3.3.3.3>
If I want to use the domain as stated above, I can send the INVITE directly from UA1 to UA2:
INVITE sip:1234 at foo.com SIP/2.0
Via: SIP/2.0/UDP 1.1.1.1:5060;rport;branch=blahblah
From: "" <sip:0000 at bar.com>;tag=yadayada
To: <sip:1234 at foo.com>
(so UA1 doesn't do a DNS lookup for foo.bar, but just sends the packet to 3.3.3.3)
but I want the OpenSIPS proxy to be in between...
If I put the domain in the RURI/To (in the packet from UA1 to OpenSIPS), then OpenSIPS tries to resolve it, finds out that foo.com doesn't exist and the session won't be setup. I also tried sending the initial INVITE from UA1 towards the proxy by IP (as in the first example above) and do a rewritehost("foo.com") before relaying it in the proxy configuration - which again doesn't work, because OpenSIPS then tries to resolve and give the same result. (I wouldn't prefer to "fix" the domain in the proxy as that feels a bit like a hack. But if doing this in the proxy *is* the only way, does a function such as "next_ip_hop" or somesuch exist, which doesn't affect the SIP message, but only the IP address in the packet's IP header ?)
One other thing, it's not an option to make foo.com resolvable to 3.3.3.3 (either by our own dns or a hosts entry), because that carrier has a number of endpoints (different IP's) where I need to send INVITEs to, all of which need to have that same foo.com in the RURI/To.
So, if at all possible, what would an INVITE from UA1 towards OpenSIPS need to look like to achieve what I want ?
thanks,
Leon
More information about the Users
mailing list