Hi Daniel,

 

I figured out some difference after the post, I am going to detail and clarify the process again, might need your help!

If any misunderstand pls advise, tks!

 

 

I would like to activate Dispatcher module for apply Load Balance functionality purpose.

but it's been hard to complete so far, I wonder if anyone got any advise with my situation described in below.

 

#########################################################################################################

 

we have 2 Kamailios, the version is 4.3.3; both UAC are Linphone Version 3.9.1, SIP transport protocol UDP;

we use domain for the SIP registration.

 

we want to make Kamailios work in double active mode for SIP load balancing,

we use "F5 Local Traffic Manager" to do the FQDN round robin to implement load balancing.

I have put the "route(DISPATCH) b4 PSTN in request_route.

call has eventually ended with unknown status, the caller INVITE had never got arrived to callee,

caller's UAC ended with appearing authentication dialog, and the call disconect.

 

The call process detailed as below:

 

when UAC-A trying to call UAC-B, UAS-A got INVITE and returned 407 back to UAC-A,

UAC-A sent ACK and then another INVITE carrying proxy auth toward UAS-A,

and after that, UAS-A has sent INVITE to UAS-B, but UAS-B return with the code 407 to UAS-A,

call has eventually ended with unknown status, the caller INVITE had never got arrived to callee,

caller's UAC ended with appearing authentication dialog, and the call disconect.

 

Is the configuration has to be set to "UAS-B accepting INVITE of UAS-A"?

or the UAS-A should carrying the auth info into UAS-B?

or I missed anything in the configuration?

 

 

 

UAC-A              UAS-A               UAS-B              UAC-B

|───INVITE UAC-B@domain────|                |                |

|                 |                |                |

|←──────407────────|                |                |

|                 |                |                |

|────── ACK───────→|                |                |

|                 |                |                |

|──INTITE UAC-B@domain(auth)─→|                |                |

|                 |                |                |

|←──────100────────|───INVITE UAC-B@domain ──→|                |

|                 |                |                |

|                 |←────── 407───────|                |

|                 |                |                |

|                 |─────── ACK──────→|                |

|                 |                |                |

|←──────407────────|                |                |

|                 |                |                |

|───────ACK───────→|                |                |

|                 |                |                |

|──INTITE UAC-B@domain(auth)─→|                |─────GOT NOTHING ────→|

|                 |                |                |

|←──────407────────|                |                |

|                 |                |                |

|───────ACK───────→|                |                |

|                 |                |                |

 

 

 

407:Proxy Authentication Required

100:Trying

 

#########################################################################################################

 

#detail configuration as below.

 

#########################################################################################################

 

#dispatcher.list

 

# $Id$

# dispatcher destination sets

#

 

# line format

# setit(int) destination(sip uri) flags(int,opt) priority(int,opt) attributes(str,opt)

 

#UAS-A

1 sip:10.243.91.4:5060 2

 

#UAS-B

1 sip:10.243.91.5:5060 2

 

#########################################################################################################

 

#dispatcher params

 

modparam("dispatcher", "list_file", "/usr/local/etc/kamailio/dispatcher.list")

modparam("dispatcher", "flags", 3)

modparam("dispatcher", "dst_avp", "$avp(AVP_DST)")

modparam("dispatcher", "grp_avp", "$avp(AVP_GRP)")

modparam("dispatcher", "cnt_avp", "$avp(AVP_CNT)")

modparam("dispatcher", "sock_avp", "$avp(AVP_SOCK)")

modparam("dispatcher", "ds_ping_interval", 30)

modparam("dispatcher", "ds_ping_from", "sip:kamailio1@awesomedomain.com")

modparam("dispatcher", "ds_ping_method", "OPTIONS")

modparam("dispatcher", "ds_probing_mode", 1)

modparam("dispatcher", "ds_probing_threshold", 1)

 

#########################################################################################################

 

#DISPATCHER Routing

 

route[DISPATCH] {

# round robin dispatching on gateways group '1'

        if(!ds_select_dst("1", "4")) {

                send_reply("404", "No destination");

                exit;

                }

        xdbg("--- SCRIPT: going to <$ru> via <$du>\n");

        t_on_failure("RTF_DISPATCH");

        route(RELAY);

        exit;

        }

