<div dir="ltr">I found INFO about "b" flag for rtpproxy-ng module. It may solve my porblem, but as I understand, rtpengine not support this flag.<br>I thought about adiing rtpproxy handling after append_branch (something like branch_route) but con not find any info how to use it after branching... Does anybody help me to solve this issue, or give me an advice about this issue? Thks</div><div class="gmail_extra"><br><div class="gmail_quote">2014-10-17 20:41 GMT+04:00 Yuriy Gorlichenko <span dir="ltr"><<a href="mailto:ovoshlook@gmail.com" target="_blank">ovoshlook@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Forget some things:<div>All calls going form asterisk viaUDP.<br>t_relay calling out of loop. At the end.</div><div><br></div><div>When t_relay at loop first packet goes great but INVITE to second destinationd not going and ended with ERROR "can't generate 200 reply when a final 200 was sent out"</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2014-10-17 20:33 GMT+04:00 Yuriy Gorlichenko <span dir="ltr"><<a href="mailto:ovoshlook@gmail.com" target="_blank">ovoshlook@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello. I try to do parallel  fork calls to endpoints that have same username and different destination URI. Logic of my script: <br>checking location table for rows with needed account<div>get info from contact at loop</div><div><br></div><div>for every step</div><div><br></div><div>check technology (sip or ws)<br>append_branch with existing destination for this account<br>rewrite packet with rtpengine to needed technology<br><br></div><div><br></div><div>forward packets via t_relay</div><div><br></div><div><br><br><div>sql_query("ca", "select contact from location where username='$tU'", "ra");</div><div><span style="white-space:pre-wrap">                       </span>xlog("rows: $dbr(ra=>rows) cols: $dbr(ra=>cols)\n");</div><div><span style="white-space:pre-wrap">                     </span></div><div><span style="white-space:pre-wrap">                 </span>if($dbr(ra=>rows)>0){</div><div><span style="white-space:pre-wrap">                              </span>$var(i)=0;</div><div><span style="white-space:pre-wrap">                               </span> while($var(i)<$dbr(ra=>rows)){</div><div><span style="white-space:pre-wrap">                    </span></div><div><span style="white-space:pre-wrap">                                 </span>xlog("L_INFO","SQL query return contact {$dbr(ra=>[$var(i),0])} for {$tU} at step {$var(i)}\n");</div><div><span style="white-space:pre-wrap">                                  </span></div><div><span style="white-space:pre-wrap">                                 </span>if ($dbr(ra=>[$var(i),0])=~"transport=ws"){<span style="white-space:pre-wrap">        </span></div><div><span style="white-space:pre-wrap">                                         </span>xlog("L_INFO", "This is a Websocket call to endpoint");</div><div><span style="white-space:pre-wrap">                                              </span>sql_pvquery("ca", "select received from location where contact='$dbr(ra=>[$var(i),0])'","$var(recieved)");</div><div><span style="white-space:pre-wrap">                                              </span>xlog("L_INFO","SQL query return recieved {$var(recieved)} for {$tU}\n");</div><div><span style="white-space:pre-wrap">                                             </span>$du=$var(recieved);</div><div><span style="white-space:pre-wrap">                                              </span>xlog("L_INFO", "Request going FROM ASTERISK to WS. Destination is {$du}\n");</div><div><span style="white-space:pre-wrap">                                         </span>xlog("L_INFO","Websocket Destination URI is {$var(recieved)} for {$tU}\n");</div><div><span style="white-space:pre-wrap">                                          </span>rtpproxy_manage("froc+SP");</div><div><span style="white-space:pre-wrap">                                            </span>t_on_reply("REPLY_FROM_WS");</div><div><span style="white-space:pre-wrap">                                           </span>append_branch("sip:$tU@$du");</div><div><span style="white-space:pre-wrap">                                          </span>$var(i) = $var(i) + 1;</div><div><span style="white-space:pre-wrap">                                   </span>}</div><div><span style="white-space:pre-wrap">        </span></div><div><span style="white-space:pre-wrap">                                 </span>else</div><div><span style="white-space:pre-wrap">                                     </span>{<span style="white-space:pre-wrap">       </span></div><div><span style="white-space:pre-wrap">                                         </span>xlog("L_INFO", "This is a classic UDP call to endpoint");</div><div><span style="white-space:pre-wrap">                                            </span></div><div><span style="white-space:pre-wrap">                                         </span>$du="sip:"+$(dbr(ra=>[$var(i),0]){s.select,1,@});</div><div><span style="white-space:pre-wrap">                                           </span>xlog("L_INFO","Classic Destination URI is {$dbr(ra=>[$var(i),0])} for {$tU}\n");</div><div><span style="white-space:pre-wrap">                                          </span>rtpproxy_manage("co");</div><div><span style="white-space:pre-wrap">                                         </span>t_on_reply("MANAGE_CLASSIC_REPLY");</div><div><span style="white-space:pre-wrap">                                            </span>append_branch("sip:$tU@$du");</div><div><span style="white-space:pre-wrap">                                          </span>$var(i) = $var(i) + 1;</div><div><span style="white-space:pre-wrap">                                   </span>}</div><div><span style="white-space:pre-wrap">                                        </span>#append_branch("sip:$tU@$du");</div><div><span style="white-space:pre-wrap">                                 </span></div><div><span style="white-space:pre-wrap">                         </span>}<span style="white-space:pre-wrap">       </span></div><div><span style="white-space:pre-wrap">                 </span>}</div><div><span style="white-space:pre-wrap">                        </span>return 1;</div></div><div><br></div><div><br></div><div>So it customised schema of standart example <br><br><br><div>  seturi("<a href="mailto:sip%3Aa@example.com" target="_blank">sip:a@example.com</a>");</div><div>  append_branch("<a href="mailto:sip%3Ab@example.com" target="_blank">sip:b@example.com</a>");</div><div>  append_branch("<a href="mailto:sip%3Ac@example.com" target="_blank">sip:c@example.com</a>");</div><div>  append_branch("<a href="mailto:sip%3Ad@example.com" target="_blank">sip:d@example.com</a>");</div><div><br></div><div>  t_relay();</div></div><div><br></div><div>At my test I have 2 endpoints with WS and UDP phones (at fist step ir WS and 2 step it UDP). when I do these steps (at my script) I see packet at TCP dump and saw that sended only one packet to UDP but body of packet is WS. Then I saw log of kamailio. I see that at second step packet changed body to WS body (so strange because other steps before and after goes for UDP (as at logic of script))<br><br>What I need to do for send parallel INVITES to multiple endpoints correctly? Thanks</div><div><br></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>