After much tearing out of hair, it looks like I have finally gotten
OpenSER to do DNS SRV lookups. Here's my DNS records...
proxy1 10 IN A 192.168.10.24
proxy2 10 IN A 192.168.10.52
proxy.voip.com. IN NAPTR 50 50 "s" "SIPS+D2T" ""
_sips._tcp.proxy.voip.com.
proxy.voip.com. IN NAPTR 60 40 "s" "SIP+D2T" ""
_sip._tcp.proxy.voip.com.
proxy.voip.com. IN NAPTR 60 60 "s" "SIP+D2U" ""
_sip._udp.proxy.voip.com.
_sips._tcp.proxy.voip.com. 10 IN SRV 0 0 5061 proxy1.proxy.voip.com.
_sips._tcp.proxy.voip.com. 10 IN SRV 0 0 5061 proxy2.proxy.voip.com.
_sip._udp.proxy.voip.com. 10 IN SRV 100 10 5060 proxy1.proxy.voip.com.
_sip._udp.proxy.voip.com. 10 IN SRV 100 10 5060 proxy2.proxy.voip.com.
_sip._tcp.proxy.voip.com. 10 IN SRV 300 10 5060 proxy1.proxy.voip.com.
_sip._tcp.proxy.voip.com. 10 IN SRV 300 10 5060 proxy2.proxy.voip.com.
And here's my code snippit from openser.cfg:
modparam("tm", "fr_timer", 5)
if ( is_method("INVITE") ) {
xlog ("L_INFO","Got an INVITE");
rewritehost ("proxy.voip.com");
rewriteport ("");
xlog ("L_INFO","Calling t_relay()");
if ( !t_relay() ) {
sl_send_reply("404", "ARRGH Not Found");
xlog ("L_INFO","Error on t_relay()");
} else {
xlog ("L_INFO","Call to t_relay() complete ok");
}
return;
}
The sip UDP SRV records have the same priority and weight, so OpenSER
should round-robin the queries, which it is doing.
Yay!
However, I had **REALLY** hoped that upon failure to connect to one of
the hosts, t_relay() would attempt to connect to the next host in the
SRV lookup on it's own accord. I was able to set the timeout that it
waits for an ACK to the INVITE down to 5 seconds with the modparam()
call above, but after that it just gives up and does not try to connect
to any other hosts.
All the OpenSER docs say that it 'fully' supports the SRV standard. Has
anyone gotten this to work?
This is OpenSer-1.0.x. I sure hope this works, because it it doesn't,
this really hinders the development of redundant SIP proxies.
Help appreciated.
doug -at- pobox . com
Doug.
|