<div dir="ltr"><div><div><div>Hi Bogdan,<br>I know ACK is being properly transmitted but i have 
also handled ACK in main route in case it fails in match_dialog 
condition,but for BYE request i have not implemented any handling route.<br> As i mentioned in earlier mails in "match_dialog" route ACK and BYE are
 not being relayed as in dialog messages. so do i have to handle them in
 main route also ? also please explain how opensips handles in dialog 
requests using topology_hiding and topology_hiding_match ?<br></div>please find my opensips routes: <a href="https://pastebin.com/XBdWvBQW" target="_blank">https://pastebin.com/XBdWvBQW</a><br></div>also logs with Debug mode on: <a href="https://pastebin.com/iqcEDint" target="_blank">https://pastebin.com/iqcEDint</a><br></div><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 26, 2017 at 3:53 PM, Ravindrakumar Bhatt <span dir="ltr"><<a href="mailto:ravindra.bhatt@ecosmob.com" target="_blank">ravindra.bhatt@ecosmob.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="m_-5935167341454408581m_-2047822182755967618HOEnZb"><div class="m_-5935167341454408581m_-2047822182755967618h5"><div dir="ltr">Hi Bogdan,<br> I know ACK is being properly transmitted but i have 
also handled ACK in main route in case it fails in match_dialog 
condition,but for BYE request i have not implemented any handling route.<br>    please see my main route logic as well as ACK method handling route.<br> route{<br><br>        route("SANITY_CHECKS");<br>        route("MATCH_DIALOG");<br>        $avp(server_ip)="XXX.XXX.X.XXX<wbr>";<br>        $avp(term-ip) = $Ri;<br>        $avp(source-ip)= $si;    #source ip address of message<br><br>        $avp(source-port)=$sp;  # source port of message<br>        $avp(src_ipz_ip) = $Ri;<br>        $avp(dest-ip)=$od;<br>        $avp(dest-port)=$op;<br>        $avp(dst_type) = "CARRIER";<br>        $avp(use-rtpproxy)="YES";<br>        $avp(ruri)=$rU;            #username in request URI<br><br>       
 xlog("L_INFO","[$time(%Y-%m-%d %H:%M:%S)] Incoming Request CI:$ci 
RM:$rm FU:$fU TU:$tU SI:$avp(source-ip) SP:$avp(source-port) PC:$proto 
TE:$avp(term-ip) \n");<br><br>        if(method=="INVITE") {<br>                route("PROCESS_INVITE");<br>        } else if(method=="CANCEL") {<br>                route("PROCESS_CANCEL");<br>        } else if(method=="ACK") {<br>                route("PROCESS_ACK");<br>        } else if(method=="OPTIONS") {<br>                route("PROCESS_OPTIONS");<br>        } else if(method=="REGISTER"){<br>                route("PROCESS_REGISTER");<br>        } else {<br>                sl_send_reply("501", "Method is not implemented"); ### From here that funny 501 is coming....<br>        }<br>        exit;<br>}<br>                              <wbr>                              <wbr>                              <wbr>                     <br>route[PROCESS_ACK] {<br>        xlog("L_INFO","IN PROCESS ACK\n");<br>    if(t_check_trans()) {<br>                t_relay();<br>        }<br>        exit;<br>}<br><br>   
 As i mentioned in earlier mails in "match_dialog" route ACK and BYE are
 not being relayed as in dialog messages. so do i have to handle them in
 main route also ? also please explain how opensips handles in dialog 
requests using topology_hiding and topology_hiding_match ?<br>    link for Debug log: <a href="https://pastebin.com/iqcEDint" target="_blank">https://pastebin.com/iqcEDint</a><br>    PFA  pcap for same call done while taking debug log .<br><br>Thanks and Regards,<br>Ravindrakumar Bhatt</div></div></div><div class="m_-5935167341454408581m_-2047822182755967618HOEnZb"><div class="m_-5935167341454408581m_-2047822182755967618h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 26, 2017 at 3:47 PM, Ravindrakumar Bhatt <span dir="ltr"><<a href="mailto:ravindra.bhatt@ecosmob.com" target="_blank">ravindra.bhatt@ecosmob.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="m_-5935167341454408581m_-2047822182755967618m_7572617314133008847HOEnZb"><div class="m_-5935167341454408581m_-2047822182755967618m_7572617314133008847h5"><div dir="ltr"><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Ravindrakumar Bhatt</b> <span dir="ltr"><<a href="mailto:ravindra.bhatt@ecosmob.com" target="_blank">ravindra.bhatt@ecosmob.com</a>></span><br>Date: Tue, Oct 24, 2017 at 1:15 PM<br>Subject: Re: [OpenSIPS-Users] Problem in handling BYE using topology_hiding_match()<br>To: Bogdan-Andrei Iancu <<a href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>><br><br><br><div dir="ltr">Hi Bogdan,<br>    I know ACK is being properly transmitted but i have also handled ACK in main route in case it fails in match_dialog condition,but for BYE request i have not implemented any handling route.<br>    please see my main route logic as well as ACK method handling route.<br> route{<br><br>        route("SANITY_CHECKS");<br>        route("MATCH_DIALOG");<br>        $avp(server_ip)="XXX.XXX.X.XXX<wbr>";<br>        $avp(term-ip) = $Ri;<br>        $avp(source-ip)= $si;    #source ip address of message<br><br>        $avp(source-port)=$sp;  # source port of message<br>        $avp(src_ipz_ip) = $Ri;<br>        $avp(dest-ip)=$od;<br>        $avp(dest-port)=$op;<br>        $avp(dst_type) = "CARRIER";<br>        $avp(use-rtpproxy)="YES";<br>        $avp(ruri)=$rU;            #username in request URI<br><br>        xlog("L_INFO","[$time(%Y-%m-%d %H:%M:%S)] Incoming Request CI:$ci RM:$rm FU:$fU TU:$tU SI:$avp(source-ip) SP:$avp(source-port) PC:$proto TE:$avp(term-ip) \n");<br><br>        if(method=="INVITE") {<br>                route("PROCESS_INVITE");<br>        } else if(method=="CANCEL") {<br>                route("PROCESS_CANCEL");<br>        } else if(method=="ACK") {<br>                route("PROCESS_ACK");<br>        } else if(method=="OPTIONS") {<br>                route("PROCESS_OPTIONS");<br>        } else if(method=="REGISTER"){<br>                route("PROCESS_REGISTER");<br>        } else {<br>                sl_send_reply("501", "Method is not implemented"); ### From here that funny 501 is coming....<br>        }<br>        exit;<br>}<br>                              <wbr>                              <wbr>                              <wbr>                     <br>route[PROCESS_ACK] {<br>        xlog("L_INFO","IN PROCESS ACK\n");<br>    if(t_check_trans()) {<br>                t_relay();<br>        }<br>        exit;<br>}<br><br>    As i mentioned in earlier mails in "match_dialog" route ACK and BYE are not being relayed as in dialog messages. so do i have to handle them in main route also ? also please explain how opensips handles in dialog requests using topology_hiding and topology_hiding_match ?<br>    link for Debug log: <a href="https://pastebin.com/iqcEDint" target="_blank">https://pastebin.com/iqcEDint</a><br>    PFA  pcap for same call done while taking debug log .<br><br>Thanks and Regards,<br>Ravindrakumar Bhatt<div><div class="m_-5935167341454408581m_-2047822182755967618m_7572617314133008847m_-4283282353604713523h5"><br><br><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 20, 2017 at 9:02 PM, Bogdan-Andrei Iancu <span dir="ltr"><<a href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF">
    <tt>Hi Ravinder,<br>
      <br>
      As per the trace, the ACK is properly routed (frames 17 & 18).
      Also the incoming BYE (frame 19) is forwarded after a long time
      (see frame 22), still there is a funny 501 reply for BYE (before
      the relay) in frame 21.<br>
      <br>
      Could you also post somewhere the OpenSIPS logs (level 4, debug)
      corresponding to processing the incoming BYE (from 19) ?<br>
      <br>
      Best regards,<br>
    </tt><span class="m_-5935167341454408581m_-2047822182755967618m_7572617314133008847m_-4283282353604713523m_4653556663748105878gmail-">
    <pre class="m_-5935167341454408581m_-2047822182755967618m_7572617314133008847m_-4283282353604713523m_4653556663748105878gmail-m_7933356295131203247moz-signature" cols="72">Bogdan-Andrei Iancu
  OpenSIPS Founder and Developer
  <a class="m_-5935167341454408581m_-2047822182755967618m_7572617314133008847m_-4283282353604713523m_4653556663748105878gmail-m_7933356295131203247moz-txt-link-freetext" href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.<wbr>com</a>
</pre>
    </span><div><div class="m_-5935167341454408581m_-2047822182755967618m_7572617314133008847m_-4283282353604713523m_4653556663748105878gmail-h5"><div class="m_-5935167341454408581m_-2047822182755967618m_7572617314133008847m_-4283282353604713523m_4653556663748105878gmail-m_7933356295131203247moz-cite-prefix">On 10/18/2017 11:21 AM, Ravindrakumar
      Bhatt wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">
        <div>
          <div>
            <div>
              <div>
                <div>Hi Bogdan,<br>
                </div>
                please find my opensips call log as requested:<br>
                <a href="https://pastebin.com/7ypH0z0x" target="_blank">https://pastebin.com/7ypH0z0x</a><br>
                <br>
              </div>
              as well as pcap for same call is attached with mail.<br>
            </div>
            PFA<br>
            <br>
          </div>
          Thanks and regards,<br>
        </div>
        Ravindra Bhatt<br>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Wed, Oct 18, 2017 at 12:52 PM,
          Bogdan-Andrei Iancu <span dir="ltr"><<a href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
            <div bgcolor="#FFFFFF"> <tt>Hi Ravindra,<br>
                <br>
                Please post a link to the SIP trace/capture showing the
                entire SIP call (INVITE + 200 OK + ACK + BYE). The trace
                must cover all in and out traffic in OpenSIPS.<br>
                <br>
                Regards,<br>
              </tt>
              <pre class="m_-5935167341454408581m_-2047822182755967618m_7572617314133008847m_-4283282353604713523m_4653556663748105878gmail-m_7933356295131203247m_8476486913152341497moz-signature" cols="72">Bogdan-Andrei Iancu
  OpenSIPS Founder and Developer
  <a class="m_-5935167341454408581m_-2047822182755967618m_7572617314133008847m_-4283282353604713523m_4653556663748105878gmail-m_7933356295131203247m_8476486913152341497moz-txt-link-freetext" href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.<wbr>com</a>
</pre>
              <div>
                <div class="m_-5935167341454408581m_-2047822182755967618m_7572617314133008847m_-4283282353604713523m_4653556663748105878gmail-m_7933356295131203247h5">
                  <div class="m_-5935167341454408581m_-2047822182755967618m_7572617314133008847m_-4283282353604713523m_4653556663748105878gmail-m_7933356295131203247m_8476486913152341497moz-cite-prefix">On
                    10/17/2017 12:29 PM, Ravindrakumar Bhatt wrote:<br>
                  </div>
                </div>
              </div>
              <blockquote type="cite">
                <div>
                  <div class="m_-5935167341454408581m_-2047822182755967618m_7572617314133008847m_-4283282353604713523m_4653556663748105878gmail-m_7933356295131203247h5">
                    <div dir="ltr">
                      <div>
                        <div>Hello,<br>
                          i am using opensips v2.2.1 as SBC.<br>
                          call flow is like
                          caller->opensips->server->open<wbr>sips->callie.call
                          is established successfully but when BYE is
                          sent by any user it is not recognised by
                          topology_hiding_match() also i am not getting
                          any dialog related values(DLG_status,DLG_did
                          etc) in ACK or BYE method.<br>
                          <br>
                          here is my logic for  requset handling :<br>
                          <br>
                          route[PROCESS_INVITE] {<br>
                          <br>
                                  route("SETCDR");<br>
                                  if(t_check_trans()) {<br>
                                          drop();<br>
                                  }<br>
                                  route("CHECK_NAT");<br>
                                  create_dialog();<br>
                                  do_accounting("aaa","cdr|faile<wbr>d");<br>
                                  route("REALY_ROUTE");<br>
                                  exit;<br>
                          }<br>
                          <br>
                          route[RELAY_ROUTE] {<br>
                                  if(is_method("INVITE|UPDATE")) {<br>
                                  xlog("L_INFO","CI:$ci In Relay Route
                          RU:$ru DU:$du Tu:$tu TU:$tU CT:$ct\n");<br>
                                          if(!has_totag() &&
                          is_method("INVITE") && !isflagset(15))
                          {<br>
                                                  xlog("L_INFO","CI:$ci
                          Topology_Hiding Call\n");<br>
                                                  setflag(15);<br>
                                                  topology_hiding("UC");<br>
                          #                       record_route();<br>
                          <br>
                          <br>
                                          }<br>
                                          if($avp(use-rtpproxy)=="YES")
                          {                 <br>
                                                 
                          route(PROCESS_RTPPROXY_OFFER);<br>
                                          }<br>
                                          xlog("L_INFO","CI:$ci Routing
                          Call IP:$avp(dest-ip)
                          PORT:$avp(dest-port)\n");<br>
                          <br>
                                          $avp(call_status)="Failed";<br>
                                          t_on_branch("DEFAULT_BRANCH_RO<wbr>UTE");<br>
                                          t_on_reply("DEFAULT_REPLY_ROUT<wbr>E");<br>
                                  }<br>
                          <br>
                                          xlog("L_INFO","DAILOG
                          STATUS::::  $DLG_end_reason $DLG_did     
                          $DLG_status $DLG_count\n");<br>
                          <br>
                          #       record_route();<br>
                                  if (!t_relay()) {<br>
                                          sl_reply_error();<br>
                                  }<br>
                                  exit;<br>
                          }<br>
                          <br>
                          route[MATCH_DIALOG] {<br>
                          <br>
                                  xlog("L_INFO",":::::DAILOG STATUS::::
                          $rm: $DLG_end_reason $DLG_did     $DLG_status
                          $DLG_count\n"); #HERE I AM GETTING most values
                          null <br>
                                  if(has_totag() &&
                          is_method("INVITE|ACK|BYE|UPDA<wbr>TE|REFER|PRACK|INFO")
                          ) {<br>
                                          xlog("L_INFO","INSIDE
                          MATCH_DIALOG :::: $rm\n");<br>
                          #               loose_route();  <br>
                                          xlog(" found match request to
                          a dialog \n");<br>
                                          if(topology_hiding_match())
                          {                    #THIS CONDITIONS FAILS
                          FOR ALL REQUESTS<br>
                                                  if(is_method("BYE")) {<br>
                                                        <wbr> 
                          rtpproxy_unforce();<br>
                                                  }<br>
                                                  route("RELAY_ROUTE");<br>
                                          }<br>
                                  }<br>
                          }<br>
                          <br>
                          what is going wrong here ? is there any way to
                          handle this issue?<br>
                          <br>
                        </div>
                        Thanks and  regards ,<br>
                      </div>
                      Ravindra Bhatt<br>
                    </div>
                    <br>
                    <fieldset class="m_-5935167341454408581m_-2047822182755967618m_7572617314133008847m_-4283282353604713523m_4653556663748105878gmail-m_7933356295131203247m_8476486913152341497mimeAttachmentHeader"></fieldset>
                    <br>
                  </div>
                </div>
                <pre>______________________________<wbr>_________________
Users mailing list
<a class="m_-5935167341454408581m_-2047822182755967618m_7572617314133008847m_-4283282353604713523m_4653556663748105878gmail-m_7933356295131203247m_8476486913152341497moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a class="m_-5935167341454408581m_-2047822182755967618m_7572617314133008847m_-4283282353604713523m_4653556663748105878gmail-m_7933356295131203247m_8476486913152341497moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a>
</pre>
              </blockquote>
              <br>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </div></div></div>

</blockquote></div><br></div></div></div></div>
</div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="m_-5935167341454408581m_-2047822182755967618gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div><div><div><b>Ravindrakumar Bhatt<br></b></div><div dir="ltr"><div>Jr. Software Developer </div><div>Ecosmob Technologies Ltd</div><div>Ahmedabad</div><div>Mo:<b>+918460692402</b></div></div></div></div>
</div></div></div>
</div></div>