<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: Times New Roman; font-size: 12pt; color: #000000'>Kamailio 3.1.2<div>Here is my setup:</div><div><span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-tab-span" style="white-space:pre">                </span> <span class="Apple-style-span" style="white-space: normal;">Phone1 &nbsp;(10.10.1.114)</span></span></div><div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="white-space: normal;">&nbsp;<span class="Apple-tab-span" style="white-space:pre">        </span>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|</span></span></div><div><span class="Apple-tab-span" style="white-space:pre">                </span>&nbsp;&nbsp;Kamailio (10.10.1.230)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; / &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;/ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \</div><div>&nbsp; &nbsp;Freeswitch1 &nbsp; &nbsp; &nbsp; &nbsp;Freeswitch2 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;----------------------&gt; &nbsp;Other phones</div><div>(10.10.1.222) &nbsp; &nbsp; &nbsp; &nbsp;(10.10.1.223)</div><div><br></div><div>Both Freeswitch's share the same REGISTRATION information. Phone1 is already registered with Freeswitch. When I try to dial 'Other phones' using phone1, &nbsp;the dispatcher always get into FAILURE route although the log shows that kamailio did send INVITE to 10.10.1.222 and &nbsp;received '407 - Proxy Authentication Required' from Freexwitch1 and then dispatcher send INVITE to 10.10.1.223 and also received&nbsp;'407 - Proxy Authentication Required' from Freexwitch2 and eventually failed.</div><div><br></div><div>Any idea?</div><div><br></div><div>Here is my configuration:</div><div><div>modparam("dispatcher", "db_url", DBURL)</div><div>modparam("dispatcher", "table_name", "dispatcher")</div><div>modparam("dispatcher", "ds_ping_interval", 10000)</div><div>modparam("dispatcher", "ds_probing_threshhold", 3)</div><div>#modparam("dispatcher", "ds_ping_reply_codes", "class=2;class=4")</div><div>modparam("dispatcher", "ds_ping_method", "OPTIONS")</div><div>modparam("dispatcher", "ds_probing_mode", 1)</div><div>modparam("dispatcher", "ds_ping_from", "sip:proxy@SIP-router1.testnet.net")</div><div>modparam("dispatcher", "dst_avp", "$avp(dsdst)")</div><div>modparam("dispatcher", "grp_avp", "$avp(dsgrp)")</div><div>modparam("dispatcher", "cnt_avp", "$avp(dscnt)")</div><div>modparam("dispatcher", "attrs_avp", "$avp(dsattrs)")</div><div>modparam("dispatcher", "flags", 3)</div><div>modparam("dispatcher", "force_dst", 1)</div></div><div><br></div><div>route {</div><div>....</div><div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ( ds_select_dst("$var(group)", "9") ){</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; route(RELAY_DS);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return;</div></div><div>...</div><div>}</div><div><div>route[[RELAY_DS]</div><div>&nbsp; &nbsp; &nbsp; &nbsp; if (is_method("INVITE")) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; t_on_branch("BRANCH_ONE");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; t_on_reply("NAT_REPLY");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; t_on_failure("FAIL_DS");</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; if (!t_relay()) {</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;sl_reply_error();</div><div>&nbsp; &nbsp; &nbsp; &nbsp; }</div><div>}</div></div><div><div>failure_route[FAIL_DS] {</div><div>&nbsp; if (t_check_status("408")) {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; ds_mark_dst("i");</div><div>&nbsp; }</div><div>&nbsp; if (!ds_next_dst()) {</div><div>&nbsp; &nbsp; t_reply("503", "Service unavailable: no more dst");</div><div>&nbsp; &nbsp; exit;</div><div>&nbsp; }</div><div>&nbsp; &nbsp; t_on_failure("FAIL_DS");</div><div>&nbsp; &nbsp; route(RELAY_DS);</div><div>}</div></div><div><div>onreply_route[NAT_REPLY]</div><div>{</div><div>&nbsp; &nbsp; &nbsp; &nbsp; xlog("L_INFO", "REPLY_ROUTE: S=$rs - $rr F=$fu T=$tu IP=$avp(s:ip):$avp(s:port) ($si:$sp) ID=$ci\n");</div><div>&nbsp; &nbsp; &nbsp; &nbsp;</div></div><div>}</div><div><br></div><div>And here is the SIP messages from ngrep:</div><div><div>U 10.10.1.144:51029 -&gt; 10.10.1.230:5060</div><div>&nbsp; INVITE sip:1001@fs2000.testnet.net;user=phone SIP/2.0..Via: SIP/2.0/UDP 10.10.1.144:5060;branch=z9hG4bK116d554d..F</div><div>&nbsp; rom: "Line1" &lt;sip:5022441011@fs2000.testnet.net&gt;;tag=00082166efcb002153bc0a31-20004ffd..To: &lt;sip:1001@fs2000.testnet</div><div>&nbsp; .net;user=phone&gt;..Call-ID: 00082166-efcb0013-692f44d9-6760a891@10.10.1.144..Max-Forwards: 70..Date: Thu, 02 Jun 2011</div><div>&nbsp; &nbsp;19:14:14 GMT..CSeq: 101 INVITE..User-Agent: Cisco-CP7960G/7.5..Contact: &lt;sip:5022441011@10.10.1.144:5060&gt;..Expires:</div><div>&nbsp; &nbsp;180..Accept: application/sdp..Allow: ACK,BYE,CANCEL,INVITE,NOTIFY,OPTIONS,REFER,REGISTER,UPDATE..Supported: replaces..C</div><div>&nbsp; ontent-Length: 261..Content-Type: application/sdp..Content-Disposition: session;handling=optional....v=0..o=Cisco-SIPUA</div><div>&nbsp; 10962 0 IN IP4 10.10.1.144..s=SIP Call..t=0 0..m=audio 20372 RTP/AVP 0 8 18 101..c=IN IP4 10.10.1.144..a=rtpmap:</div><div>&nbsp; 0 PCMU/8000..a=rtpmap:8 PCMA/8000..a=rtpmap:18 G729/8000..a=rtpmap:101 telephone-event/8000..a=fmtp:101 0-15..a=sendrecv</div><div>&nbsp; ..</div><div>#</div><div>U 10.10.1.230:5060 -&gt; 10.10.1.144:5060</div><div>&nbsp; SIP/2.0 100 trying -- your call is important to us..Via: SIP/2.0/UDP 10.10.1.144:5060;branch=z9hG4bK116d554d..From:</div><div>&nbsp; "Line1" &lt;sip:5022441011@fs2000.testnet.net&gt;;tag=00082166efcb002153bc0a31-20004ffd..To: &lt;sip:1001@fs2000.testnet.net;</div><div>&nbsp; user=phone&gt;..Call-ID: 00082166-efcb0013-692f44d9-6760a891@10.10.1.144..CSeq: 101 INVITE..Server: kamailio (3.1.2 (x8</div><div>&nbsp; 6_64/linux))..Content-Length: 0....</div><div>#</div><div>U 10.10.1.230:5060 -&gt; 10.10.1.222:5060</div><div>&nbsp; INVITE sip:1001@fs2000.testnet.net;user=phone SIP/2.0..Record-Route: &lt;sip:10.10.1.230;lr=on;nat=yes&gt;..Via: SIP/2.0/</div><div>&nbsp; UDP 10.10.1.230;branch=z9hG4bK1ef6.c9d52d72.0..Via: SIP/2.0/UDP 10.10.1.144:5060;branch=z9hG4bK116d554d..From: "L</div><div>&nbsp; ine1" &lt;sip:5022441011@fs2000.testnet.net&gt;;tag=00082166efcb002153bc0a31-20004ffd..To: &lt;sip:1001@fs2000.testnet.net;us</div><div>&nbsp; er=phone&gt;..Call-ID: 00082166-efcb0013-692f44d9-6760a891@10.10.1.144..Max-Forwards: 69..Date: Thu, 02 Jun 2011 19:14:</div><div>&nbsp; 14 GMT..CSeq: 101 INVITE..User-Agent: Cisco-CP7960G/7.5..Contact: &lt;sip:5022441011@10.10.1.144:5060&gt;..Expires: 180..A</div><div>&nbsp; ccept: application/sdp..Allow: ACK,BYE,CANCEL,INVITE,NOTIFY,OPTIONS,REFER,REGISTER,UPDATE..Supported: replaces..Content-</div><div>&nbsp; Length: 277..Content-Type: application/sdp..Content-Disposition: session;handling=optional....v=0..o=Cisco-SIPUA 10962 0</div><div>&nbsp; &nbsp;IN IP4 10.10.1.231..s=SIP Call..t=0 0..m=audio 38426 RTP/AVP 0 8 18 101..c=IN IP4 10.10.1.231..a=rtpmap:0 PCMU/80</div><div>&nbsp; 00..a=rtpmap:8 PCMA/8000..a=rtpmap:18 G729/8000..a=rtpmap:101 telephone-event/8000..a=fmtp:101 0-15..a=sendrecv..a=nortp</div><div>&nbsp; proxy:yes..</div><div>#</div><div>U 10.10.1.222:5060 -&gt; 10.10.1.230:5060</div><div>&nbsp; SIP/2.0 100 Trying..Via: SIP/2.0/UDP 10.10.1.230;branch=z9hG4bK1ef6.c9d52d72.0..Via: SIP/2.0/UDP 10.10.1.144:5060</div><div>&nbsp; ;branch=z9hG4bK116d554d..Record-Route: &lt;sip:10.10.1.230;lr=on;nat=yes&gt;..From: "Line1" &lt;sip:5022441011@fs2000.lightyea</div><div>&nbsp; r.net&gt;;tag=00082166efcb002153bc0a31-20004ffd..To: &lt;sip:1001@fs2000.testnet.net;user=phone&gt;..Call-ID: 00082166-efcb0013</div><div>&nbsp; -692f44d9-6760a891@10.10.1.144..CSeq: 101 INVITE..User-Agent: FreeSWITCH-mod_sofia/1.0.head-git-f17e962 2011-04-19 0</div><div>&nbsp; 3-05-32 -0400..Content-Length: 0....</div><div>#</div><div>U 10.10.1.222:5060 -&gt; 10.10.1.230:5060</div><div>&nbsp; SIP/2.0 407 Proxy Authentication Required..Via: SIP/2.0/UDP 10.10.1.230;branch=z9hG4bK1ef6.c9d52d72.0..Via: SIP/2.0/U</div><div>&nbsp; DP 10.10.1.144:5060;branch=z9hG4bK116d554d..From: "Line1" &lt;sip:5022441011@fs2000.testnet.net&gt;;tag=00082166efcb0021</div><div>&nbsp; 53bc0a31-20004ffd..To: &lt;sip:1001@fs2000.testnet.net;user=phone&gt;;tag=6mjQm2eayZ49j..Call-ID: 00082166-efcb0013-692f44d9</div><div>&nbsp; -6760a891@10.10.1.144..CSeq: 101 INVITE..User-Agent: FreeSWITCH-mod_sofia/1.0.head-git-f17e962 2011-04-19 03-05-32 -</div><div>&nbsp; 0400..Accept: application/sdp..Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, UPDATE, INFO, REGISTER, REFER, NOTIFY,</div><div>&nbsp; &nbsp;PUBLISH, SUBSCRIBE..Supported: timer, precondition, path, replaces..Allow-Events: talk, hold, presence, dialog, line-se</div><div>&nbsp; ize, call-info, sla, include-session-description, presence.winfo, message-summary, refer..Proxy-Authenticate: Digest rea</div><div>&nbsp; lm="fs2000.testnet.net", nonce="8da1ddb1-e393-442c-8be0-17e439457363", algorithm=MD5, qop="auth"..Content-Length: 0...</div><div>&nbsp; .</div><div>#</div><div>U 10.10.1.230:5060 -&gt; 10.10.1.222:5060</div><div>&nbsp; ACK sip:1001@fs2000.testnet.net;user=phone SIP/2.0..Via: SIP/2.0/UDP 10.10.1.230;branch=z9hG4bK1ef6.c9d52d72.0..Fro</div><div>&nbsp; m: "Line1" &lt;sip:5022441011@fs2000.testnet.net&gt;;tag=00082166efcb002153bc0a31-20004ffd..To: &lt;sip:1001@fs2000.testnet.n</div><div>&nbsp; et;user=phone&gt;;tag=6mjQm2eayZ49j..Call-ID: 00082166-efcb0013-692f44d9-6760a891@10.10.1.144..Max-Forwards: 69..CSeq:</div><div>&nbsp; 101 ACK..Content-Length: 0....</div><div>#</div><div>U 10.10.1.230:5060 -&gt; 10.10.1.223:5060</div><div>&nbsp; INVITE sip:1001@fs2000.testnet.net;user=phone SIP/2.0..Record-Route: &lt;sip:10.10.1.230;lr=on;nat=yes;nat=yes&gt;..Via:</div><div>&nbsp; SIP/2.0/UDP 10.10.1.230;branch=z9hG4bK1ef6.c9d52d72.1..Via: SIP/2.0/UDP 10.10.1.144:5060;branch=z9hG4bK116d554d..</div><div>&nbsp; From: "Line1" &lt;sip:5022441011@fs2000.testnet.net&gt;;tag=00082166efcb002153bc0a31-20004ffd..To: &lt;sip:1001@fs2000.lightyea</div><div>&nbsp; r.net;user=phone&gt;..Call-ID: 00082166-efcb0013-692f44d9-6760a891@10.10.1.144..Max-Forwards: 69..Date: Thu, 02 Jun 201</div><div>&nbsp; 1 19:14:14 GMT..CSeq: 101 INVITE..User-Agent: Cisco-CP7960G/7.5..Contact: &lt;sip:5022441011@10.10.1.144:5060&gt;..Expires</div><div>&nbsp; : 180..Accept: application/sdp..Allow: ACK,BYE,CANCEL,INVITE,NOTIFY,OPTIONS,REFER,REGISTER,UPDATE..Supported: replaces..</div><div>&nbsp; Content-Length: 328..Content-Type: application/sdp..Content-Disposition: session;handling=optional....v=0..o=Cisco-SIPUA</div><div>&nbsp; &nbsp;10962 0 IN IP4 10.10.1.23110.10.1.231..s=SIP Call..t=0 0..m=audio 3842638426 RTP/AVP 0 8 18 101..c=IN IP4 216.49.</div><div>&nbsp; 129.23110.10.1.231..a=rtpmap:0 PCMU/8000..a=rtpmap:8 PCMA/8000..a=rtpmap:18 G729/8000..a=rtpmap:101 telephone-event/8</div><div>&nbsp; 000..a=fmtp:101 0-15..a=sendrecv..a=nortpproxy:yes..a=nortpproxy:yes..</div><div>#</div><div>U 10.10.1.223:5060 -&gt; 10.10.1.230:5060</div><div>&nbsp; SIP/2.0 100 Trying..Via: SIP/2.0/UDP 10.10.1.230;branch=z9hG4bK1ef6.c9d52d72.1..Via: SIP/2.0/UDP 10.10.1.144:5060</div><div>&nbsp; ;branch=z9hG4bK116d554d..Record-Route: &lt;sip:10.10.1.230;lr=on;nat=yes;nat=yes&gt;..From: "Line1" &lt;sip:5022441011@fs2000.</div><div>&nbsp; testnet.net&gt;;tag=00082166efcb002153bc0a31-20004ffd..To: &lt;sip:1001@fs2000.testnet.net;user=phone&gt;..Call-ID: 00082166-</div><div>&nbsp; efcb0013-692f44d9-6760a891@10.10.1.144..CSeq: 101 INVITE..User-Agent: FreeSWITCH-mod_sofia/1.0.head-git-f17e962 2011</div><div>&nbsp; -04-19 03-05-32 -0400..Content-Length: 0....</div><div>#</div><div>U 10.10.1.223:5060 -&gt; 10.10.1.230:5060</div><div>&nbsp; SIP/2.0 407 Proxy Authentication Required..Via: SIP/2.0/UDP 10.10.1.230;branch=z9hG4bK1ef6.c9d52d72.1..Via: SIP/2.0/U</div><div>&nbsp; DP 10.10.1.144:5060;branch=z9hG4bK116d554d..From: "Line1" &lt;sip:5022441011@fs2000.testnet.net&gt;;tag=00082166efcb0021</div><div>&nbsp; 53bc0a31-20004ffd..To: &lt;sip:1001@fs2000.testnet.net;user=phone&gt;;tag=Ky0XB4gDeDy6F..Call-ID: 00082166-efcb0013-692f44d9</div><div>&nbsp; -6760a891@10.10.1.144..CSeq: 101 INVITE..User-Agent: FreeSWITCH-mod_sofia/1.0.head-git-f17e962 2011-04-19 03-05-32 -</div><div>&nbsp; 0400..Accept: application/sdp..Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, UPDATE, INFO, REGISTER, REFER, NOTIFY,</div><div>&nbsp; &nbsp;PUBLISH, SUBSCRIBE..Supported: timer, precondition, path, replaces..Allow-Events: talk, hold, presence, dialog, line-se</div><div>&nbsp; ize, call-info, sla, include-session-description, presence.winfo, message-summary, refer..Proxy-Authenticate: Digest rea</div><div>&nbsp; lm="fs2000.testnet.net", nonce="8769298b-c52d-43b8-b69c-6ebf26f3184d", algorithm=MD5, qop="auth"..Content-Length: 0...</div><div>&nbsp; .</div><div>#</div><div>U 10.10.1.230:5060 -&gt; 10.10.1.223:5060</div><div>&nbsp; ACK sip:1001@fs2000.testnet.net;user=phone SIP/2.0..Via: SIP/2.0/UDP 10.10.1.230;branch=z9hG4bK1ef6.c9d52d72.1..From: "Line1" &lt;sip:5022441011@fs2000.testnet.net&gt;;tag=00082166efcb002153bc0a31-20004ffd..To: &lt;sip:1001@fs2000.testnet.n</div><div>&nbsp; et;user=phone&gt;;tag=Ky0XB4gDeDy6F..Call-ID: 00082166-efcb0013-692f44d9-6760a891@10.10.1.144..Max-Forwards: 69..CSeq:</div><div>&nbsp; 101 ACK..Content-Length: 0....</div><div>#</div><div>U 10.10.1.230:5060 -&gt; 10.10.1.144:5060</div><div>&nbsp; SIP/2.0 503 Service unavailable: no more dst..Via: SIP/2.0/UDP 10.10.1.144:5060;branch=z9hG4bK116d554d..From: "Line1</div><div>&nbsp; " &lt;sip:5022441011@fs2000.testnet.net&gt;;tag=00082166efcb002153bc0a31-20004ffd..To: &lt;sip:1001@fs2000.testnet.net;user=p</div><div>&nbsp; hone&gt;;tag=a6a1c5f60faecf035a1ae5b6e96e979a-2c94..Call-ID: 00082166-efcb0013-692f44d9-6760a891@10.10.1.144..CSeq: 101</div><div>&nbsp; &nbsp;INVITE..Server: kamailio (3.1.2 (x86_64/linux))..Content-Length: 0....</div><div>#</div><div>U 10.10.1.144:51030 -&gt; 10.10.1.230:5060</div><div>&nbsp; ACK sip:1001@fs2000.testnet.net;user=phone SIP/2.0..Via: SIP/2.0/UDP 10.10.1.144:5060;branch=z9hG4bK116d554d..From</div><div>&nbsp; : "Line1" &lt;sip:5022441011@fs2000.testnet.net&gt;;tag=00082166efcb002153bc0a31-20004ffd..To: &lt;sip:1001@fs2000.testnet.ne</div><div>&nbsp; t;user=phone&gt;;tag=a6a1c5f60faecf035a1ae5b6e96e979a-2c94..Call-ID: 00082166-efcb0013-692f44d9-6760a891@10.10.1.144..D</div><div>&nbsp; ate: Thu, 02 Jun 2011 19:14:14 GMT..CSeq: 101 ACK..Content-Length: 0....</div></div><div><br></div><div><br></div><div>Gary Chen</div></div></body></html>