[SR-Users] dispatcher: set $du in failure_route

Grant Bagdasarian GB at cm.nl
Fri Sep 20 10:03:02 CEST 2013


Hello,

Thank you for the idea!

When executing my stored procedure to select the route, one of my columns is built up like below.

('routeid='+ CAST(ID AS NVARCHAR(MAX)) + ',' + 'terminatingsbcaddress=' + TerminatingSBCAddress + ',' + Attributes) AS Attributes

This gives me the already set attributes for the route, but also adds two additional key value pairs to the column.

I should be able to store the values in avp's right? And access them later in failure_route? The terminatingsbcaddress key stores the address which is used to reset the $du value.

The less queries I can perform, the better.

If this is possible, how do I extract the terminatingsbcaddress from this column and store it in an AVP? I've never worked with AVP's before.
I know I have to start by doing:
$var(attributes) = $dbr(vd_query_result=>[0,0]);

If this is not possible, is there a way to insert this piece of SQL into the query the dispatcher executes to load its table, so that the attrs_avp is filled with these additional values?
I couldn't find the SQL which was executed by the dispatcher in the source code.

From: sr-users-bounces at lists.sip-router.org [mailto:sr-users-bounces at lists.sip-router.org] On Behalf Of Daniel-Constantin Mierla
Sent: Thursday, September 19, 2013 9:11 PM
To: Kamailio (SER) - Users Mailing List
Subject: Re: [SR-Users] dispatcher: set $du in failure_route


On 9/18/13 4:53 PM, Grant Bagdasarian wrote:
My Dispatcher table has been extended with more columns and also functions as our routing table.
I've modified the names of the columns Dispatcher uses to match the columns of the routing table.
One of the columns contains the address which is used to set the $du value.
So, for every request I'm executing a stored procedure using sqlops to select the address of the SBC (for $du) and the set id to use for the dispatcher.

If I'm correct, the dispatcher table is loaded into memory once Kamailio is started or the table is reloaded.
In case the first destination fails, how would I get the address of the next SBC to reset the $du value in failure_route?
I think I can do it using the setid and the next priority, but how do I access these two values in failure_route?

Are there any other solutions to this, perhaps other modules with similar functionality as the dispatcher module?

The setid and next hop address are stored in AVPs, the names of the avps are set via module parameters. See readme starting at:

http://kamailio.org/docs/modules/stable/modules/dispatcher.html#idp15216488

In failure route, before calling ds_next_*(), the first avps store the values used for next destination. You can probably use them for your db query.

Cheers,
Daniel



From: sr-users-bounces at lists.sip-router.org<mailto:sr-users-bounces at lists.sip-router.org> [mailto:sr-users-bounces at lists.sip-router.org] On Behalf Of Alex Balashov
Sent: Wednesday, September 18, 2013 4:23 PM
To: Kamailio (SER) - Users Mailing List
Subject: Re: [SR-Users] dispatcher: set $du in failure_route

Of course.
Grant Bagdasarian <GB at cm.nl<mailto:GB at cm.nl>> wrote:
Hello,


Can the $du value also be set in a failure_route? For instance in the case the first destination fails.


I'm currently setting the $du value before I'm calling the ds_next_domain function in request_route.
We have multiple carriers which are connected to different SBCs.


In case $du is not re-set in failure_route, Kamailio will try to send the INVITE to the carrier directly, bypassing the SBC, correct?


Regards,


Grant

________________________________



SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list

sr-users at lists.sip-router.org<mailto:sr-users at lists.sip-router.org>

http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users

--
Sent from my mobile, and thus lacking in the refinement one might expect from a fully fledged keyboard.

Alex Balashov - Principal
Evariste Systems LLC
235 E Ponce de Leon Ave
Suite 106
Decatur, GA 30030
United States
Tel: +1-678-954-0671
Web: http://www.evaristesys.com/, http://www.alexbalashov.com




_______________________________________________

SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list

sr-users at lists.sip-router.org<mailto:sr-users at 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 Advanced Trainings - Berlin, Oct 21-24; Miami, Nov 11-13, 2013

  - more details about Kamailio trainings at http://www.asipto.com -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20130920/3b1fe4fb/attachment-0001.html>


More information about the sr-users mailing list