[SR-Users] Asterisk and dispatcher

SamyGo govoiper at gmail.com
Thu Jan 24 07:29:25 CET 2013


Except that I find missing curly brackets for the if() condition which will
always return 1/positive.


On Wed, Jan 23, 2013 at 10:26 PM, SamyGo <govoiper at gmail.com> wrote:

> Hi,
>
> You've metioned this already in your code:
>
> if(ds_is_from_list("1"))
>
> Is this not working for you?
>
> Regards,
> Sammy
>
>
>
> On Wed, Jan 23, 2013 at 10:44 AM, Ian French <fretec at gmail.com> wrote:
>
>> Hi,
>>>     I've been working my way through this tutorial (
>>> http://kb.asipto.com/asterisk:realtime:kamailio-3.0.x-asterisk-1.6.2-astdb)
>>> and all it working well thanks. In the other benifits section you mention
>>> that this configuration can be used with multiple instances of Asterisk.
>>> I've configured my [TOASTERISK] route
>>
>>
>> route[TOASTERISK] {
>>                 ds_select_dst("1","4");
>>                 $sht(forw=>$ft)=$du;
>>                 sl_send_reply("100","Trying");
>>         xlog("L_INFO","INVITE: INVITE [$tU] Passed to [$du] Asterisk
>> Cluster [$rm:$au].\n");
>>         route(RELAY);
>>         exit;
>>
>> How can i achieve the same for my [FROMASTERISK] route as now with
>>
>> asterisk.bindip = "x.x.x.x" desc "Asterisk IP Address"
>> asterisk.bindport = "5060" desc "Asterisk Port"
>>
>> and
>>
>> route[FROMASTERISK] {
>>         if($si==$sel(cfg_get.asterisk.bindip)
>>                            && $sp==$sel(cfg_get.asterisk.bindport))
>>                 xlog("L_INFO","INVITE: INVITE Passed From [$fu] Asterisk
>> Cluster To [$rm:$au].\n");
>>                 return 1;
>>         return -1;
>> }
>>
>> This allows calls only from cfg_get.asterisk.bindip (single gateway)
>> where I would like gateways in the dispatcher list to be selected and
>> marked as a positive match
>>
>> if(ds_is_from_list("1"))
>> $sht(forw=>$ft)=$si;
>>                 xlog("L_INFO","INVITE: INVITE Passed From [$fu] Asterisk
>> Cluster To [$rm:$au].\n");
>>                 return 1;
>>            return -1;
>> }
>>
>> Can you help?
>>
>> Thanks in advance
>> Ian
>> _______________________________________________
>> 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
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20130123/5d18521f/attachment.htm>


More information about the sr-users mailing list