Analog Dial Out problem, Astk 1.6 + Dahdi 2.1.0.4 + Gui 2.0

I am new to asterisk so try to bear with me. I have a Digium TDM400P REV I Board 5, and I am using asterisk 1.6 + Asterisk Gui 2.0 + DAHDI Version: 2.1.0.4 Echo Canceller.

I have 2 FXS and 2 FXO, so I have to analog phone devices and two analog phone lines.

Right now I can receive incoming phone calls, but cannot dial outgoing:

The dial plan in the extensions.conf for the 2 trunks is:

[CallingRule_Local]
exten = _9XXXXXXX!,1,Macro(trunkdial-failover-0.3,${trunk_1}/${EXTEN:1},${trunk_2}/${EXTEN:1},trunk_1,trunk_2)

Son When Trunk_1 fails it should failover to Trunk_2.

The CLI output says:

[i]TSVoIP*CLI>
[May 4 14:06:05] WARNING[5675]: chan_dahdi.c:2027 dahdi_enable_ec: Unable to enable echo cancellation on channel 2 (No such device)
– Executing [92638947@DLPN_Local:1] Macro(“DAHDI/2-1”, “trunkdial-failover-0.3,DAHDI/trunk_1/2638947,DAHDI/trunk_2/2638947,trunk_1,trunk_2”) in new stack
– Executing [s@macro-trunkdial-failover-0.3:1] GotoIf(“DAHDI/2-1”, “0?1-fmsetcid,1”) in new stack
– Executing [s@macro-trunkdial-failover-0.3:2] GotoIf(“DAHDI/2-1”, “0?1-setgbobname,1”) in new stack
– Executing [s@macro-trunkdial-failover-0.3:3] Set(“DAHDI/2-1”, “CALLERID(num)=6102”) in new stack
– Executing [s@macro-trunkdial-failover-0.3:4] GotoIf(“DAHDI/2-1”, “0?1-dial,1”) in new stack
– Executing [s@macro-trunkdial-failover-0.3:5] Set(“DAHDI/2-1”, “CALLERID(all)=”) in new stack
– Executing [s@macro-trunkdial-failover-0.3:6] Goto(“DAHDI/2-1”, “1-dial,1”) in new stack
– Goto (macro-trunkdial-failover-0.3,1-dial,1)
– Executing [1-dial@macro-trunkdial-failover-0.3:1] Dial(“DAHDI/2-1”, “DAHDI/trunk_1/2638947”) in new stack
[May 4 14:06:05] WARNING[5675]: chan_dahdi.c:9532 dahdi_request: Unable to determine channel for data trunk_1/2638947
[May 4 14:06:05] WARNING[5675]: app_dial.c:1518 dial_exec_full: Unable to create channel of type ‘DAHDI’ (cause 0 - Unknown)
== Everyone is busy/congested at this time (1:0/0/1)
– Executing [1-dial@macro-trunkdial-failover-0.3:2] GotoIf(“DAHDI/2-1”, “21 > 0 ?1-CHANUNAVAIL,1:1-out,1”) in new stack
– Goto (macro-trunkdial-failover-0.3,1-CHANUNAVAIL,1)
– Executing [1-CHANUNAVAIL@macro-trunkdial-failover-0.3:1] Dial(“DAHDI/2-1”, “DAHDI/trunk_2/2638947”) in new stack
[May 4 14:06:05] WARNING[5675]: chan_dahdi.c:9532 dahdi_request: Unable to determine channel for data trunk_2/2638947
[May 4 14:06:05] WARNING[5675]: app_dial.c:1518 dial_exec_full: Unable to create channel of type ‘DAHDI’ (cause 0 - Unknown)
== Everyone is busy/congested at this time (1:0/0/1)
– Executing [1-CHANUNAVAIL@macro-trunkdial-failover-0.3:2] Hangup(“DAHDI/2-1”, “”) in new stack
== Spawn extension (macro-trunkdial-failover-0.3, 1-CHANUNAVAIL, 2) exited non-zero on ‘DAHDI/2-1’ in macro ‘trunkdial-failover-0.3’
== Spawn extension (DLPN_Local, 92638947, 1) exited non-zero on ‘DAHDI/2-1’
– Hungup ‘DAHDI/2-1’

Do you have any ideas, why it is no dialing out? I use to have AsteriskNow 1.0.2, and it worked fine.

I really appreciate you help.

Regards,

Carlos V.

Hi,

