[SR-Users] append_branch. How to disable original URI

Daniel-Constantin Mierla miconda at gmail.com
Mon Apr 27 16:51:15 CEST 2015


Hello,

I added some functions and variables to make these operations easier.
The older version required to update the r-ruri branch and use
append_branch(), with keeping backup or uri branch attributes in order
to restore it.

Now you have to fill the $sbranch(attribute) variable and then use
either sbranch_push_ruri() or sbranch_append()

First function is overwriting the r-uri branch, perhaps what you are
looking for. See some examples at:

  -
http://kamailio.org/docs/modules/4.3.x/modules/pv.html#pv.f.sbranch_set_ruri

Let me know if works fine, as I didn't have time for extensive testing.

Cheers,
Daniel


On 17/04/15 16:23, Yuriy Gorlichenko wrote:
> Hello. I thry to integrate redis for location module and first at all
> that I do - dublicate location to redis.
>
> First At all I create analog of lookup procedure that use location but
> from redis. I take values from location and create branches by
> mannualy. All works good but branch route create dublicate of first
> branch. We talk about it already and I cnow that branch route creates
> first original Request and then create branches. So my question is how
> to disable creation of original URI?
>
> My cfg part of creation branches is:
> First of all I create massive of needed endpoints and then create
> branches as bellow.
>
> I create it with different сucles  "while" because websockets not
> blocked when creates dublicate INVITE, but some UDP endpoints can not
> take call because answer to kamailio 482 reply and CANCELs call. 
>
> It works fine when I logged on with wesocket device and UNP at one
> time. But when I logget with 2 UDP devices only this algorithm not worked.
>
> Thanks for help.
>
>
>
> $var(k)=0;
> xlog("L_INFO", "request URI is $ru");
> while ($var(k)<= $var(j)){
> if ($(avp(device_contact)[$var(k)])=~"device"){
> xlog("L_INFO", "This is a classic UDP call to endpoint");
> if ($(avp(device_received)[$var(k)])==""){
> xlog("L_INFO", "Received string is EMPTY");
> $du="sip:"+$(avp(device_contact[$var(k)]){s.select,1,@});
> }
> else
> {
> xlog("L_INFO", "Received string is {$avp(device_received)[$var(k)]}");
> $du=$(avp(device_received)[$var(k)]);
> }
> $var(UDP_contact)="sip:"+$(avp(device_contact[$var(k)]){s.select,1,@});
> append_branch("sip:$tU@$(du{s.select,1,:})","0.3");
> xlog("L_INFO","Classic Destination URI is
> {$(avp(device_contact[$var(k)]){s.select,1,@})} for {$tU}}.
> Destination is {$du}\n");
> }
> $var(k) = $var(k) + 1;
> }
>
>
>
> $var(k)=0;
> xlog("L_INFO", "request URI is $ru");
> while ($var(k)<=$var(j)){
> if ($(avp(device_contact)[$var(k)])=~"transport=ws"){
> xlog("L_INFO", "This is a classic UDP call to endpoint");
> xlog("L_INFO", "Received string is {$avp(device_received)[$var(k)]}");
> $du=$(avp(device_received)[$var(k)]);
> append_branch("sip:$tU@$(du{s.select,1,:})","0.7");
> xlog("L_INFO","Classic Destination URI is
> {$(avp(device_contact[$var(k)]){s.select,1,@})} for {$tU}}.
> Destination is {$du}\n");
> }
> $var(k) = $var(k) + 1;
>
>
> _______________________________________________
> 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

-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio World Conference, May 27-29, 2015
Berlin, Germany - http://www.kamailioworld.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20150427/33eabcc3/attachment.html>


More information about the sr-users mailing list