[SR-Users] Writing a module
Olle E. Johansson
oej at edvina.net
Tue Aug 20 13:35:38 CEST 2013
20 aug 2013 kl. 13:33 skrev Grant Bagdasarian <GB at cm.nl>:
> It's going to be a custom routing module, with our own business logic.
>
> It should load the routes from a database and keep refreshing the data every x interval.
> For SIP-to-PSTN calls (outgoing to carrier) we need to be able to route based on the callerprefix, customer id (which is added as a custom header), originating IP, and some other fields.
> I need a way to select the closest matching route, or fallback to the default route, using the fields described above.
>
> Implementing this logic in a stored procedure is quite hard. Another option would be to write a web service and perform http calls to determine the route. I'm just worried that http might delay the setup of calls.
>
> Our routes table contains custom fields, but also fields which are used by the dispatcher module. So once a route is selected, the dispatcher module will use the uri in the route set to rewrite the ruri and possibly do failover.
On first look, I think you really should consider Alex proposal to see if you can get this done with the standard configuration
and existing modules. You might want a cron-script that refreshes htables, dispatcher tables or avp's loaded from database,
but I fail to see that it can't be done with existing logic.
/O
>
> -----Original Message-----
> From: sr-users-bounces at lists.sip-router.org [mailto:sr-users-bounces at lists.sip-router.org] On Behalf Of Alex Balashov
> Sent: Tuesday, August 20, 2013 12:43 PM
> To: sr-users at lists.sip-router.org
> Subject: Re: [SR-Users] Writing a module
>
> On 08/20/2013 06:41 AM, Grant Bagdasarian wrote:
>
>> Hello,
>>
>> Is this page still up-to-date:
>> http://www.kamailio.org/dokuwiki/doku.php/development:write-module ?
>>
>> I'm researching what it takes to create our own custom Kamailio module.
>
> 1. Skilled C programming.
>
> 2. What do you want to accomplish? Are you sure no combination of existing modules and script constructs fit the bill?
>
> Sometimes you really do need a custom module. But I find those cases to be relatively few, at least for applications of Kamailio that are not truly exotic.
>
> -- Alex
>
> --
> Alex Balashov - Principal
> Evariste Systems LLC
> 235 E Ponce de Leon Ave
> Suite 106
> Decatur, GA 30030
> United States
> Tel: +1-678-954-0670
> 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 http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
More information about the sr-users
mailing list