[SR-Users] t_suspend usage in branch_route

Aymeric Moizard amoizard at gmail.com
Thu Feb 8 23:33:49 CET 2018


Hi,

I ended up using ts_store and ts_append as this seems to be more convenient.

I guess t_suspend was not built to support what I tried. May be the
documentation
should be changed to indicate that it should be used only in request route
block
(and may be reply route block), but not in branch.

I was able to loop over the destination URI in the request route block
after my lookup
by using $ru for the main branch, and $(branch(uri)[$var(i)] for all the
others.

It worked perfectly!

Tks,
Aymeric
www.antisip.com

2018-02-08 17:04 GMT+01:00 Aymeric Moizard <amoizard at gmail.com>:

>
>
> 2018-02-08 16:25 GMT+01:00 Vasiliy Ganchev <vancecezar at gmail.com>:
>
>> Hi!
>>
>> Tks for answering!
>
>
>
>> I am not sure that t_suspend is expected to work from branch_route.
>>
>> Why not suspend it from the main route?
>>
>> Describe in more details what are you going to achieve with the suspend.
>>
>
> Objective:
> I'm working on implementing a configuration to support push notification
> for mobile devices.
> Those devices are sending REGISTER with push information inside the
> URI-PARAMS of
> the Contact header.
>
> My way to acheive it:
> I have a "location" database containing many "Contact" headers for a UA.
>
> Some of those destinations  don't have the "push" informations and I want
> to forward
> the INVITE to them.
> Some of those destinations has "push" information in the URI: such as
> pn-provider, pn-param, pn-prid.
> I consider those UA as not available and don't want to forward the INVITE
> to them. In the
> branch route, I have this code:
>
> branch_route[MANAGE_BRANCH]
> {
>   if (!strempty($(ru{uri.param,pn-provider})) &&
> !strempty($(ru{uri.param,pn-param})) && !strempty($(ru{uri.param,pn-prid})))
> {
>     if ($(ru{uri.param,pn-provider}) == "fcm" && $(ru{uri.param,pn-param})
> == "xxxxxxxxx") {
>       route(SENDPUSH);
>     }
>   }
>
>   route(INVITETOFORWARD);
> }
>
> It's very easy to check for each branch the URI parameters of $ru. So I
> can send a PUSH NOTIFICATION to every
> one of them.
>
> Tks!
> Aymeric
>
>
>> cheers
>>
>>
>>
>> --
>> Sent from: http://sip-router.1086192.n5.nabble.com/Users-f3.html
>>
>> _______________________________________________
>> Kamailio (SER) - Users Mailing List
>> sr-users at lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>
>
>
> --
> Antisip - http://www.antisip.com
>



-- 
Antisip - http://www.antisip.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20180208/7b013d85/attachment-0001.html>


More information about the sr-users mailing list