after successfully generating my asterisk from source (1.6.1/DAHDI 2.1.0.4), now still one problem left: I can call from analogue phone to SIP-phone, I can receive inbound calls on analogue phone, but can not do outbound analog calls.
Before, running older version of asterisk/zaptel, everything worked fine.
Any idea ?

Below some system info:

asterisk -vvvvvvvvvr, when trying to do analogue call from phone to PSTN:

– Starting simple switch on ‘DAHDI/2-1’
– Executing [470555@to_analog_phone:1] Dial(“DAHDI/2-1”, “dahdi/1/470555,10,tTm”) in new stack
[May 13 19:10:10] WARNING[6461]: app_dial.c:1518 dial_exec_full: Unable to create channel of type ‘dahdi’ (cause 0 - Unknown)
== Everyone is busy/congested at this time (1:0/0/1)
– Executing [470555@to_analog_phone:2] VoiceMail(“DAHDI/2-1”, “100”) in new stack
– <DAHDI/2-1> Playing ‘vm-intro.gsm’ (language ‘ru’)
== Spawn extension (to_analog_phone, 470555, 2) exited non-zero on ‘DAHDI/2-1’
– Hungup ‘DAHDI/2-1’

dahdi show channels
Chan Extension Context Language MOH Interpret Blocked State
pseudo default default In Service
1 to_UKRTelcom ru default In Service
2 to_analog_phone ru default In Service
Gateway-Niko*CLI>

Excerpt from extensions.conf:
[to_analog_phone]
exten => _00X.,1,Dial(SIP/${EXTEN:2}@bellshare,30,tr)
exten => _00X.,2,hangup()
exten => _8X.,1,Dial(SIP/${EXTEN:1}@bellshare,30,trg)
exten => _999X.,1,SetCallerID(“023658568281”)
exten => _999X.,2,Dial(SIP/${EXTEN:4}@GSM-Gateway,60,r)
exten => _999X.,3,hangUp()
exten => 2001,1,Dial(SIP/Tanyusha2,20)
exten => 2001,2,Voicemail(2001)
exten => 2001,3,hangUp()
exten => _X.,1,Dial(dahdi/1/${EXTEN},10,tTm)
exten => _X.,2,Voicemail(100)
exten => _X.,3,hangUp()

Gateway-NikoCLI> dahdi show channel 1
Channel: 1ko
CLI>
File Descriptor: 10
Span: 1
Extension:
Dialing: no
Context: to_UKRTelcom
Caller ID: 0
Calling TON: 0
Caller ID name: PSTN
Mailbox: none
Destroy: 0
InAlarm: 0
Signalling Type: FXS Kewlstart
Radio: 0
Owner:
Real:
Callwait:
Threeway:
Confno: -1
Propagated Conference: -1
Real in conference: 0
DSP: no
Busy Detection: yes
Busy Count: 10
Busy Pattern: 0,0
TDD: no
Relax DTMF: no
Dialing/CallwaitCAS: 0/0
Default law: ulaw
Fax Handled: no
Pulse phone: no
DND: no
Echo Cancellation:
128 taps
(unless TDM bridged) currently OFF
Actual Confinfo: Num/0, Mode/0x0000
Actual Confmute: No
Hookstate (FXS only): Onhook

Autogenerated by /usr/sbin/dahdi_genconf on Sat May 9 22:34:41 2009 – do not hand edit

Dahdi Configuration File

This file is parsed by the Dahdi Configurator, dahdi_cfg

Span 1: WCTDM/4 “Wildcard TDM400P REV E/F Board 5” (MASTER)

fxsks=1
echocanceller=mg2,1
fxoks=2
echocanceller=mg2,2

channel 3, WCTDM/4/2, no module.

channel 4, WCTDM/4/3, no module.

Global data

loadzone = ru
defaultzone = ru
~
Gateway-Niko:~ # lsdahdi

Span 1: WCTDM/4 “Wildcard TDM400P REV E/F Board 5” (MASTER)

1 FXS FXSKS (In use) (EC: MG2)
2 FXO FXOKS (In use) (EC: MG2)

That outgoing calls do not work, only happens when dahdi+asterisk are loaded during boot-up on my SuSE 11.1 system. When started by
hand, no problem !
So, first of all I disabled “Parallel Execution” of start-up scripts for the services during boot, to start all services in serial. SuSE by
default starts services, which do not depend upon each others, in parallel within the same run-level.
Second, I made shure, that dahdi is started “far earlier” than asterisk.
Third, I used the “Last Weapon of a desperate Programmer” (who suspects a timing problem; I am a programming-dinosaur myself,
never needed to use it permanently, though): I introduced some time-delay in /etc/init./asterisk. Below you see this in more detail.
And now it works.

