[OpenSIPS-Users] Some questions about module dispatcher.

Ben Newlin Ben.Newlin at genesys.com
Fri Mar 29 09:02:50 EDT 2019

Yes, something just like that.

For the algorithm, you’re right that example is in the documentation, but that usage is not actually described as being possible in the documentation. I guess it is declaring a different algorithm for each set provided for the query? Some documentation update may be in order there. Apologies for the incorrect response.

Ben Newlin

From: Users <users-bounces at lists.opensips.org> on behalf of Алексей Хамстр <homstr at gmail.com>
Reply-To: OpenSIPS users mailling list <users at lists.opensips.org>
Date: Friday, March 29, 2019 at 8:46 AM
To: OpenSIPS users mailling list <users at lists.opensips.org>
Subject: Re: [OpenSIPS-Users] Some questions about module dispatcher.

Thankyou, Ben, for such quick answer )))
this example ds_select_dst ("part4 : 2,3", "0,1", "fuD M 5, fuS M 2"); is from documentation/ and i thought that somebody had some expirience.

You mean something like this? I took it from examples generated by "make menuconfig", but there is no any "F" :'-(
i will try. Thankyou ))))
    if ( !ds_select_dst("1","0") ) {
                send_reply("500","No Destination available");
route[RELAY] {
        if (!t_relay()) {
failure_route[GW_FAILOVER] {
        if (t_was_cancelled()) {
        # failure detection with redirect to next available trunk
        if (t_check_status("(408)|([56][0-9][0-9])")) {
                xlog("Failed trunk $rd/$du detected \n");
                if ( ds_next_dst() ) {
                send_reply("500","All GW are down");

пт, 29 мар. 2019 г. в 13:22, Ben Newlin <Ben.Newlin at genesys.com<mailto:Ben.Newlin at genesys.com>>:

I don’t think the second parameter (algorithm) will accept multiple values as you have. You are indicating that you want to hash over both the call-id and the from uri, which I don’t think is possible. You must choose one.

For the failover, it is described in the documentation [1]: “If the character 'f' in 'flags' is set, the rest of the addresses from the destination set is stored in AVP list. You can use 'ds_next_dst()' to use next address to achieve serial forking to all possible destinations.” So you need to use a failure_route [2] and arm it before you send the request [3]. Then in the failure route you would check the code that was returned [4] and if appropriate use ds_next_dst to select another endpoint to try and send the request back out.

I cannot answer about the “first_hit_counter, I’ve never looked at that before. I will say that we use the dispatcher module to send a lot of traffic and we have never had to reset it or anything, so it is either vary large or the module must handle it.

[1] - https://opensips.org/html/docs/modules/2.4.x/dispatcher.html#func_ds_select_dst<https://opensips.org/html/docs/modules/2.4.x/dispatcher.html#func_ds_select_dst>
[2] - https://www.opensips.org/Documentation/Script-Routes-2-4<https://www.opensips.org/Documentation/Script-Routes-2-4>
[3] - https://opensips.org/html/docs/modules/2.4.x/tm.html#func_t_on_failure<https://opensips.org/html/docs/modules/2.4.x/tm.html#func_t_on_failure>
[4] - https://opensips.org/html/docs/modules/2.4.x/tm.html#func_t_check_status<https://opensips.org/html/docs/modules/2.4.x/tm.html#func_t_check_status>

Ben Newlin

From: Users <users-bounces at lists.opensips.org<mailto:users-bounces at lists.opensips.org>> on behalf of Алексей Хамстр <homstr at gmail.com<mailto:homstr at gmail.com>>
Reply-To: OpenSIPS users mailling list <users at lists.opensips.org<mailto:users at lists.opensips.org>>
Date: Friday, March 29, 2019 at 8:05 AM
To: "users at lists.opensips.org<mailto:users at lists.opensips.org>" <users at lists.opensips.org<mailto:users at lists.opensips.org>>
Subject: [OpenSIPS-Users] Some questions about module dispatcher.

I wanted to ask, if anybody have some extra information about function
ds_select_dst ("part4 : 2,3", "0,1", "fuD M 5, fuS M 2");
Please, any examples will be appreciated. :-)
How is this working, when we have such komplex parameters? I need to set up
failover in case of any error on my "Active" destinations. For example, what if yate1 have  an error in isdn channel and giving me back code 480, or 500? I need to try next  destination in this case.
And another one question. How big could be "first_hit_counter"?  Maybe i bether sould reset it by cron?

lets say, I have a two gateways
        SET:: 1
                URI:: sip:<> state=Active first_hit_counter=1828
                URI:: sip:<> state=Active first_hit_counter=1849
root at sipproxy1:/home/it# opensipsctl dispatcher show
dispatcher gateways
| id | setid | destination            | socket | state | weight | priority | attrs | description           |
|  1 |     1 | sip:<> |        |     0 | 0      |        1 |       | YATE1    |
|  3 |     1 | sip:<> |        |     0 | 0      |        1 |       | YATE2    |

Users mailing list
Users at lists.opensips.org<mailto:Users at lists.opensips.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20190329/e5ed5f56/attachment-0001.html>

More information about the Users mailing list