To answer my own question regarding the reset of the avp variable: avp_delete(name) did the trick.
Grant Bagdasarian |
Senior Developer |
|
From: sr-users <sr-users-bounces@lists.kamailio.org>
On Behalf Of Grant Bagdasarian
Sent: dinsdag 4 december 2018 15:33
To: Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org>
Subject: [SR-Users] Dispatcher clear dst_avp
Hello,
I’m trying to use multiple destination sets which may include the same destination.
For instance:
SET ID: 1
SET ID: 2
Whenever a new SIP INVITE is sent to the Kamailio instance it will use SET ID 1. If then for some reason this call attempt fails, failure_route will trigger and SET ID 2 will be used. At first glance this might not make any sense, but
there is some business logic behind this, but it’s not relevant for this case.
For some reason, the dst_avp variable still contains the destinations of SET ID 1 in failure_route.
Is there a built-in way to reset this variable for every call to ds_select_domain(), such that only the destinations of passed SET ID will be loaded into the avp?
I tried setting the avp to $null before calling ds_select_domain, but that had some undesirable effects.
The reason I’m asking this is the destinations the call is being sent to are Freeswitch instances, which will return a 482 Request Merged when the same INVITE is sent to the same Freeswitch within 4 seconds (default T4 timer).
I’m trying to match the previously selected destination in failure_route with the next destination and skip if they’re the same, or stop processing when they are the same and no more destinations are available.
I know I can mess with the T4 timer in Freeswitch and perhaps even sleep in failure route to deal with the 482 failure, but I rather fix this in a normal way.
Regards,
Grant Bagdasarian |
Senior Developer |