<div dir="ltr">Hello. I thry to integrate redis for location module and first at all that I do - dublicate location to redis.<br><br>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?<br><br>My cfg part of creation branches is:<br>First of all I create massive of needed endpoints and then create branches as bellow.<br><br>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.<br><br>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.<br><br>Thanks for help.<br><br><br><br><div><span class="" style="white-space:pre">                            </span>$var(k)=0;</div><div><span class="" style="white-space:pre">                         </span>xlog("L_INFO", "request URI is $ru");</div><div><span class="" style="white-space:pre">                          </span>while ($var(k)<= $var(j)){</div><div><span class="" style="white-space:pre">                              </span></div><div><span class="" style="white-space:pre">                                   </span>if ($(avp(device_contact)[$var(k)])=~"device"){</div><div><span class="" style="white-space:pre">                                          </span>xlog("L_INFO", "This is a classic UDP call to endpoint");</div><div><span class="" style="white-space:pre">                                              </span>if ($(avp(device_received)[$var(k)])==""){</div><div><span class="" style="white-space:pre">                                                       </span>xlog("L_INFO", "Received string is EMPTY");</div><div><span class="" style="white-space:pre">                                                    </span>$du="sip:"+$(avp(device_contact[$var(k)]){s.select,1,@});</div><div><span class="" style="white-space:pre">                                                </span>}</div><div><span class="" style="white-space:pre">                                          </span>else</div><div><span class="" style="white-space:pre">                                               </span>{</div><div><span class="" style="white-space:pre">                                                  </span>xlog("L_INFO", "Received string is {$avp(device_received)[$var(k)]}");</div><div><span class="" style="white-space:pre">                                                 </span>$du=$(avp(device_received)[$var(k)]);</div><div><span class="" style="white-space:pre">                                              </span>}</div><div><span class="" style="white-space:pre">                                          </span>$var(UDP_contact)="sip:"+$(avp(device_contact[$var(k)]){s.select,1,@});</div><div><span class="" style="white-space:pre">                                          </span></div><div><span class="" style="white-space:pre">                                           </span>append_branch("sip:$tU@$(du{s.select,1,:})","0.3");</div><div><span class="" style="white-space:pre">                                            </span></div><div><span class="" style="white-space:pre">                                           </span>xlog("L_INFO","Classic Destination URI is {$(avp(device_contact[$var(k)]){s.select,1,@})} for {$tU}}. Destination is {$du}\n");</div><div><span class="" style="white-space:pre">                                        </span>}</div><div><span class="" style="white-space:pre">                          </span>$var(k) = $var(k) + 1;</div><div><span class="" style="white-space:pre">                                             </span></div><div><span class="" style="white-space:pre">                           </span>}</div><div><span class="" style="white-space:pre">                          </span></div><div><span class="" style="white-space:pre"><br></span></div><div><span class="" style="white-space:pre"><br></span></div><div><span class="" style="white-space:pre"><br></span></div><div><span class="" style="white-space:pre">                              </span>$var(k)=0;</div><div><span class="" style="white-space:pre">                         </span>xlog("L_INFO", "request URI is $ru");</div><div><span class="" style="white-space:pre">                          </span>while ($var(k)<=$var(j)){</div><div><span class="" style="white-space:pre">                               </span></div><div><span class="" style="white-space:pre">                                   </span>if ($(avp(device_contact)[$var(k)])=~"transport=ws"){</div><div><span class="" style="white-space:pre">                                            </span>xlog("L_INFO", "This is a classic UDP call to endpoint");</div><div><span class="" style="white-space:pre">                      </span></div><div><span class="" style="white-space:pre">                                           </span>xlog("L_INFO", "Received string is {$avp(device_received)[$var(k)]}");</div><div><span class="" style="white-space:pre">                                         </span>$du=$(avp(device_received)[$var(k)]);</div><div><span class="" style="white-space:pre">                                              </span></div><div><span class="" style="white-space:pre">                                           </span>append_branch("sip:$tU@$(du{s.select,1,:})","0.7");</div><div><span class="" style="white-space:pre">                                            </span></div><div><span class="" style="white-space:pre">                                           </span>xlog("L_INFO","Classic Destination URI is {$(avp(device_contact[$var(k)]){s.select,1,@})} for {$tU}}. Destination is {$du}\n");</div><div><span class="" style="white-space:pre">                                        </span>}</div><div><span class="" style="white-space:pre">                          </span>$var(k) = $var(k) + 1;<span class="" style="white-space:pre">    </span></div><div><span class="" style="white-space:pre">                                           </span></div></div>