CANCEL Reason is not propagated

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

CANCEL Reason is not propagated

Alexey Vasilyev
Hello.

OpenSIPS 2.4.2, OpenSIPS 2.4.1

If OpenSIPS receives CANCEL it is better to send original Reason to the
endpoint. For example somebody answered queue call and all the others will
get "Call completed elsewhere" and will have no missed call on the phone.

And there is even an article about this.
https://blog.opensips.org/2016/11/15/cancel-request-and-reason-header/

So in my config there is:
# CANCEL processing
  if (is_method("CANCEL")) {
    if (t_check_trans()) {
      rtpengine_delete();
      # flag 0x08 preserve the received Reason header
      t_relay("0x08");
    }
    exit;
 }

But finally on phone I've got "Originator cancel":

2018/08/16 06:19:17.949614 <asterisk IP>:5060 -> <OpenSIPS IP>:5060
CANCEL sip:202@<OpenSIPS IP>:5060 SIP/2.0
Via: SIP/2.0/UDP <asterisk IP>:5060;branch=z9hG4bK1d026f40
Max-Forwards: 70
From: "test-queue" <sip:1252@&lt;asterisk IP>>;tag=as5af2f2e9
To: <sip:202@&lt;OpenSIPS IP>:5060>
Call-ID: 1f3ba1405303ad3269d21ee46775dee5@<asterisk IP>
CSeq: 102 CANCEL
User-Agent: asterisk
Reason: SIP;cause=200;text="Call completed elsewhere"
Content-Length: 0

2018/08/16 06:19:17.951722 <OpenSIPS IP>:5060 -> <asterisk IP>:5060
SIP/2.0 200 canceling
Via: SIP/2.0/UDP <asterisk IP>:5060;received=<asterisk
IP>;rport=5060;branch=z9hG4bK1d026f40
From: "test-queue" <sip:1252@&lt;asterisk IP>>;tag=as5af2f2e9
To: <sip:202@&lt;OpenSIPS
IP>:5060>;tag=acf96d526e7e753a171e4824376d2012-8491
Call-ID: 1f3ba1405303ad3269d21ee46775dee5@<asterisk IP>
CSeq: 102 CANCEL
Server: SIP Proxy
Content-Length: 0

2018/08/16 06:19:17.951884 <OpenSIPS IP>:5060 -> 192.168.11.59:50153
CANCEL sip:202@192.168.11.59:5073;transport=tcp SIP/2.0
Via: SIP/2.0/TCP <OpenSIPS IP>:5060;branch=z9hG4bKbe6e.f5a7989.0
From: "test-queue" <sip:[hidden email]>;tag=as5af2f2e9
Call-ID: 1f3ba1405303ad3269d21ee46775dee5@<asterisk IP>
To: <sip:[hidden email]>
CSeq: 102 CANCEL
Max-Forwards: 70
Reason: SIP;cause=487;text="ORIGINATOR_CANCEL"
User-Agent: SIP Proxy
Content-Length: 0

192.168.11.59 - phone IP.

I tried t_relay("8"); - the same results. And of course, t_relay() without
parameters also uses default "Originator cancel"

But if OpenSIPS makes fork call for several devices with one account and
somebody answers, Cancel Reason is generated correctly - "Call completed
elsewhere".

So the problem only when I want to propagate Reason header.




--
Sent from: http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
---
Alexey Vasilyev
Reply | Threaded
Open this post in threaded view
|

Re: CANCEL Reason is not propagated

Răzvan Crainea-2
Hello, Alexei!

It does seem to be an issue added in 2.4 related to this behavior.
I have just pushed a fix on master and 2.4 branch[1]. Can you pull the
latest sources and check if this issue still persists?

[1]
https://github.com/OpenSIPS/opensips/commit/deb05da54efb247a472fb315974ea37a51516628

Best regards,
Răzvan

On 08/16/2018 10:19 AM, vasilevalex wrote:

