Phantom Dahdi calls after hangup

On more than one occasion I have had “phantom” calls from unknown, unknown on dadhi channels after someone makes a call and either party hangs up. I have tried fxotune and used oslec on the channels that have the problem.

Dahdi is 2.4.0 and asterisk is 1.6.2.16. The channels were on an Astribank with 8 fxo ports and a Sangoma u100. I thought it was just a really bad line in the building in question but I was able to reproduce the symptoms at a different location.

The CLI shows the channel in question “spawning a new” connection on dahdi x-x.

What would cause behavior like this? What might fix it?

See red, bold text from CLI output below:

-- Executing [s@macro-user-callerid:3] ExecIf("DAHDI/1-1", "1?Set(REALCALLERIDNUM=)") in new stack
-- Executing [s@macro-user-callerid:4] Set("DAHDI/1-1", "AMPUSER=") in new stack
-- Executing [s@macro-user-callerid:5] Set("DAHDI/1-1", "AMPUSERCIDNAME=") in new stack
-- Executing [s@macro-user-callerid:6] GotoIf("DAHDI/1-1", "1?report") in new stack
-- Goto (macro-user-callerid,s,10)
-- Executing [s@macro-user-callerid:10] GotoIf("DAHDI/1-1", "0?continue") in new stack
-- Executing [s@macro-user-callerid:11] Set("DAHDI/1-1", "__TTL=64") in new stack
-- Executing [s@macro-user-callerid:12] GotoIf("DAHDI/1-1", "1?continue") in new stack
-- Goto (macro-user-callerid,s,19)
-- Executing [s@macro-user-callerid:19] Set("DAHDI/1-1", "CALLERID(number)=") in new stack
-- Executing [s@macro-user-callerid:20] Set("DAHDI/1-1", "CALLERID(name)=") in new stack
-- Executing [s@macro-user-callerid:21] NoOp("DAHDI/1-1", "Using CallerID "" <>") in new stack
-- Executing [s@macro-exten-vm:2] Set("DAHDI/1-1", "RingGroupMethod=none") in new stack
-- Executing [s@macro-exten-vm:3] Set("DAHDI/1-1", "VMBOX=6015") in new stack
-- Executing [s@macro-exten-vm:4] Set("DAHDI/1-1", "EXTTOCALL=6015") in new stack
-- Executing [s@macro-exten-vm:5] Set("DAHDI/1-1", "CFUEXT=") in new stack
-- Executing [s@macro-exten-vm:6] Set("DAHDI/1-1", "CFBEXT=") in new stack
-- Executing [s@macro-exten-vm:7] Set("DAHDI/1-1", "RT=15") in new stack
-- Executing [s@macro-exten-vm:8] Macro("DAHDI/1-1", "record-enable,6015,IN") in new stack
-- Executing [s@macro-record-enable:1] GotoIf("DAHDI/1-1", "1?check") in new stack
-- Goto (macro-record-enable,s,4)
-- Executing [s@macro-record-enable:4] ExecIf("DAHDI/1-1", "0?MacroExit()") in new stack
-- Executing [s@macro-record-enable:5] GotoIf("DAHDI/1-1", "0?Group:OUT") in new stack
-- Goto (macro-record-enable,s,15)
-- Executing [s@macro-record-enable:15] GotoIf("DAHDI/1-1", "1?IN") in new stack
-- Goto (macro-record-enable,s,20)
-- Executing [s@macro-record-enable:20] ExecIf("DAHDI/1-1", "1?MacroExit()") in new stack
-- Executing [s@macro-exten-vm:9] Macro("DAHDI/1-1", "dial,15,tTrwW,6015") in new stack
-- Executing [s@macro-dial:1] GotoIf("DAHDI/1-1", "1?dial") in new stack
-- Goto (macro-dial,s,3)
-- Executing [s@macro-dial:3] AGI("DAHDI/1-1", "dialparties.agi") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/dialparties.agi

