[Home]

Summary:ASTERISK-24846: Cancel Request Broken in chan_pjsip when it's used on Trunk with TCP transport
Reporter:Javier Riveros (goseeped)Labels:
Date Opened:2015-03-04 14:00:44.000-0600Date Closed:2015-03-06 11:48:09.000-0600
Priority:MajorRegression?Yes
Status:Closed/CompleteComponents:Channels/chan_pjsip
Versions:12.8.1 13.2.0 Frequency of
Occurrence
Constant
Related
Issues:
duplicatesASTERISK-22658 PJSIP: If a transport is set on an endpoint, Asterisk will not reuse established connections for that endpoint
Environment:Asterisk 13.2 OS : Ubuntu 14.04 Standart softphone Attachments:( 0) Full_Ast_Debug_Cancel_TCP_trunk_pjsip
( 1) pjsip.conf.txt
( 2) Sip_capture_cancel.txt
Description:When asterisk request a CANCEL on a trunk it use different origin port used on INVITE it cause the trunk endpoint dont hangup the call because transaction doesn't exist.

{code}
- INVITE Generate by asterisk
T 172.31.22.69:"56625" -> 172.31.16.57:5060 [A]
INVITE sip:pbx.rarevase.com;transport=tcp SIP/2.0.
Via: SIP/2.0/TCP 172.31.22.69:56625;rport;branch=z9hG4bKPj70f06330-08c0-48ae-8588-c3ab27839c68;alias.
From: 'javier' <sip:javier@172.31.22.69>;tag=a15f98b6-5f03-4b55-84f1-5f677759711a.
To: <sip:c4e1a3@pbx.rarevase.com>.
Contact: <sip:425b1b25-1ed5-49d6-a561-52ed63c566dd@172.31.22.69:56625>.
Call-ID: 2aae6f80-f2c5-4c9b-94a0-37cfe99d2485.

-CANCEL Send by asterisk

###
T 172.31.22.69:"51875" -> 172.31.16.57:5060 [AP]
CANCEL sip:pbx.rarevase.com;transport=tcp SIP/2.0.
Via: SIP/2.0/TCP 172.31.22.69:51875;rport;branch=z9hG4bKPj70f06330-08c0-48ae-8588-c3ab27839c68;alias.
From: 'javier' <sip:javier@172.31.22.69>;tag=a15f98b6-5f03-4b55-84f1-5f677759711a.
To: <sip:c4e1a3@pbx.rarevase.com>.
Call-ID: 2aae6f80-f2c5-4c9b-94a0-37cfe99d2485.

-- Response from the gateway trunk

T 172.31.16.57:5060 -> 172.31.22.69:"51875" [AP]
SIP/2.0 481 Call/Transaction Does Not Exist.
Via: SIP/2.0/TCP 172.31.22.69:51875;rport=51875;received=172.31.22.69;branch=z9hG4bKPj70f06330-08c0-48ae-8588-c3ab27839c68;alias.
From: 'javier' <sip:javier@172.31.22.69>;tag=a15f98b6-5f03-4b55-84f1-5f677759711a.
To: <sip:c4e1a3@pbx.rarevase.com>;tag=awAdaH.
Call-ID: 2aae6f80-f2c5-4c9b-94a0-37cfe99d2485.

{code}

If you see you can check that Call-ID is the same for all outbound transaction but the origin port on asterisk site is {{51875}} used for CANCEL is different it was using initially on INVITE {{56625}} so this causes that GATEWAY doesn't hangup the call in the other party.

To reproduce this use a trunk using TCP transport  on chan_pjsip.

i attached the full asterisk debug, sip_capture and pjsip.conf config.

Comments:By: Javier Riveros (goseeped) 2015-03-06 10:48:21.119-0600

Seems like TCP transport on chan_pjsip is broken in many ways :S

By: Joshua C. Colp (jcolp) 2015-03-06 11:04:44.292-0600

It's not. There are tests in the test suite which covers its use. In your specific situation your configuration is such that no existing connection will be used. Remove all "transport" lines from endpoint configurations and retest.

By: Javier Riveros (goseeped) 2015-03-06 11:41:21.144-0600

Wow , Thank you Joshua , i failed to find information about it in wiki , so since it being using another port for CANCEL i thought it was a really bug , thanks for not closing it as tech support , hope this help to others , please close this and sorry for the noise.

By: Joshua C. Colp (jcolp) 2015-03-09 14:48:11.579-0500

I would suggest using the resources at hand, such as the asterisk-users mailing list, instead of commenting here.

By: Javier Riveros (goseeped) 2015-03-09 16:10:39.901-0500

I know what is happening now it is our gateway , thanks for your help ! i will deleted my last comments to left ticket clean !