[Home]

Summary:ASTERISK-24224: When using Bridge() dialplan application, surrogate channel appears in list and call count is inflated.
Reporter:Mark Michelson (mmichelson)Labels:
Date Opened:2014-08-12 17:09:17Date Closed:2014-10-06 10:37:55
Priority:MinorRegression?
Status:Closed/CompleteComponents:
Versions:12.4.0 13.0.0-beta1 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Attachments:
Description:Perform the following steps:
# Set up two phones and corresponding configuration in the appropriate channel driver. I used PJSIP/203 and PJSIP/205
# Add the following to your dialplan:
{noformat}
[default]
exten => 300,1,Answer()
exten => 300,n,Echo()

exten => 301,1,Answer
exten => 301,1,Bridge(PJSIP/205)
{noformat}
# Have PJSIP/205 call extension 300.
# Have PJSIP/203 call extension 301.
# Issue {{core show channels}} on the CLI. This is how mine looked
{noformat}
*CLI> core show channels
Channel              Location             State   Application(Data)            
Surrogate/PJSIP/205- (None)               Down    ()                            
PJSIP/203-00000001   (None)               Up      Bridge(PJSIP/205,F)          
PJSIP/205-00000000   (None)               Up      ()                            
2 active channels
1 active call
2 calls processed
{noformat}
Notice the Surrogate channel listed? Asterisk reports only having two active channels, but three are listed.
# Hang up either phone.
# Issue another {{core show channels}}. This is how mine looked:
{noformat}
*CLI> core show channels
Channel              Location             State   Application(Data)            
0 active channels
0 active calls
3 calls processed
{noformat}
Notice how hanging up the call has increased the number of calls processed from 2 to 3.

While I don't necessarily expect the call count to be a priority, seeing the surrogate channel in the output of core show channels is ungood.
Comments:By: Richard Mudgett (rmudgett) 2014-10-01 15:35:24.990-0500

* The Surrogate channel shows up even though there are only two active calls because the reference to that hungup channel lingers longer than needed in the specific scenario.  If the PJSIP/205 channel were in a bridge then there wouldn't be a Surrogate channel but the PJSIP/205 channel would have an extra reference to it while the channels were in the bridge.

* The 3 calls processed is because of the simplistic way Asterisk counts "calls".  Asterisk counts a call as a channel that has a PBX run on it.  In this scenario, all three channels have had a PBX run on them.  This particular quirk with Bridge() has always been there when a masquerade happens.  For v11-, this would be for all cases.  However, with v12+, if the channel were in a bridge then the counts would have been as expected.