Call external number via DAHDI cause internal extension to ring

Hi! I’m becoming crazy! I have an analog phone connected to an FXS port that if call a phone number (all phone numbers …) just cause another extension to ring (but i’m not calling that extension!)

any idea?

here’s log:

– Starting simple switch on ‘DAHDI/1-1’
– Executing [[email protected]:1] NoOp(“DAHDI/1-1”, “Catch-All DID Match - Found externalnumber - You probably want a DID for this.”) in new stack
– Executing [[email protected]:2] Goto(“DAHDI/1-1”, “ext-did,s,1”) in new stack
– Goto (ext-did,s,1)
– Executing [[email protected]:1] Set(“DAHDI/1-1”, “__FROM_DID=s”) in new stack
– Executing [[email protected]:2] ExecIf(“DAHDI/1-1”, “1 ?Set(CALLERID(name)=)”) in new stack
– Executing [[email protected]:3] Set(“DAHDI/1-1”, “__CALLINGPRES_SV=allowed_not_screened”) in new stack
– Executing [[email protected]:4] Set(“DAHDI/1-1”, “CALLERPRES()=allowed_not_screened”) in new stack
– Executing [[email protected]:5] Goto(“DAHDI/1-1”, “ext-group,1000,1”) in new stack
– Goto (ext-group,1000,1)
– Executing [[email protected]:1] Macro(“DAHDI/1-1”, “user-callerid,”) in new stack
– Executing [[email protected]:1] Set(“DAHDI/1-1”, “AMPUSER=”) in new stack
– Executing [[email protected]:2] GotoIf(“DAHDI/1-1”, “0?report”) in new stack
– Executing [[email protected]:3] ExecIf(“DAHDI/1-1”, “1?Set(REALCALLERIDNUM=)”) in new stack
– Executing [[email protected]:4] Set(“DAHDI/1-1”, “AMPUSER=”) in new stack
– Executing [[email protected]:5] Set(“DAHDI/1-1”, “AMPUSERCIDNAME=”) in new stack
– Executing [[email protected]:6] GotoIf(“DAHDI/1-1”, “1?report”) in new stack
– Goto (macro-user-callerid,s,10)
– Executing [[email protected]:10] GotoIf(“DAHDI/1-1”, “0?continue”) in new stack
– Executing [[email protected]:11] Set(“DAHDI/1-1”, “__TTL=64”) in new stack
– Executing [[email protected]:12] GotoIf(“DAHDI/1-1”, “1?continue”) in new stack
– Goto (macro-user-callerid,s,19)
– Executing [[email protected]:19] Set(“DAHDI/1-1”, “CALLERID(number)=”) in new stack
– Executing [[email protected]:20] Set(“DAHDI/1-1”, “CALLERID(name)=”) in new stack
– Executing [[email protected]:21] NoOp(“DAHDI/1-1”, “Using CallerID “” <>”) in new stack
– Executing [[email protected]:2] GotoIf(“DAHDI/1-1”, “1?skipdb”) in new stack
– Goto (ext-group,1000,4)
– Executing [[email protected]:4] Set(“DAHDI/1-1”, “__NODEST=”) in new stack
– Executing [[email protected]:5] Set(“DAHDI/1-1”, “__BLKVM_OVERRIDE=BLKVM/1000/DAHDI/1-1”) in new stack
– Executing [[email protected]:6] Set(“DAHDI/1-1”, “__BLKVM_BASE=1000”) in new stack
– Executing [[email protected]:7] Set(“DAHDI/1-1”, “DB(BLKVM/1000/DAHDI/1-1)=TRUE”) in new stack
– Executing [[email protected]:8] Set(“DAHDI/1-1”, “RRNODEST=”) in new stack
– Executing [[email protected]:9] Set(“DAHDI/1-1”, “__NODEST=1000”) in new stack
– Executing [[email protected]:10] GosubIf(“DAHDI/1-1”, “0?sub-rgsetcid,s,1”) in new stack
– Executing [[email protected]:11] Set(“DAHDI/1-1”, “RecordMethod=Group”) in new stack
– Executing [[email protected]:12] Macro(“DAHDI/1-1”, “record-enable,100-115,Group”) in new stack
– Executing [[email protected]:1] GotoIf(“DAHDI/1-1”, “1?check”) in new stack
– Goto (macro-record-enable,s,4)
– Executing [[email protected]:4] ExecIf(“DAHDI/1-1”, “0?MacroExit()”) in new stack
– Executing [[email protected]:5] GotoIf(“DAHDI/1-1”, “1?Group:OUT”) in new stack
– Goto (macro-record-enable,s,6)
– Executing [[email protected]:6] Set(“DAHDI/1-1”, “LOOPCNT=2”) in new stack
– Executing [[email protected]:7] Set(“DAHDI/1-1”, “ITER=1”) in new stack
– Executing [[email protected]:8] GotoIf(“DAHDI/1-1”, “1?continue”) in new stack
– Goto (macro-record-enable,s,13)
– Executing [[email protected]:13] Set(“DAHDI/1-1”, “ITER=2”) in new stack
– Executing [[email protected]:14] GotoIf(“DAHDI/1-1”, “1?begin”) in new stack
– Goto (macro-record-enable,s,8)
– Executing [[email protected]:8] GotoIf(“DAHDI/1-1”, “1?continue”) in new stack
– Goto (macro-record-enable,s,13)
– Executing [[email protected]:13] Set(“DAHDI/1-1”, “ITER=3”) in new stack
– Executing [[email protected]:14] GotoIf(“DAHDI/1-1”, “0?begin”) in new stack
– Executing [[email protected]:15] GotoIf(“DAHDI/1-1”, “0?IN”) in new stack
– Executing [[email protected]:16] ExecIf(“DAHDI/1-1”, “1?MacroExit()”) in new stack
– Executing [[email protected]:13] Set(“DAHDI/1-1”, “RingGroupMethod=ringall”) in new stack
– Executing [[email protected]:14] Macro(“DAHDI/1-1”, “dial,20,tr,100-115”) in new stack
– Executing [[email protected]:1] GotoIf(“DAHDI/1-1”, “1?dial”) in new stack
– Goto (macro-dial,s,3)
– Executing [[email protected]: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 ‘ringall’
– dialparties.agi: Added extension 100 to extension map
– dialparties.agi: Added extension 115 to extension map
– dialparties.agi: Extension 100 cf is disabled
– dialparties.agi: Extension 115 cf is disabled
– dialparties.agi: Extension 100 do not disturb is disabled
– dialparties.agi: Extension 115 do not disturb is disabled
dialparties.agi: extnum 100 has: cw: 1; hascfb: 0 [] hascfu: 0 []
– dialparties.agi: DbDel CALLTRACE/100 - Caller ID is not defined
dialparties.agi: extnum 115 has: cw: 0; hascfb: 0 [] hascfu: 0 []
dialparties.agi: EXTENSION_STATE: 1 (INUSE)
dialparties.agi: Extension 115 has ExtensionState: 1
– dialparties.agi: Checking CW and CFB status for extension 115
dialparties.agi: Extension 115 is not available to be called
dialparties.agi: Extension 115 has call waiting disabled
– dialparties.agi: Filtered ARG3: 100
dialparties.agi: NODEST: 1000 adding M(auto-blkvm) to dialopts: trM(auto-blkvm)
dialparties.agi: NODEST: 1000 blkvm enabled macro already in dialopts: trM(auto-blkvm)
– <DAHDI/1-1>AGI Script dialparties.agi completed, returning 0
– Executing [[email protected]:7] Dial(“DAHDI/1-1”, “SIP/100,20,trM(auto-blkvm)”) in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
– Called 100
– SIP/100-00000018 is ringing
== Spawn extension (macro-dial, s, 7) exited non-zero on ‘DAHDI/1-1’ in macro ‘dial’
== Spawn extension (ext-group, 1000, 14) exited non-zero on ‘DAHDI/1-1’
– Executing [[email protected]:1] Macro(“DAHDI/1-1”, “hangupcall,”) in new stack
– Executing [[email protected]:1] GotoIf(“DAHDI/1-1”, “1?skiprg”) in new stack
– Goto (macro-hangupcall,s,4)
– Executing [[email protected]:4] GotoIf(“DAHDI/1-1”, “0?skipblkvm”) in new stack
– Executing [[email protected]:5] NoOp(“DAHDI/1-1”, “Cleaning Up Block VM Flag: BLKVM/1000/DAHDI/1-1”) in new stack
– Executing [[email protected]:6] NoOp(“DAHDI/1-1”, “Deleting: BLKVM/1000/DAHDI/1-1 TRUE”) in new stack
– Executing [[email protected]:7] GotoIf(“DAHDI/1-1”, “1?theend”) in new stack
– Goto (macro-hangupcall,s,9)
– Executing [[email protected]: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 (ext-group, h, 1) exited non-zero on ‘DAHDI/1-1’
– Hungup ‘DAHDI/1-1’

Nobody has an idea? :frowning:

I think this FXS port is in a wrong context. This above one is from-pstn when it should actually be from-internal. Then the from-pstn call is ending up with a ring group 1000 which i guess rings everything.

So, edit your dahdi channels and make sure this phone (or all those FXS internal phones) uses from-internal context.

Good luck!

Found this on dahdi-channels.conf, where’s the error?

; Span 1: WCTDM/4 “Wildcard TDM400P REV E/F Board 5” (MASTER)
;;; line="1 WCTDM/4/0 FXOKS"
signalling=fxo_ks
callerid=“Channel 1” <4001>
mailbox=4001
group=5
context=from-internal
channel => 1
callerid=
mailbox=
group=
context=default

;;; line="2 WCTDM/4/1 FXOKS"
signalling=fxo_ks
callerid=“Channel 2” <4002>
mailbox=4002
group=5
context=from-internal
channel => 2
callerid=
mailbox=
group=
context=default

;;; line="4 WCTDM/4/3 FXSKS"
signalling=fxs_ks
callerid=asreceived
group=0
context=from-pstn
channel => 4
callerid=
group=
context=default

Found this on dahdi-channels.conf, where’s the error?

; Span 1: WCTDM/4 “Wildcard TDM400P REV E/F Board 5” (MASTER)
;;; line="1 WCTDM/4/0 FXOKS"
signalling=fxo_ks
callerid=“Channel 1” <4001>
mailbox=4001
group=5
context=from-internal
channel => 1
callerid=
mailbox=
group=
context=default

;;; line="2 WCTDM/4/1 FXOKS"
signalling=fxo_ks
callerid=“Channel 2” <4002>
mailbox=4002
group=5
context=from-internal
channel => 2
callerid=
mailbox=
group=
context=default

;;; line="4 WCTDM/4/3 FXSKS"
signalling=fxs_ks
callerid=asreceived
group=0
context=from-pstn
channel => 4
callerid=
group=
context=default

I think you may have got it in reversed.

FXS should be from-internal and FXO should from-pstn.

For the above problem change like here below
;;; line="4 WCTDM/4/3 FXSKS"
signalling=fxs_ks
callerid=asreceived
group=0
context=from-internal
channel => 4
callerid=
group=
context=default

I’m loosing myself:

localhostCLI> dahdi restart
Destroying channels and reloading DAHDI configuration.
> Initial softhangup of all DAHDI channels complete.
> Final softhangup of all DAHDI channels complete.
== Unregistered channel -2
== Unregistered channel 1
== Unregistered channel 2
== Unregistered channel 4
== Parsing ‘/etc/asterisk/chan_dahdi.conf’: == Found
== Parsing ‘/etc/asterisk/dahdi-channels.conf’: == Found
– Reconfigured channel 1, FXO Kewlstart signalling
– Reconfigured channel 2, FXO Kewlstart signalling
– Reconfigured channel 4, FXS Kewlstart signalling
– Automatically generated pseudo channel
localhost
CLI> dahdi show channels
Chan Extension Context Language MOH Interpret Blocked State
pseudo default default In Service
1 default it default In Service
2 from-pstn it default In Service
4 from-pstn it default In Service
localhost*CLI>

see file:

chan_dahdi.conf:

#include dahdi-channels.conf

[channels]
language=it

echocanceller=mg2,1-8

; include dahdi extensions defined in FreePBX
include chan_dahdi_additional.conf

; XTDM20B Port #1,2 plugged into PSTN
;AMPLABEL:Channel %c - Button %n

;context=from-pstn

signalling=fxo_ks
faxdetect=incoming
usecallerid=yes
echocancel=256
echocancelwhenbridged=no
echotraining=800
group=5
channel=1

context=from-pstn

signalling=fxo_ks
faxdetect=incoming
usecallerid=yes
echocancel=yes
echocancelwhenbridged=no
echotraining=800
group=5
channel=2
context=from-pstn

signalling=fxs_ks
faxdetect=incoming
usecallerid=yes
echocancel=yes
echocancelwhenbridged=no
echotraining=800
group=0
busydetect=yes
busycount=6
callprogress=yes
Hanguponpolarityswitch=yes
channel=4
context=from-internal

I don’t understand where context=default is loaded from, and see channels, seems to be different in asterisk :frowning: