[OpenSIPS-Users] Problem in handling BYE using topology_hiding_match()

Ravindrakumar Bhatt ravindra.bhatt at ecosmob.com
Wed Nov 1 01:34:21 EDT 2017


Hi Bogdan,
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.
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 ?
please find my opensips routes: https://pastebin.com/XBdWvBQW
also logs with Debug mode on: https://pastebin.com/iqcEDint


On Thu, Oct 26, 2017 at 3:53 PM, Ravindrakumar Bhatt <
ravindra.bhatt at ecosmob.com> wrote:

> Hi Bogdan,
>  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.
>     please see my main route logic as well as ACK method handling route.
>  route{
>
>         route("SANITY_CHECKS");
>         route("MATCH_DIALOG");
>         $avp(server_ip)="XXX.XXX.X.XXX";
>         $avp(term-ip) = $Ri;
>         $avp(source-ip)= $si;    #source ip address of message
>
>         $avp(source-port)=$sp;  # source port of message
>         $avp(src_ipz_ip) = $Ri;
>         $avp(dest-ip)=$od;
>         $avp(dest-port)=$op;
>         $avp(dst_type) = "CARRIER";
>         $avp(use-rtpproxy)="YES";
>         $avp(ruri)=$rU;            #username in request URI
>
>         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");
>
>         if(method=="INVITE") {
>                 route("PROCESS_INVITE");
>         } else if(method=="CANCEL") {
>                 route("PROCESS_CANCEL");
>         } else if(method=="ACK") {
>                 route("PROCESS_ACK");
>         } else if(method=="OPTIONS") {
>                 route("PROCESS_OPTIONS");
>         } else if(method=="REGISTER"){
>                 route("PROCESS_REGISTER");
>         } else {
>                 sl_send_reply("501", "Method is not implemented"); ###
> From here that funny 501 is coming....
>         }
>         exit;
> }
>
>
> route[PROCESS_ACK] {
>         xlog("L_INFO","IN PROCESS ACK\n");
>     if(t_check_trans()) {
>                 t_relay();
>         }
>         exit;
> }
>
>     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 ?
>     link for Debug log: https://pastebin.com/iqcEDint
>     PFA  pcap for same call done while taking debug log .
>
> Thanks and Regards,
> Ravindrakumar Bhatt
>
> On Thu, Oct 26, 2017 at 3:47 PM, Ravindrakumar Bhatt <
> ravindra.bhatt at ecosmob.com> wrote:
>
>>
>> ---------- Forwarded message ----------
>> From: Ravindrakumar Bhatt <ravindra.bhatt at ecosmob.com>
>> Date: Tue, Oct 24, 2017 at 1:15 PM
>> Subject: Re: [OpenSIPS-Users] Problem in handling BYE using
>> topology_hiding_match()
>> To: Bogdan-Andrei Iancu <bogdan at opensips.org>
>>
>>
>> Hi Bogdan,
>>     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.
>>     please see my main route logic as well as ACK method handling route.
>>  route{
>>
>>         route("SANITY_CHECKS");
>>         route("MATCH_DIALOG");
>>         $avp(server_ip)="XXX.XXX.X.XXX";
>>         $avp(term-ip) = $Ri;
>>         $avp(source-ip)= $si;    #source ip address of message
>>
>>         $avp(source-port)=$sp;  # source port of message
>>         $avp(src_ipz_ip) = $Ri;
>>         $avp(dest-ip)=$od;
>>         $avp(dest-port)=$op;
>>         $avp(dst_type) = "CARRIER";
>>         $avp(use-rtpproxy)="YES";
>>         $avp(ruri)=$rU;            #username in request URI
>>
>>         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");
>>
>>         if(method=="INVITE") {
>>                 route("PROCESS_INVITE");
>>         } else if(method=="CANCEL") {
>>                 route("PROCESS_CANCEL");
>>         } else if(method=="ACK") {
>>                 route("PROCESS_ACK");
>>         } else if(method=="OPTIONS") {
>>                 route("PROCESS_OPTIONS");
>>         } else if(method=="REGISTER"){
>>                 route("PROCESS_REGISTER");
>>         } else {
>>                 sl_send_reply("501", "Method is not implemented"); ###
>> From here that funny 501 is coming....
>>         }
>>         exit;
>> }
>>
>>
>> route[PROCESS_ACK] {
>>         xlog("L_INFO","IN PROCESS ACK\n");
>>     if(t_check_trans()) {
>>                 t_relay();
>>         }
>>         exit;
>> }
>>
>>     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 ?
>>     link for Debug log: https://pastebin.com/iqcEDint
>>     PFA  pcap for same call done while taking debug log .
>>
>> Thanks and Regards,
>> Ravindrakumar Bhatt
>>
>>
>>
>>
>> On Fri, Oct 20, 2017 at 9:02 PM, Bogdan-Andrei Iancu <bogdan at opensips.org
>> > wrote:
>>
>>> Hi Ravinder,
>>>
>>> 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.
>>>
>>> Could you also post somewhere the OpenSIPS logs (level 4, debug)
>>> corresponding to processing the incoming BYE (from 19) ?
>>>
>>> Best regards,
>>>
>>> Bogdan-Andrei Iancu
>>>   OpenSIPS Founder and Developer
>>>   http://www.opensips-solutions.com
>>>
>>> On 10/18/2017 11:21 AM, Ravindrakumar Bhatt wrote:
>>>
>>> Hi Bogdan,
>>> please find my opensips call log as requested:
>>> https://pastebin.com/7ypH0z0x
>>>
>>> as well as pcap for same call is attached with mail.
>>> PFA
>>>
>>> Thanks and regards,
>>> Ravindra Bhatt
>>>
>>> On Wed, Oct 18, 2017 at 12:52 PM, Bogdan-Andrei Iancu <
>>> bogdan at opensips.org> wrote:
>>>
>>>> Hi Ravindra,
>>>>
>>>> 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.
>>>>
>>>> Regards,
>>>>
>>>> Bogdan-Andrei Iancu
>>>>   OpenSIPS Founder and Developer
>>>>   http://www.opensips-solutions.com
>>>>
>>>> On 10/17/2017 12:29 PM, Ravindrakumar Bhatt wrote:
>>>>
>>>> Hello,
>>>> i am using opensips v2.2.1 as SBC.
>>>> call flow is like caller->opensips->server->opensips->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.
>>>>
>>>> here is my logic for  requset handling :
>>>>
>>>> route[PROCESS_INVITE] {
>>>>
>>>>         route("SETCDR");
>>>>         if(t_check_trans()) {
>>>>                 drop();
>>>>         }
>>>>         route("CHECK_NAT");
>>>>         create_dialog();
>>>>         do_accounting("aaa","cdr|failed");
>>>>         route("REALY_ROUTE");
>>>>         exit;
>>>> }
>>>>
>>>> route[RELAY_ROUTE] {
>>>>         if(is_method("INVITE|UPDATE")) {
>>>>         xlog("L_INFO","CI:$ci In Relay Route RU:$ru DU:$du Tu:$tu
>>>> TU:$tU CT:$ct\n");
>>>>                 if(!has_totag() && is_method("INVITE") &&
>>>> !isflagset(15)) {
>>>>                         xlog("L_INFO","CI:$ci Topology_Hiding Call\n");
>>>>                         setflag(15);
>>>>                         topology_hiding("UC");
>>>> #                       record_route();
>>>>
>>>>
>>>>                 }
>>>>                 if($avp(use-rtpproxy)=="YES") {
>>>>                         route(PROCESS_RTPPROXY_OFFER);
>>>>                 }
>>>>                 xlog("L_INFO","CI:$ci Routing Call IP:$avp(dest-ip)
>>>> PORT:$avp(dest-port)\n");
>>>>
>>>>                 $avp(call_status)="Failed";
>>>>                 t_on_branch("DEFAULT_BRANCH_ROUTE");
>>>>                 t_on_reply("DEFAULT_REPLY_ROUTE");
>>>>         }
>>>>
>>>>                 xlog("L_INFO","DAILOG STATUS::::  $DLG_end_reason
>>>> $DLG_did      $DLG_status $DLG_count\n");
>>>>
>>>> #       record_route();
>>>>         if (!t_relay()) {
>>>>                 sl_reply_error();
>>>>         }
>>>>         exit;
>>>> }
>>>>
>>>> route[MATCH_DIALOG] {
>>>>
>>>>         xlog("L_INFO",":::::DAILOG STATUS:::: $rm: $DLG_end_reason
>>>> $DLG_did     $DLG_status $DLG_count\n"); #HERE I AM GETTING most values
>>>> null
>>>>         if(has_totag() && is_method("INVITE|ACK|BYE|UPDATE|REFER|PRACK|INFO")
>>>> ) {
>>>>                 xlog("L_INFO","INSIDE MATCH_DIALOG :::: $rm\n");
>>>> #               loose_route();
>>>>                 xlog(" found match request to a dialog \n");
>>>>                 if(topology_hiding_match()) {                    #THIS
>>>> CONDITIONS FAILS FOR ALL REQUESTS
>>>>                         if(is_method("BYE")) {
>>>>                                 rtpproxy_unforce();
>>>>                         }
>>>>                         route("RELAY_ROUTE");
>>>>                 }
>>>>         }
>>>> }
>>>>
>>>> what is going wrong here ? is there any way to handle this issue?
>>>>
>>>> Thanks and  regards ,
>>>> Ravindra Bhatt
>>>>
>>>>
>>>> _______________________________________________
>>>> Users mailing listUsers at lists.opensips.orghttp://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>


-- 

*Ravindrakumar Bhatt*
Jr. Software Developer
Ecosmob Technologies Ltd
Ahmedabad
Mo:*+918460692402*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20171101/2c51ea41/attachment-0001.html>


More information about the Users mailing list