> Hello.
>
> OpenSIPS 2.4.2, OpenSIPS 2.4.1
>
> If OpenSIPS receives CANCEL it is better to send original Reason to the
> endpoint. For example somebody answered queue call and all the others will
> get "Call completed elsewhere" and will have no missed call on the phone.
>
> And there is even an article about this.
> https://blog.opensips.org/2016/11/15/cancel-request-and-reason-header/
>
> So in my config there is:
> # CANCEL processing
>    if (is_method("CANCEL")) {
>      if (t_check_trans()) {
>        rtpengine_delete();
>        # flag 0x08 preserve the received Reason header
>        t_relay("0x08");
>      }
>      exit;
>   }
>
> But finally on phone I've got "Originator cancel":
>
> 2018/08/16 06:19:17.949614 <asterisk IP>:5060 -> <OpenSIPS IP>:5060
> CANCEL sip:202@<OpenSIPS IP>:5060 SIP/2.0
> Via: SIP/2.0/UDP <asterisk IP>:5060;branch=z9hG4bK1d026f40
> Max-Forwards: 70
> From: "test-queue" <sip:1252@&lt;asterisk IP>>;tag=as5af2f2e9
> To: <sip:202@&lt;OpenSIPS IP>:5060>
> Call-ID: 1f3ba1405303ad3269d21ee46775dee5@<asterisk IP>
> CSeq: 102 CANCEL
> User-Agent: asterisk
> Reason: SIP;cause=200;text="Call completed elsewhere"
> Content-Length: 0
>
> 2018/08/16 06:19:17.951722 <OpenSIPS IP>:5060 -> <asterisk IP>:5060
> SIP/2.0 200 canceling
> Via: SIP/2.0/UDP <asterisk IP>:5060;received=<asterisk
> IP>;rport=5060;branch=z9hG4bK1d026f40
> From: "test-queue" <sip:1252@&lt;asterisk IP>>;tag=as5af2f2e9
> To: <sip:202@&lt;OpenSIPS
> IP>:5060>;tag=acf96d526e7e753a171e4824376d2012-8491
> Call-ID: 1f3ba1405303ad3269d21ee46775dee5@<asterisk IP>
> CSeq: 102 CANCEL
> Server: SIP Proxy
> Content-Length: 0
>
> 2018/08/16 06:19:17.951884 <OpenSIPS IP>:5060 -> 192.168.11.59:50153
> CANCEL sip:202@192.168.11.59:5073;transport=tcp SIP/2.0
> Via: SIP/2.0/TCP <OpenSIPS IP>:5060;branch=z9hG4bKbe6e.f5a7989.0
> From: "test-queue" <sip:[hidden email]>;tag=as5af2f2e9
> Call-ID: 1f3ba1405303ad3269d21ee46775dee5@<asterisk IP>
> To: <sip:[hidden email]>
> CSeq: 102 CANCEL
> Max-Forwards: 70
> Reason: SIP;cause=487;text="ORIGINATOR_CANCEL"
> User-Agent: SIP Proxy
> Content-Length: 0
>
> 192.168.11.59 - phone IP.
>
> I tried t_relay("8"); - the same results. And of course, t_relay() without
> parameters also uses default "Originator cancel"
>
> But if OpenSIPS makes fork call for several devices with one account and
> somebody answers, Cancel Reason is generated correctly - "Call completed
> elsewhere".
>
> So the problem only when I want to propagate Reason header.
>
>
>
>
> --
> Sent from: http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>

--
Răzvan Crainea
OpenSIPS Core Developer
   http://www.opensips-solutions.com

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: CANCEL Reason is not propagated

Alexey Vasilyev
Hello Răzvan,

Thank you very much for so fast response and fix!

I built branch 2.4 from git and now it works fine, as it should.

CANCEL Reason is propagated to client.



--
Sent from: http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
---
Alexey Vasilyev
Reply | Threaded
Open this post in threaded view
|

Re: CANCEL Reason is not propagated

S. Rosenberg
Wow I never knew this feature exists, do all phones implement this feature?

On Thu, Aug 16, 2018, 11:02 AM vasilevalex <[hidden email]> wrote:
Hello Răzvan,

Thank you very much for so fast response and fix!

I built branch 2.4 from git and now it works fine, as it should.

CANCEL Reason is propagated to client.



--
Sent from: http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: CANCEL Reason is not propagated

Alexey Vasilyev
I can't say if all the phones support it, but this is RFC 3326. So you can
just check in your model docs.
Most softphones also support it.
And yes, it is very useful.



--
Sent from: http://opensips-open-sip-server.1449251.n2.nabble.com/OpenSIPS-Users-f1449235.html

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
---
Alexey Vasilyev