[Home]

Summary:ASTERISK-26968: chan_pjsip: Transfer() does not result in TRANSFERSTATUS reflecting SIP response to transfer
Reporter:Dan Cropp (daninmadison)Labels:pjsip
Date Opened:2017-04-26 09:23:01Date Closed:2019-07-23 09:20:56
Priority:MinorRegression?
Status:Closed/CompleteComponents:Applications/app_transfer Channels/chan_pjsip
Versions:14.4.0 Frequency of
Occurrence
Constant
Related
Issues:
causesASTERISK-28886 chan_pjsip: PJSIP_SC_NULL does not exist in pjproject 2.7.2
Environment:Debian 8 running on a VMWare VMAttachments:( 0) chansiptransfer.txt
Description:Using AMI to tell Asterisk to perform a Transfer (it's a blind transfer).  Asterisk is connected to a switch (tried both Cisco and Avaya).  Trying to tell the switch to we want to blind transfer to another number.

Everything works fine with chan_sip.  What we are seeing is only in PJSIP support.

The SIP REFER packet is sent correctly.  Switch receives it and will process it and provide the appropriate response.

Valid number - Cisco sends Asterisk a 202 Accepted packet and it rings the phone for the transfer.  With chan_sip, the Transfer is not complete until the call is answered (during which the SIP trace shows a Notify/OK response).  With PJSIP, the logs indicate Asterisk is indicating the Transfer completed right away and sets TRANSFERSTATUS variable to SUCCESS (even though the call hasn't been answered).

Invalid number - Cisco sends Asrterisk a 404 Not Found in response to the REFER packet.  For PJSIP, we see an immediate response with TRANSFERSTATUS variable set to SUCCESS (milliseconds before the 404 is ever showing up in the logs).  For chan_sip, it correctly waits for the 404 packet, processes this packet and indicates the Transfer failed, setting the TRANSFERSTATUS to FAILED.
Comments:By: Asterisk Team (asteriskteam) 2017-04-26 09:23:02.524-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Dan Cropp (daninmadison) 2017-04-26 09:52:01.907-0500

Strange that chan_sip does set TRANSFERSTATUS according to the SIP response.  In chan_sip, the Transfer can even take several seconds based on what we saw because it was waiting for us to answer the call.  For example, I have a trace of the AMI where chan_sip performed the REFER, received Notify responses, etc.  7 seconds later answered the call.  At this point, the transfer completes and the TRANSFERSTATUS is set.

Shouldn't chan_sip and PJSIP work the same way?


By: Dan Cropp (daninmadison) 2017-04-26 09:54:16.118-0500

Here is the debug of the chan_sip Transfer.  This shows the TRANSFERSTATUS for chan_sip waiting for the call to be answered before the Transfer completes and sets the TRANSFERSTATUS.

By: Friendly Automation (friendly-automation) 2019-07-23 09:20:58.459-0500

Change 11243 merged by George Joseph:
chan_pjsip:  Transmit REFER waits for the REFER result setting TRANSFERSTATUS

[https://gerrit.asterisk.org/c/asterisk/+/11243|https://gerrit.asterisk.org/c/asterisk/+/11243]

By: Friendly Automation (friendly-automation) 2019-07-23 09:21:07.748-0500

Change 11216 merged by George Joseph:
chan_pjsip:  Transmit REFER waits for the REFER result setting TRANSFERSTATUS

[https://gerrit.asterisk.org/c/asterisk/+/11216|https://gerrit.asterisk.org/c/asterisk/+/11216]