But that means, there is still a race-condition/timing issue/load-problem etc. during start-up after boot. Which I also had using
asterisk/zaptel. Sorry, that I forgot about that.

So, may be a bug to report to digium ?
I found a few people on the web having similar effects …

Gateway-Niko:~ # ls /etc/init.d/rc3.d
K01SuSEfirewall2_setup K02kbd S05splash_early
K01apache2 K02network-remotefs S07kbd
K01asterisk K02ntp S08alsasound
K01auditd K02postfix S08avahi-daemon
K01cron K03boot.clock S08clamd
K01dhcpd K03haldaemon S08dahdi
K01java.binfmt_misc K03named S08java.binfmt_misc
K01privoxyd K06rpcbind S08network-remotefs
K01random K07syslog S08privoxyd
K01rpmconfigcheck K08earlysyslog S08rpmconfigcheck
K01smb K08network S08sshd
K01splash K09SuSEfirewall2_init S09named
K01splash_early K09dbus S09splash
K01squid S01SuSEfirewall2_init S10ntp
K01sshd S01acpid S11cups
K01stopblktrace S01dbus S11dhcpd
K01tb-p S01earlysyslog S11postfix
K01xinetd S01fbset S11xinetd
K02acpid S01random S12apache2
K02alsasound S01tb-p S13cron
K02avahi-daemon S02haldaemon S13smb
K02clamd S02network S13squid
K02cups S03syslog S14dansguardian
K02dahdi S04boot.clock S15asterisk
K02dansguardian S05auditd S16SuSEfirewall2_setup
K02fbset S05rpcbind S16stopblktrace
Gateway-Niko:~ #

/etc/init.d/asterisk:

#!/bin/sh
#set -x

asterisk Starts, Stops and Reloads Asterisk.

BEGIN INIT INFO

Provides: asterisk

Required-Start: dahdi $network $named dansguardian

Required-Stop:

Default-Start: 3 5

Default-Stop: 0 1 2 4 6

Description: Asterisk Phone System, using DAHDI

END INIT INFO

Source function library.

. /lib/lsb/init-functions

if ! [ -x /usr/sbin/asterisk ] ; then
echo "ERROR: /usr/sbin/asterisk not found"
exit 5
fi

if ! [ -d /etc/asterisk ] ; then
echo "ERROR: /etc/asterisk directory not found"
exit 5
fi
. /etc/rc.status

Reset status of this service

rc_reset

Full path to asterisk binary

DAEMON=/usr/sbin/asterisk

Full path to safe_asterisk script

SAFE_ASTERISK=/usr/sbin/safe_asterisk

RETVAL=0

case “$1” in
start)
# Start daemons.
echo -n "Starting asterisk phone system "
# Check if Asterisk is already running. If it is, then bug out, because
# starting Asterisk when Asterisk is already running is very bad.
VERSION=/usr/sbin/asterisk -rx 'core show version'
if [ “echo $VERSION | cut -c 1-8” = “Asterisk” ]; then

echo “Asterisk is already running. $0 will exit now.”

	rc_status -v
	exit
fi
    if [ -f $SAFE_ASTERISK ] ; then
	DAEMON=$SAFE_ASTERISK
fi
if [ $AST_USER ] ; then
	ASTARGS="-U $AST_USER"
fi
if [ $AST_GROUP ] ; then
	ASTARGS="`echo $ASTARGS` -G $AST_GROUP"
fi

#RKA+: Give dahdi_cfg and DNS some more time to complete …
#RKA- Should not be necessary any more,
#because we force asterisk to be loaded after dansguardian,

so to be almost the last one.

#Sorry, I was wrong, still necessary …
sleep 5s
$DAEMON $ASTARGS

[ $RETVAL -eq 0 ] && touch /var/lock/subsys/asterisk
rc_status -v
;;

stop)
# Stop daemons.
echo -n $"Shutting down asterisk: "
killproc asterisk > /dev/null
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/asterisk
rc_status -v
;;

restart)
"$0" stop
"$0" start
rc_status -v
;;

reload)
$DAEMON -rx ‘reload’ > /dev/null 2> /dev/null
rc_status -v
;;
status)
#RKA+
echo -n "Checking for asterisk "
[ -f /var/lock/subsys/asterisk ]
rc_status -v
#RKA- status asterisk
;;
*)
echo "Usage: asterisk {start|stop|restart|reload|condrestart|status}"
exit 1
;;
esac

rc_exit