# Re-route in case of failure

failure_route[RTF_DISPATCH] {

        if (t_is_canceled()) {

        exit;

        }

 

# next node - only for 500 or local timeout

        if (t_check_status("500") || (t_branch_timeout() && !t_branch_replied())) {

                if(ds_next_dst()) {

                        t_on_failure("RTF_DISPATCH");

                        route(RELAY);

                        exit;

                }

        }

}

 

 

 

Best Regards,

Rex Lin (林昱頡)

 

From: sr-users [mailto:sr-users-bounces@lists.sip-router.org] On Behalf Of Daniel-Constantin Mierla
Sent: Monday, March 28, 2016 5:34 PM
To: Kamailio (SER) - Users Mailing List <sr-users@lists.sip-router.org>
Subject: Re: [SR-Users] Kamailio Dispatcher error msg 407

 

Hello,

it is not very clear -- is that the INVITE is replied with 4017 by one server (A) and them the client is resending the INVITE with credentials, but it gets to the other server (B)?

You say that the 407 is getting to the other server, which is rather confusing how it may happen.

Cheers,
Daniel

On 25/03/16 05:19, Rex Lin (林昱頡) wrote:

Hi admins,

 

I'm kinda new in this group and I'm not quite sure if I'm posting in a correct way, advise if I'm wrong.

below is my post.

------------------------------------------------------------------------------------------------------------------------------------

 

I would like to activate Dispatcher module for apply Load Balance functionality purpose.

but it's been hard to complete so far, I wonder if you can give me some advise in below situation.

we have 2 Kamailios, the version is 4.3.3 ; we use domain for the SIP registration.

 

we want to make Kamailios work in double active mode for SIP load balancing,

we have a F5 to do the domain name round robin to make two UAC regitering under two UAS.

I have put the "route(DISPATCH) b4 PSTN in request_route.

when I try to make UAC-A call to UAC-B, it appears 407 proxy authentication required.

 

we wiresharked, UAS has sent INVITE to UAS-B, but UAS-B sent the error code 407 to UAS-A

Is the configuration has to be set to "UAS-B accepting INVITE of UAS-A" ?

or the UAS-A should carrying the auth info into UAS-B ?

 

detail configuration as below.

 

------------------------------------------------------------------------------------------------------------------------------------

dispatcher params

 

modparam("dispatcher", "list_file", "/usr/local/etc/kamailio/dispatcher.list")

modparam("dispatcher", "flags", 1)

modparam("dispatcher", "dst_avp", "$avp(AVP_DST)")

modparam("dispatcher", "grp_avp", "$avp(AVP_GRP)")

modparam("dispatcher", "cnt_avp", "$avp(AVP_CNT)")

modparam("dispatcher", "sock_avp", "$avp(AVP_SOCK)")

modparam("dispatcher", "ds_ping_interval", 30)

modparam("dispatcher", "ds_ping_from", "sip:kamailio1@awesomedomain.com")

modparam("dispatcher", "ds_ping_method", "OPTIONS")

modparam("dispatcher", "ds_probing_mode", 1)

modparam("dispatcher", "ds_probing_threshold", 1)

 

DISPATCHER Routing

 

route[DISPATCH] {

# round robin dispatching on gateways group '1'

        if(!ds_select_dst("1", "4")) {

                send_reply("404", "No destination");

                exit;

                }

        xdbg("--- SCRIPT: going to <$ru> via <$du>\n");

        t_on_failure("RTF_DISPATCH");

        route(RELAY);

        exit;

        }

# Re-route in case of failure

failure_route[RTF_DISPATCH] {

        if (t_is_canceled()) {

        exit;

        }

 

# next node - only for 500 or local timeout

        if (t_check_status("500") || (t_branch_timeout() && !t_branch_replied())) {

                if(ds_next_dst()) {

                        t_on_failure("RTF_DISPATCH");

                        route(RELAY);

                        exit;

                }

        }

}

 

Best Regards,

Rex Lin

 




_______________________________________________
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



-- 
Daniel-Constantin Mierla
http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio World Conference, Berlin, May 18-20, 2016 - http://www.kamailioworld.com