[Home]

Summary:ASTERISK-27446: No 'h' extension run when call transferred by caller completes
Reporter:David Cunningham (dcunningham)Labels:
Date Opened:2017-11-26 20:36:42.000-0600Date Closed:2017-11-27 12:15:59.000-0600
Priority:MajorRegression?Yes
Status:Closed/CompleteComponents:Channels/chan_sip/General
Versions:13.17.2 Frequency of
Occurrence
Constant
Related
Issues:
Environment:CentOS 7.2 64 bit.Attachments:( 0) extensions.conf
( 1) no-h-extension1.txt
Description:When a caller does a REFER transfer to connect two calls, the 'h' extension is run immediately, and no 'h' extension is run when the transferred call actually hangs up. For example:

1000105 calls 1000103
1000105 calls 1000102
1000105 transfers one call to the other, and drops out of the call
1000103 and 1000102 talk
1000103 or 1000102 hangs up and the call completes, but no 'h' extension is run

This means that our code on the Asterisk server can't correctly bill for the transferred call. This issue didn't happen on Asterisk 11 and prior.

I've attached the dial plan, and an Asterisk console trace in case it's useful. Important points are:

Line 142: Dial plan logs start of call 1511749212.44
Line 668: Dial plan logs start of call 1511749221.46
Line 950: REFER happens
Line 1010: Dial plan logs end of call 1511749212.44
Line 1013: Dial plan logs end of call 1511749221.46
Line 1240: Bridge torn down after transferred call ends, but no end of call is logged because 'h' extension is not run

Please let us know if anything else would be useful.
Comments:By: Asterisk Team (asteriskteam) 2017-11-26 20:36:42.910-0600

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: David Cunningham (dcunningham) 2017-11-26 20:37:53.555-0600

Log and extensions.conf attached.

By: Richard Mudgett (rmudgett) 2017-11-27 12:15:45.918-0600

Your scenario where A calls B and then A calls C to transfer B to C winds up with neither of the remaining call legs ever having executed dialplan.  Thus the remaining channels cannot execute the 'h' extension.  The log does show the 'h' exten is executed by both A channels when they hang up after the transfer.  The 'h' exten used to get executed in this scenario as a side effect of masquerades where one of the A channels became B or C.  Since v12, transfers operate in a different manner because of the bridging framework \[1].  The actual B or C channel is pulled out of one bridge and pushed into the other bridge and the A channel kicked out of the bridge.

You will need to use hangup handlers \[2] \[3] \[4] set on each channel to do what you want.

\[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+Bridging+Project
\[2] https://wiki.asterisk.org/wiki/display/AST/Hangup+Handlers
\[3] https://wiki.asterisk.org/wiki/display/AST/Hangup+Handlers+Specification
\[4] http://blogs.asterisk.org/2017/03/29/dialplan-handler-routines-allow-customization/