[SOLVED] Phantom Call After Hangup

I’m sorry if this has been posted before. There are a good number of “Hangup” threads, but none of them seem to be the same problem. Anyway, here it goes:

General: We’re running asterisk 1.4.21 for a client using 3 PSTN lines from AT&T. There are 4 Polycom phones and one Sipura analog adapter.

The Problem (use case): When users hang up BEFORE the external person does (regardless of which caller originated the call), the internal user receives a “phantom call” after the external person finally hangs up (I know this from calling externally and looking at the console on v10). This does not happen when the external party hangs up first. The call is ended successfully without issue.

Question: Why is this phantom call happening and how can we stop it?

Cfg’s:

[code][channels]
language = en
#include zapata_additional.conf

usecallerid = yes
sendcalleridafter = 3
busydetect = yes
faxdetect = incoming
context = from-zaptel
signalling = fxs_ks
group = 0
channel => 1-3[/code]

Log entry:

  -- Goto (macro-hangupcall,s,11)
    -- Executing [s@macro-hangupcall:11] Hangup("Zap/1-1", "") in new stack
  == Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'Zap/1-1' in macro 'hangupcall'
  == Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'Zap/1-1'
    -- Hungup 'Zap/1-1'
    -- Starting simple switch on 'Zap/1-1'
    -- Executing [s@from-zaptel:1] NoOp("Zap/1-1", "Entering from-zaptel with DID == ") in new stack
    -- Executing [s@from-zaptel:2] Ringing("Zap/1-1", "") in new stack
    -- Executing [s@from-zaptel:3] Set("Zap/1-1", "DID=s") in new stack
    -- Executing [s@from-zaptel:4] NoOp("Zap/1-1", "DID is now s") in new stack
    -- Executing [s@from-zaptel:5] GotoIf("Zap/1-1", "1?zapok:notzap") in new stack
    -- Goto (from-zaptel,s,8)
    -- Executing [s@from-zaptel:8] NoOp("Zap/1-1", "Is a Zaptel Channel") in new stack
    -- Executing [s@from-zaptel:9] Set("Zap/1-1", "CHAN=1-1") in new stack
    -- Executing [s@from-zaptel:10] Set("Zap/1-1", "CHAN=1") in new stack
    -- Executing [s@from-zaptel:11] Macro("Zap/1-1", "from-zaptel-1|s|1") in new stack
    -- Executing [s@from-zaptel:12] NoOp("Zap/1-1", "Returned from Macro from-zaptel-1") in new stack
    -- Executing [s@from-zaptel:13] Goto("Zap/1-1", "from-pstn|s|1") in new stack
    -- Goto (from-pstn,s,1)
    -- Executing [s@from-pstn:1] Set("Zap/1-1", "__FROM_DID=s") in new stack
    -- Executing [s@from-pstn:2] GotoIf("Zap/1-1", "0 ?cidok") in new stack
    -- Executing [s@from-pstn:3] Set("Zap/1-1", "CALLERID(name)=") in new stack
    -- Executing [s@from-pstn:4] NoOp("Zap/1-1", "CallerID is "" <>") in new stack

(Between lines 5 and 6 is the new call initiation)

Hardware:
Wildcard TDM410p

The only other issue we have with the system (related or unrelated) is callerid is not showing up. I don’t know if that has anything to do with the problem, but, thought I’d mention it just in case. Everything else seems to be working great.

We tried using callprogress=yes with very bad results. Users on the other end of the line couldn’t hear the internal calling party for 4-5 seconds after picking up the line.

Any help would be greatly appreciated!!

Thanks.

So, I don’t know if this is the “right” way to solve the problem…but here’s what we did:

We are also using FreePBX to manage this * system. So we modified the extensions_override_freepbx.conf to the following (it was empty):

; Modification for phantom ringback
[from-pstn]
exten => s,1,WaitForRing(1)
include => from-pstn-custom                     ; create this context in extensions_custom.conf to include customizations
include => ext-did
include => from-did-direct		; MODIFICATOIN (PL) for findmefollow if enabled, should be bofore ext-local
include => ext-did-catchall		; THIS MUST COME AFTER ext-did

From the source:

Description
  WaitForRing(timeout)
Returns 0 after waiting at least timeout seconds. and
only after the next ring has completed.  Returns 0 on
success or -1 on hangup

Evidentially, the old analog lines in this location were just sending a quick click to make * believe a new call came in, then immediately hung up. WaitForRing will allow those calls to be ignored as it doesn’t pass them to the next step of the dialplan.