[sr-dev] append_branch. How to disable original URI

Yuriy Gorlichenko ovoshlook at gmail.com
Sat Apr 4 02:50:27 CEST 2015


Sorry. Not 487. 482 reply. merged request

2015-04-04 3:38 GMT+03:00 Yuriy Gorlichenko <ovoshlook at gmail.com>:

> 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 487 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;
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20150404/504f4fbd/attachment.html>


More information about the sr-dev mailing list