Hi,

You can configure Kamailio with dispatcher to an behavior like you want.

I personal would not set an destination to IP on 500 but that depends on
your needs.

Kind regards

Jawaid Bazyar <[email protected]> schrieb am Di., 14. März 2023, 00:41:

> Hi,
>
> Maybe it would be easier to explain my expectations on how it's supposed
> to work, and then you can tell me where I'm making a wrong assumption __
>
> So, load balancers like haproxy etc perform "health checks" on the service
> being balanced. In this case, I have it setup for Kamailio to send OPTIONS
> and I do in fact see those packets and 200 OK responses. And if haproxy
> sees a host is down, it immediately stops trying to send client requests to
> that host.
>
> In this case, after 10 successful OPTIONS pings, Kamailio marks the
> destination as AP and everything is fine, Kamailio correctly returns the
> destination in ds_select_dst.
>
> I have the settings below, so that if the service misses 5 OPTIONS checks,
> Kamailio should mark that destination as "inactive".
> But, it should keep probing it, so Kamailio can detect when the
> destination comes back up. So as I understand it, that's the status "IP".
>
> And, Kamailio should stop including that destination in the responses from
> ds_select_dst().
>
> And all of that is behaving as expected, EXCEPT that last bit -
> ds_select_dst continues to include the IP (inactive) destination in
> responses.
>
> I added
>
>                 ds_mark_dst("ip");
>
> in the event of a 500 or branch failure response, but I don't understand
> why this is needed, because the destination is already in "IP" mode.
>
> So seemingly Kamailio knows the destination is inactive, but ds_select_dst
> isn't acting on it unless I manually mark the target also.
>
> Perhaps I am overlooking an option?
>
> Regards,
>
> Jawaid
>
>
> On 3/13/23, 9:51 AM, "Henning Westerholt" <[email protected] <mailto:
> [email protected]>> wrote:
>
>
> Hello,
>
>
> probing means in this context sending OPTIONS pings, yes.
>
>
> In mode 1 you can disable the probing by setting flag 4 to the destination
> in the dispatcher file, according to the docs.
>
>
> Cheers,
>
>
> Henning
>
>
> -----Original Message-----
> From: Henning Westerholt <[email protected] <mailto:[email protected]>>
> Sent: Montag, 13. März 2023 15:55
> To: Kamailio (SER) - Users Mailing List <[email protected]
> <mailto:[email protected]>>
> Subject: [SR-Users] Re: Dispatcher behavior
>
>
> Hello,
>
>
> not sure what the "auto-probing" mode is, but you can configure the
> dispatcher OPTIONS ping behaviour with that parameter:
>
>
>
> https://kamailio.org/docs/modules/5.5.x/modules/dispatcher.html#dispatcher.p.ds_probing_mode
> <
> https://kamailio.org/docs/modules/5.5.x/modules/dispatcher.html#dispatcher.p.ds_probing_mode
> >
>
>
> Cheers,
>
>
> Henning
>
>
> -----Original Message-----
> From: Jawaid Bazyar <[email protected] <mailto:[email protected]>>
> Sent: Montag, 13. März 2023 14:33
> To: Kamailio (SER) - Users Mailing List <[email protected]
> <mailto:[email protected]>>
> Subject: [SR-Users] Re: Dispatcher behavior
>
>
> Hi Alex,
>
>
> I don't see "auto-probing" in the documentation.. here is my dispatcher
> config that I snatched from somewhere on the Internet.
>
>
> modparam("dispatcher", "db_url", "mysql://xxxxxxx/kamailio") #Use DBURL
> variable for database parameters
> modparam("dispatcher", "flags", 2) # If flag 2 is set, then the failover
> support is enabled.
> modparam("dispatcher", "table_name", "dispatcher")
> modparam("dispatcher", "ds_ping_interval", 5) #How often to ping
> destinations to check status
> modparam("dispatcher", "ds_ping_method", "OPTIONS") #Send SIP Options ping
> modparam("dispatcher", "ds_probing_threshold", 5) #How many failed pings
> in a row do we need before we consider it down
> modparam("dispatcher", "ds_inactive_threshold", 10) #How many sucessful
> pings in a row do we need before considering it up
> modparam("dispatcher", "ds_ping_latency_stats", 1) #Enables stats on
> latency
> modparam("dispatcher", "ds_probing_mode", 1) #Keeps pinging gateways when
> state is known (to detect change in state)
>
>
>
>
>
>
> On 3/12/23, 8:28 PM, "Alex Balashov" <[email protected] <mailto:
> [email protected]> <mailto:[email protected] <mailto:
> [email protected]>>> wrote:
>
>
>
>
> Unless you have auto-probing enabled, yes.
>
>
>
>
> > On Mar 12, 2023, at 9:14 PM, Jawaid Bazyar <[email protected] <mailto:
> [email protected]> <mailto:[email protected] <mailto:[email protected]>>>
> wrote:
> >
> > Hi, is this expected behavior?
> > I have two target hosts in a dispatcher set, 10.20.20.118 (prio 5) and
> 10.20.20.252 (prio 10).
> > When I have 10.20.20.252 turned off, dispatcher still tries to send
> packets to that host, even when the status flags are IP.
> > root@vs-rs01:/etc/kamailio# kamcmd dispatcher.list {
> > NRSETS: 1
> > RECORDS: {
> > SET: {
> > ID: 1
> > TARGETS: {
> > DEST: {
> > URI: sip:10.20.20.252:5060
> > FLAGS: IP
> > PRIORITY: 10
> > LATENCY: {
> > AVG: 0.000000
> > STD: 0.000000
> > EST: 0.000000
> > MAX: 0
> > TIMEOUT: 62
> > }
> > }
> > DEST: {
> > URI: sip:10.20.20.118:5060
> > FLAGS: AP
> > PRIORITY: 5
> > LATENCY: {
> > AVG: 3.876000
> > STD: 2.965000
> > EST: 5.058000
> > MAX: 14
> > TIMEOUT: 0
> > }
> > }
> > }
> > }
> > }
> > }
> > __________________________________________________________
> > Kamailio - Users Mailing List - Non Commercial Discussions To
> > unsubscribe send an email to [email protected] <mailto:
> [email protected]>
> > <mailto:[email protected] <mailto:
> [email protected]>>
> > Important: keep the mailing list in the recipients, do not reply only to
> the sender!
> > Edit mailing list options or unsubscribe:
>
>
>
>
>
>
>
>
> --
> Alex Balashov
> Principal Consultant
> Evariste Systems LLC
> Web: https://evaristesys.com <https://evaristesys.com> <
> https://evaristesys.com> <https://evaristesys.com&gt;>
> Tel: +1-706-510-6800
>
>
>
>
> __________________________________________________________
> Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe
> send an email to [email protected] <mailto:
> [email protected]> <mailto:
> [email protected] <mailto:
> [email protected]>>
> Important: keep the mailing list in the recipients, do not reply only to
> the sender!
> Edit mailing list options or unsubscribe:
>
>
>
>
>
>
>
>
> __________________________________________________________
> Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe
> send an email to [email protected] <mailto:
> [email protected]>
> Important: keep the mailing list in the recipients, do not reply only to
> the sender!
> Edit mailing list options or unsubscribe:
> __________________________________________________________
> Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe
> send an email to [email protected] <mailto:
> [email protected]>
> Important: keep the mailing list in the recipients, do not reply only to
> the sender!
> Edit mailing list options or unsubscribe:
>
>
>
>
> __________________________________________________________
> Kamailio - Users Mailing List - Non Commercial Discussions
> To unsubscribe send an email to [email protected]
> Important: keep the mailing list in the recipients, do not reply only to
> the sender!
> Edit mailing list options or unsubscribe:
>
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the 
sender!
Edit mailing list options or unsubscribe:

Reply via email to