Summary:ASTERISK-28518: chan_dahdi: Caller ID FSK Erroneously Sent when Picking Up Dahdi Call On Hold
Reporter:Josh Alberts (jalberts)Labels:
Date Opened:2019-08-30 11:52:38Date Closed:2022-05-02 15:45:56
Versions:13.27.0 Frequency of
Environment:DAHDI Version: 2.10.2Attachments:
Description:Asterisk is frequently and improperly sending Caller ID FSK when a Dahdi channel (fxo_ks) is picked back up after being put on hold.  Here is the scenario:

1) A call comes in to a Dahdi channel, and is picked up
2) The Dahdi channel flashes and receives a new dial tone
3) The Dahdi channel hangs up to place the call on hold.  The Dahdi channel rings while the call is being held.
4) The Dahdi channel picks back up to resume the call
5) Caller ID FSK is spilled out, and is only heard by the Dahdi channel, and not the other end.  This shouldn't be happening.
6) The Dahdi channel is connected back to the caller
Comments:By: Asterisk Team (asteriskteam) 2019-08-30 11:52:39.232-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].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

By: Joshua C. Colp (jcolp) 2019-09-03 06:12:43.642-0500

If you set the "callwaitingcallerid" option to no does this stop the callerid spill from occurring?

By: Josh Alberts (jalberts) 2019-09-03 07:22:07.602-0500

Hi Joshua,

I changed callwaitingcallerid to no and restarted Asterisk.  The problem still occurs.

By: Joshua C. Colp (jcolp) 2019-09-03 08:47:27.758-0500

Does this work in older versions or have you always seen this?

By: Josh Alberts (jalberts) 2019-09-03 09:14:14.257-0500

I believe I also saw this in 11.25.3 but I didn't list that along with the issue because I'm not 100% sure.

By: Andrew Siplas (asiplas) 2020-01-18 14:22:50.554-0600

I can confirm this behavior—it only seems to occur the first time the held call is picked up (when ringing back—if leaving the phone at dialtone about chan_dahdi.c:9847 this does not occur).

The only way I could reproduce with WCTDM24XXP was on ringback and only occurred the first time the held call was picked up again—does not occur on subsequent flash→hold→hangup→ringback→answer and also does not occur on flash→hold→flash→resume.

By: N A (InterLinked) 2022-03-29 15:34:17.810-0500

From my testing, and in addition to what's already been said, this bug occurs (consistently) only when:

- immediate = no for the line
- a mailbox is specified for the line
- you pick up *after* the first ring on the flash ringback

The issue is MWI related. DAHDI is trying to send FSK for MWI when it thinks it's an okay time to do so, but it's really not. The actual spot is right here:
https://github.com/asterisk/asterisk/blob/master/channels/chan_dahdi.c#L11586 (mwi_send_init).

<s>The code says this is supposed to occur only when the line is "dormant", so clearly there is a bug in the logic in that it's happening as soon as the line goes off-hook again.</s>

Actually, I should clarify something here:

After the first ring, that's when the MWI CID spill is added. At that point, it's inevitable that when the line goes off-hook, there will be that FSK spill due to the dahdi_read logic (https://github.com/asterisk/asterisk/blob/master/channels/chan_dahdi.c#L8681)
So really, a ringing line should not be considered "dormant" for this purpose.

By: Friendly Automation (friendly-automation) 2022-05-02 15:45:56.934-0500

Change 18493 merged by Kevin Harwell:
chan_dahdi: Don't allow MWI FSK if channel not idle.


By: Friendly Automation (friendly-automation) 2022-05-02 15:46:07.684-0500

Change 18494 merged by Kevin Harwell:
chan_dahdi: Don't allow MWI FSK if channel not idle.


By: Friendly Automation (friendly-automation) 2022-05-02 15:46:23.016-0500

Change 18495 merged by Kevin Harwell:
chan_dahdi: Don't allow MWI FSK if channel not idle.


By: Friendly Automation (friendly-automation) 2022-05-02 15:46:32.781-0500

Change 18308 merged by Kevin Harwell:
chan_dahdi: Don't allow MWI FSK if channel not idle.