Hello Daniel,
I've done several test with different scenarios:
1) including 4 hosts in the answer of the SRV reply message; the 1st and 2nd host are
unreachable, the third an fourth are reachable - the SIP message never reached the target
(= host 3)
2) including 4 hosts in the answer of the SRV reply message; the SIP service is not
running on the first and second host; the third and fourth have the service activated -
the SIP message is transmitted to the second host after the fr_timeout of the TM module,
but is not forwarded to the target (= host 3); it is retransmitted to host 2 until SIP
timeout
The conclusion is: when only on master and slave are in the answer of the SRV reply
message it works fine. But starting with the third host the service hangs on the second
host and does not try reaching an alternative target (as listed in the SRV response).
In the syslog I can only see entries like this (but no ERROR message):
Mar 9 15:36:21 lennysrv /usr/local/sbin/kamailio[25041]: DBG:core:mk_proxy: doing DNS
lookup...
Mar 9 15:36:21 lennysrv /usr/local/sbin/kamailio[25041]: DBG:core:a2dns_node: storing
kamailio2.test.loc:5080
Mar 9 15:36:21 lennysrv /usr/local/sbin/kamailio[25041]: DBG:core:a2dns_node: storing
kamailio3.test.loc:5060
Mar 9 15:36:26 lennysrv /usr/local/sbin/kamailio[25043]: DBG:core:mk_proxy: doing DNS
lookup...
Mar 9 15:36:28 lennysrv /usr/local/sbin/kamailio[25047]: DBG:tm:is_3263_failure:
dns-failover test: branch=0, last_recv=408, flags=1
Mar 9 15:36:28 lennysrv /usr/local/sbin/kamailio[25047]: DBG:tm:t_should_relay_response:
trying DNS-based failover
Mar 9 15:36:28 lennysrv /usr/local/sbin/kamailio[25047]: DBG:tm:do_dns_failover: new
destination available
Mar 9 15:36:31 lennysrv /usr/local/sbin/kamailio[25047]: DBG:tm:is_3263_failure:
dns-failover test: branch=1, last_recv=408, flags=1
Mar 9 15:36:31 lennysrv /usr/local/sbin/kamailio[25047]: DBG:tm:t_should_relay_response:
trying DNS-based failover
Mar 9 15:36:31 lennysrv /usr/local/sbin/kamailio[25047]: DBG:tm:do_dns_failover: new
destination available
Mar 9 15:36:34 lennysrv /usr/local/sbin/kamailio[25047]: DBG:tm:is_3263_failure:
dns-failover test: branch=2, last_recv=408, flags=1
Mar 9 15:36:34 lennysrv /usr/local/sbin/kamailio[25047]: DBG:tm:t_should_relay_response:
trying DNS-based failover
Mar 9 15:36:34 lennysrv /usr/local/sbin/kamailio[25047]: DBG:tm:do_dns_failover: new
destination available
Mar 9 15:36:37 lennysrv /usr/local/sbin/kamailio[25047]: DBG:tm:is_3263_failure:
dns-failover test: branch=3, last_recv=408, flags=1
Mar 9 15:36:37 lennysrv /usr/local/sbin/kamailio[25047]: DBG:tm:t_should_relay_response:
trying DNS-based failover
Mar 9 15:36:37 lennysrv /usr/local/sbin/kamailio[25047]: DBG:tm:do_dns_failover: new
destination available
Mar 9 15:36:40 lennysrv /usr/local/sbin/kamailio[25047]: DBG:tm:is_3263_failure:
dns-failover test: branch=4, last_recv=408, flags=1
Mar 9 15:36:40 lennysrv /usr/local/sbin/kamailio[25047]: DBG:tm:t_should_relay_response:
trying DNS-based failover
Mar 9 15:36:40 lennysrv /usr/local/sbin/kamailio[25047]: DBG:tm:do_dns_failover: new
destination available
Mar 9 15:36:43 lennysrv /usr/local/sbin/kamailio[25045]: DBG:tm:is_3263_failure:
dns-failover test: branch=5, last_recv=487, flags=1
The syslog output seems to be okay, because kamailio theoretically makes a dns_failover.
But practically it is only sent to the first and second target.
Do you have any other idea what could be wrong? I haven't found any specific
parameters that could influence this behaviour of kamailio....
regards,
Klaus F.
-------- Original-Nachricht --------
Datum: Fri, 06 Mar 2009 10:59:28 +0200
Von: Daniel-Constantin Mierla <miconda(a)gmail.com>
An: Klaus Feichtinger <klaus.feichtinger(a)gmx.net>
CC: users(a)lists.kamailio.org
Betreff: Re: [Kamailio-Users] handling of DNS-SRV in kamailio-1.4.3 & 1.5.0
Hello,
On 03/05/2009 02:51 PM, Klaus Feichtinger wrote:
Hello,
I have to relay SIP requests to a special "redundant" destination (=
FQDN - e.g. "test.kamailio.loc") that consists of 3 hosts with different
priorities.
After startup Kamailio creates a DNS-SRV request to the DNS server and
receives a
response with following answer (e.g.):
_sip._udp.test.kamailio.loc: type SRV, class
IN, priority 10, weight
100, port 5060, target host1.test.kamailio.loc
_sip._udp.test.kamailio.loc: type SRV, class
IN, priority 20, weight
90, port 5060, target host2.test.kamailio.loc
_sip._udp.test.kamailio.loc: type SRV, class
IN, priority 30, weight
80, port 5060, target host3.test.kamailio.loc
In worst case - if the prime and secondary host (host1 and host2) are
unavailable
- I expect that kamailio tries relaying the request to the third
host in the list. But it doesn't. It makes retransmission of the original
invite to the second host and does not try reaching the third host.
For tuning the switchover to the alternative target(2) I have set the
module
parameter "fr_timer" for TM to 3 seconds (modparam("tm",
"fr_timer",
3)).
Is this behaviour of Kamailio-1.4.3 and Kamailio-1.5.0 (I've tested it
with
both versions) as expected (= limited to support only two answers in a
DNS SRV reply)? Does anybody have experience with this scenario? Can
anybody give me a hint?
should be no such limitation. If you
try with 4 hosts what happens? Do
you get any errors in the syslog?
Cheers,
Daniel
--
Daniel-Constantin Mierla
http://www.asipto.com
--
Computer Bild Tarifsieger! GMX FreeDSL - Telefonanschluss + DSL
für nur 17,95 Euro/mtl.!*