dialparties.agi: Starting New Dialparties.agi
dialparties.agi: Caller ID name is ‘unknown’ number is ‘unknown’
> dialparties.agi: USE_CONFIRMATION: ‘FALSE’
> dialparties.agi: RINGGROUP_INDEX: ''
dialparties.agi: Methodology of ring is ‘none’
– dialparties.agi: Added extension 6015 to extension map
> dialparties.agi: Extension 6015 has call screening off
– dialparties.agi: Extension 6015 cf is disabled
– dialparties.agi: Extension 6015 do not disturb is disabled
> dialparties.agi: extnum 6015 has: cw: 1; hascfb: 0 [] hascfu: 0 []
dialparties.agi: EXTENSION_STATE: 0 (NOT_INUSE)
– dialparties.agi: DbDel CALLTRACE/6015 - Caller ID is not defined
– dialparties.agi: Filtered ARG3: 6015
– <DAHDI/1-1>AGI Script dialparties.agi completed, returning 0
– Executing [s@macro-dial:7] Dial(“DAHDI/1-1”, “SIP/6015,15,tTrwW”) in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Called 6015
– SIP/6015-00000007 is ringing
– SIP/6015-00000007 answered DAHDI/1-1
– Executing [h@macro-dial:1] Macro(“DAHDI/1-1”, “hangupcall”) in new stack
– Executing [s@macro-hangupcall:1] GotoIf(“DAHDI/1-1”, “1?skiprg”) in new stack
– Goto (macro-hangupcall,s,4)
– Executing [s@macro-hangupcall:4] GotoIf(“DAHDI/1-1”, “1?skipblkvm”) in new stack
– Goto (macro-hangupcall,s,7)
– Executing [s@macro-hangupcall:7] GotoIf(“DAHDI/1-1”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,9)
– Executing [s@macro-hangupcall:9] Hangup(“DAHDI/1-1”, “”) in new stack
== Spawn extension (macro-hangupcall, s, 9) exited non-zero on ‘DAHDI/1-1’ in macro ‘hangupcall’
== Spawn extension (macro-dial, h, 1) exited non-zero on ‘DAHDI/1-1’
== Spawn extension (macro-dial, s, 7) exited non-zero on ‘DAHDI/1-1’ in macro ‘dial’
== Spawn extension (macro-exten-vm, s, 9) exited non-zero on ‘DAHDI/1-1’ in macro ‘exten-vm’
== Spawn extension (from-did-direct, 6015, 1) exited non-zero on ‘DAHDI/1-1’
[color=#800040] – Hungup ‘DAHDI/1-1’
– Starting simple switch on ‘DAHDI/1-1’
[/color]
– Executing [s@from-zaptel:1] NoOp(“DAHDI/1-1”, "Entering from-zaptel with DID == ") in new stack
– Executing [s@from-zaptel:2] Ringing(“DAHDI/1-1”, “”) in new stack
– Executing [s@from-zaptel:3] Set(“DAHDI/1-1”, “DID=s”) in new stack
– Executing [s@from-zaptel:4] NoOp(“DAHDI/1-1”, “DID is now s”) in new stack
– Executing [s@from-zaptel:5] GotoIf(“DAHDI/1-1”, “1?zapok:notzap”) in new stack
– Goto (from-zaptel,s,8)
– Executing [s@from-zaptel:8] NoOp(“DAHDI/1-1”, “Is a Zaptel Channel”) in new stack
– Executing [s@from-zaptel:9] Set(“DAHDI/1-1”, “CHAN=1-1”) in new stack
– Executing [s@from-zaptel:10] Set(“DAHDI/1-1”, “CHAN=1”) in new stack
– Executing [s@from-zaptel:11] Macro(“DAHDI/1-1”, “from-zaptel-1,s,1”) in new stack
– Executing [s@macro-from-zaptel-1:1] NoOp(“DAHDI/1-1”, “Entering macro-from-zaptel-1 with DID = s and setting to: 15136861881”) in new stack
– Executing [s@macro-from-zaptel-1:2] Set(“DAHDI/1-1”, “__FROM_DID=15136861881”) in new stack
– Executing [s@macro-from-zaptel-1:3] Goto(“DAHDI/1-1”, “from-trunk,15136861881,1”) in new stack
– Goto (from-trunk,15136861881,1)
== Channel ‘DAHDI/1-1’ jumping out of macro ‘from-zaptel-1’
– Executing [15136861881@from-trunk:1] Set(“DAHDI/1-1”, “__FROM_DID=15136861881”) in new stack
– Executing [15136861881@from-trunk:2] Gosub(“DAHDI/1-1”, “app-blacklist-check,s,1”) in new stack
– Executing [s@app-blacklist-check:1] GotoIf(“DAHDI/1-1”, “0?blacklisted”) in new stack
– Executing [s@app-blacklist-check:2] Set(“DAHDI/1-1”, “CALLED_BLACKLIST=1”) in new stack
– Executing [s@app-blacklist-check:3] Return(“DAHDI/1-1”, “”) in new stack
– Executing [15136861881@from-trunk:3] ExecIf(“DAHDI/1-1”, “1 ?Set(CALLERID(name)=)”) in new stack
– Executing [15136861881@from-trunk:4] Set(“DAHDI/1-1”, “__CALLINGPRES_SV=allowed_not_screened”) in new stack
– Executing [15136861881@from-trunk:5] Set(“DAHDI/1-1”, “CALLERPRES()=allowed_not_screened”) in new stack
– Executing [15136861881@from-trunk:6] Goto(“DAHDI/1-1”, “from-did-direct,6015,1”) in new stack
– Goto (from-did-direct,6015,1)
– Executing [6015@from-did-direct:1] Macro(“DAHDI/1-1”, “exten-vm,6015,6015”) in new stack
– Executing [s@macro-exten-vm:1] Macro(“DAHDI/1-1”, “user-callerid,”) in new stack
– Executing [s@macro-user-callerid:1] Set(“DAHDI/1-1”, “AMPUSER=”) in new stack
– Executing [s@macro-user-callerid:2] GotoIf(“DAHDI/1-1”, “0?report”) in new stack
– Executing [s@macro-user-callerid:3] ExecIf(“DAHDI/1-1”, “1?Set(REALCALLERIDNUM=)”) in new stack
– Executing [s@macro-user-callerid:4] Set(“DAHDI/1-1”, “AMPUSER=”) in new stack
– Executing [s@macro-user-callerid:5] Set(“DAHDI/1-1”, “AMPUSERCIDNAME=”) in new stack
– Executing [s@macro-user-callerid:6] GotoIf(“DAHDI/1-1”, “1?report”) in new stack
– Goto (macro-user-callerid,s,10)
– Executing [s@macro-user-callerid:10] GotoIf(“DAHDI/1-1”, “0?continue”) in new stack
– Executing [s@macro-user-callerid:11] Set(“DAHDI/1-1”, “__TTL=64”) in new stack
– Executing [s@macro-user-callerid:12] GotoIf(“DAHDI/1-1”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,19)
– Executing [s@macro-user-callerid:19] Set(“DAHDI/1-1”, “CALLERID(number)=”) in new stack
– Executing [s@macro-user-callerid:20] Set(“DAHDI/1-1”, “CALLERID(name)=”) in new stack
– Executing [s@macro-user-callerid:21] NoOp(“DAHDI/1-1”, “Using CallerID “” <>”) in new stack
– Executing [s@macro-exten-vm:2] Set(“DAHDI/1-1”, “RingGroupMethod=none”) in new stack
– Executing [s@macro-exten-vm:3] Set(“DAHDI/1-1”, “VMBOX=6015”) in new stack
– Executing [s@macro-exten-vm:4] Set(“DAHDI/1-1”, “EXTTOCALL=6015”) in new stack
– Executing [s@macro-exten-vm:5] Set(“DAHDI/1-1”, “CFUEXT=”) in new stack
– Executing [s@macro-exten-vm:6] Set(“DAHDI/1-1”, “CFBEXT=”) in new stack
– Executing [s@macro-exten-vm:7] Set(“DAHDI/1-1”, “RT=15”) in new stack
– Executing [s@macro-exten-vm:8] Macro(“DAHDI/1-1”, “record-enable,6015,IN”) in new stack
– Executing [s@macro-record-enable:1] GotoIf(“DAHDI/1-1”, “1?check”) in new stack
– Goto (macro-record-enable,s,4)
– Executing [s@macro-record-enable:4] ExecIf(“DAHDI/1-1”, “0?MacroExit()”) in new stack
– Executing [s@macro-record-enable:5] GotoIf(“DAHDI/1-1”, “0?Group:OUT”) in new stack
– Goto (macro-record-enable,s,15)
– Executing [s@macro-record-enable:15] GotoIf(“DAHDI/1-1”, “1?IN”) in new stack
– Goto (macro-record-enable,s,20)
– Executing [s@macro-record-enable:20] ExecIf(“DAHDI/1-1”, “1?MacroExit()”) in new stack
– Executing [s@macro-exten-vm:9] Macro(“DAHDI/1-1”, “dial,15,tTrwW,6015”) in new stack
– Executing [s@macro-dial:1] GotoIf(“DAHDI/1-1”, “1?dial”) in new stack
– Goto (macro-dial,s,3)
– Executing [s@macro-dial:3] AGI(“DAHDI/1-1”, “dialparties.agi”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/dialparties.agi
dialparties.agi: Starting New Dialparties.agi
dialparties.agi: Caller ID name is ‘unknown’ number is ‘unknown’
> dialparties.agi: USE_CONFIRMATION: ‘FALSE’
> dialparties.agi: RINGGROUP_INDEX: ''
dialparties.agi: Methodology of ring is ‘none’
– dialparties.agi: Added extension 6015 to extension map
> dialparties.agi: Extension 6015 has call screening off
– dialparties.agi: Extension 6015 cf is disabled
– dialparties.agi: Extension 6015 do not disturb is disabled
> dialparties.agi: extnum 6015 has: cw: 1; hascfb: 0 [] hascfu: 0 []
dialparties.agi: EXTENSION_STATE: 0 (NOT_INUSE)
– dialparties.agi: DbDel CALLTRACE/6015 - Caller ID is not defined
– dialparties.agi: Filtered ARG3: 6015
– <DAHDI/1-1>AGI Script dialparties.agi completed, returning 0
– Executing [s@macro-dial:7] Dial(“DAHDI/1-1”, “SIP/6015,15,tTrwW”) in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Called 6015
– SIP/6015-00000008 is ringing
== Spawn extension (macro-dial, s, 7) exited non-zero on ‘DAHDI/1-1’ in macro ‘dial’
== Spawn extension (macro-exten-vm, s, 9) exited non-zero on ‘DAHDI/1-1’ in macro ‘exten-vm’
== Spawn extension (from-did-direct, 6015, 1) exited non-zero on ‘DAHDI/1-1’
– Hungup 'DAHDI/1-1’
eco-demo*CLI>

I am having a similar problem. The CLI show doesn’t show that my extension is receiving a phone call, but my cordless phone lights up, not ringing, though. After which I get ‘1 missed call’ in the log on the phone. Did you ever find a fix for this?

You need to provide your chan_dahdi.conf settings, details of your PTT, and a log with sufficient debugging to show the line state changes seen by the FXO card (if you don’t see “battery” in the traces, they are not detailed enough).

chan_dahdi.conf:

[trunkgroups]

[channels]

language=us
context=from-zaptel
signalling=fxs_ks
rxwink=300              ; Atlas seems to use long (250ms) winks
;
; Whether or not to do distinctive ring detection on FXO lines
;
;usedistinctiveringdetection=yes
busydetect=yes
busycount=6
hanguponpolarityswitch=yes
usecallerid=yes
hidecallerid=no
callwaiting=yes
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
transfer=yes
cancallforward=yes
callreturn=yes
echocancel=yes
echocancelwhenbridged=no
echotraining=800
rxgain=6.0
txgain=6.0
group=0
callgroup=1
pickupgroup=1
immediate=no
faxdetect=incoming
group=1

#include dahdi-channels.conf
#include chan_dahdi_additional.conf

The phones I have connected is a AT&T DECT 6 phone, and an Aastra 470 via line splitter. I only get the phantom call back on the Cordless, though. It happens if I hang up either phone, whether its after a successful call, or just checking for dial tone.

Asterisk output:

[root@dtc-asterisk ~]# asterisk -rvvvvvvvvvvvv Verbosity was 3 and is now 12 -- Starting simple switch on 'DAHDI/4-1' <--- I get the dial tone, nothing wrong -- Hanging up on 'DAHDI/4-1' -- Hungup 'DAHDI/4-1' < --- after hangup, phone flashes with 'device 1004' followed by missed call from 1004 (img below) dtc-asterisk*CLI>
https://docs.google.com/leaf?id=0B2Iztnf2sp2QNjY0NTVhZTUtYTQ0OC00OGY3LWI0NDItMDQzZDhjMjgxZDc0&hl=en&authkey=CPXbnp4D

Asterisk Version 1.8.3.2
DAHDi Version 2.4.1.1
FreePBX 2.8.1

Addendum:

while running dahdi_monitor, I found that when the phone gets the "call"s, the TX and RX both almost max out right before the phone starts to blink