Asterisk on my new Alix board - crippled sound

Hi,

I’ve been using Asterisk at home on my P2 server with no problems for a few months.
But I wanted to get rid of that big server and purchased a Alix 2c2 board with CF card as storage unit.

I installed Asterisk 1.4.19 and configured my softphone to register on this new box.
Then I dialed *60 to test the sound.
I can hear the speaking clock, but the sound is crippled. It is not understandable.
I made sure that this is not a network issue. (Connected my laptop directl to the Alix box over 100mbit ethernet)

Also, I can’t see high cpu utilization on the box. (with command top)

I also made the same test with different codecs (g711ulaw , g711alaw, gsm)
Everytime I get the same crippled sound.

On the console I can see these messages logged:

[May 23 22:45:46] WARNING[29263]: file.c:607 ast_openstream_full: File at-tone-time-exactly does not exist in any format
[May 23 22:45:46] WARNING[29263]: file.c:906 ast_streamfile: Unable to open at-tone-time-exactly (format 0x2 (gsm)): No such file or directory
[May 23 22:45:46] WARNING[29263]: app_playback.c:439 playback_exec: ast_streamfile failed on SIP/990-081ed1c8 for at-tone-time-exactly

What could be the problem in this situation ?

Thanks.

You’re missing some of the needed sound files for the test…

Try Record()'ing your own sound file and playing it back.

Also try setting up a call between two phones.

[quote=“nizon”]You’re missing some of the needed sound files for the test…

Try Record()'ing your own sound file and playing it back.

Also try setting up a call between two phones.[/quote]

Well, what may be the missing sound files ? I’ve already installed asterisk-sounds packet.

Anyway, now I created a new extension and registered with it.
Then I called the second extension with first extension.
A calls B
Asterisk sends a “603 declined” message right after the “100 trying” message to the user A.

I took a capture on the server and saw that Asterisk does not even contact B.
Directly ends the call with 603.

What might be the problem now ?

asterisk-sounds seems to be missing sounds for some apps sometimes…

Paste your sip.conf for your extensions as well as your extensions.conf

Sounds like something is iffy in your configs.

my sip.conf, sip_additional.conf and extensions_additional.conf is below.
I didn’t find any info about my extensions in the extensions.conf so, I didn’t paste it here. If you need it please let me know.

router:/etc/asterisk# cat sip.conf
; do not edit this file, this is an auto-generated file by freepbx
; all modifications must be done from the web gui

[general]
;
; enable and force the sip jitterbuffer. If these settings are desired
; they should be set in the sip_general_custom.conf file as this file
; will get overwritten during reloads and upgrades.
;
; jbenable=yes
; jbforce=yes

; These will all be included in the [general] context
;
#include sip_general_additional.conf
#include sip_general_custom.conf
#include sip_nat.conf
#include sip_registrations_custom.conf
#include sip_registrations.conf

; These should all be expected to come after the [general] context
;
#include sip_custom.conf
#include sip_additional.conf
#include sip_custom_post.conf

router:/etc/asterisk# cat sip_additional.conf
; do not edit this file, this is an auto-generated file by freepbx
; all modifications must be done from the web gui

[990]
type=friend
secret=zzzxxx990abc
record_out=Adhoc
record_in=Adhoc
qualify=yes
port=5060
pickupgroup=
nat=yes
mailbox=990@device
host=dynamic
dtmfmode=rfc2833
dial=SIP/990
context=from-internal
canreinvite=no
callgroup=
callerid=device <990>
allow=all
accountcode=
call-limit=50

[999]
type=friend
secret=zzzxxx999abc
record_out=Adhoc
record_in=Adhoc
qualify=yes
port=5060
pickupgroup=
nat=yes
mailbox=999@device
host=dynamic
dtmfmode=rfc2833
dial=SIP/999
context=from-internal
canreinvite=no
callgroup=
callerid=device <999>
allow=all
accountcode=
call-limit=50

router:/etc/asterisk# cat extensions_additional.conf
; do not edit this file, this is an auto-generated file by freepbx
; all modifications must be done from the web gui

[globals]
#include globals_custom.conf
CALLFILENAME = ""
DIAL_OPTIONS = tr
TRUNK_OPTIONS =
DIAL_OUT = 9
FAX =
FAX_RX = system
FAX_RX_EMAIL = fax@mydomain.com
FAX_RX_FROM = freepbx@gmail.com
INCOMING = group-all
NULL = ""
OPERATOR =
OPERATOR_XTN =
PARKNOTIFY = SIP/200
RECORDEXTEN = ""
RINGTIMER = 15
DIRECTORY = last
AFTER_INCOMING =
IN_OVERRIDE = forcereghours
REGTIME = 7:55-17:05
REGDAYS = mon-fri
DIRECTORY_OPTS =
DIALOUTIDS = 1
OUT_1 = ZAP/g0
VM_PREFIX = *
VM_OPTS =
VM_GAIN =
VM_DDTYPE = u
TIMEFORMAT = kM
TONEZONE = us
ALLOW_SIP_ANON = no
VMX_CONTEXT = from-internal
VMX_PRI = 1
VMX_TIMEDEST_CONTEXT =
VMX_TIMEDEST_EXT = dovm
VMX_TIMEDEST_PRI = 1
VMX_LOOPDEST_CONTEXT =
VMX_LOOPDEST_EXT = dovm
VMX_LOOPDEST_PRI = 1
VMX_OPTS_TIMEOUT =
VMX_OPTS_LOOP =
VMX_OPTS_DOVM =
VMX_TIMEOUT = 2
VMX_REPEAT = 1
VMX_LOOPS = 1
TRANSFER_CONTEXT = from-internal-xfer
ASTETCDIR = /etc/asterisk
ASTMODDIR = /usr/lib/asterisk/modules
ASTVARLIBDIR = /var/lib/asterisk
ASTAGIDIR = /usr/share/asterisk/agi-bin
ASTSPOOLDIR = /var/spool/asterisk
ASTRUNDIR = /var/run/asterisk
ASTLOGDIR = /var/log/asterisk
CWINUSEBUSY = true
AMPMGRUSER = admin
AMPMGRPASS = amp111
ASTVERSION = 1.4.19.1

;end of [globals]

[cidlookup]
include => cidlookup-custom
exten => cidlookup_return,1,LookupCIDName
exten => cidlookup_return,n,Return()

; end of [cidlookup]

[app-dialvm]
include => app-dialvm-custom
exten => *98,1,Answer
exten => *98,n,Wait(1)
exten => *98,n,Macro(user-callerid,)
exten => *98,n,VoiceMailMain()
exten => *98,n,Macro(hangupcall,)
exten => _*98.,1,Answer
exten => _*98.,n,Wait(1)
exten => _*98.,n,Macro(get-vmcontext,${EXTEN:3})
exten => _*98.,n,VoiceMailMain(${EXTEN:3}@${VMCONTEXT})
exten => _*98.,n,Macro(hangupcall,)

; end of [app-dialvm]

[app-vmmain]
include => app-vmmain-custom
exten => *97,1,Answer
exten => *97,n,Wait(1)
exten => *97,n,Macro(user-callerid,)
exten => *97,n,Macro(get-vmcontext,${AMPUSER})
exten => *97,n(check),MailBoxExists(${AMPUSER}@${VMCONTEXT})
exten => *97,n,GotoIf($["${VMBOXEXISTSSTATUS}" = “SUCCESS”]?mbexist)
exten => *97,n,VoiceMailMain()
exten => *97,n,Macro(hangupcall,)
exten => *97,check+101(mbexist),VoiceMailMain(${AMPUSER}@${VMCONTEXT})
exten => *97,n,Macro(hangupcall,)

; end of [app-vmmain]

[app-calltrace]
include => app-calltrace-custom
exten => *69,1,Goto(app-calltrace-perform,s,1)

; end of [app-calltrace]

[app-calltrace-perform]
include => app-calltrace-perform-custom
exten => s,1,Answer
exten => s,n,Wait(1)
exten => s,n,Macro(user-callerid,)
exten => s,n,Playback(info-about-last-call&telephone-number)
exten => s,n,Set(lastcaller=${DB(CALLTRACE/${AMPUSER})})
exten => s,n,GotoIf($[ $[ “${lastcaller}” = “” ] | $[ “${lastcaller}” = “unknown” ] ]?noinfo)
exten => s,n,SayDigits(${lastcaller})
exten => s,n,Set(TIMEOUT(digit)=3)
exten => s,n,Set(TIMEOUT(response)=7)
exten => s,n,Background(to-call-this-number&press-1)
exten => s,n,Goto(fin)
exten => s,n(noinfo),Playback(from-unknown-caller)
exten => s,n,Macro(hangupcall,)
exten => s,n(fin),Noop(Waiting for input)
exten => s,n,WaitExten(60,)
exten => s,n,Playback(sorry-youre-having-problems&goodbye)
exten => 1,1,Goto(from-internal,${lastcaller},1)
exten => i,1,Playback(vm-goodbye)
exten => i,n,Macro(hangupcall,)
exten => t,1,Playback(vm-goodbye)
exten => t,n,Macro(hangupcall,)

; end of [app-calltrace-perform]

[app-directory]
include => app-directory-custom
exten => #,1,Answer
exten => #,n,Wait(1)
exten => #,n,AGI(directory,${DIR-CONTEXT},from-did-direct,${DIRECTORY:0:1}${DIRECTORY_OPTS})
exten => #,n,Playback(vm-goodbye)
exten => #,n,Hangup
exten => i,1,Playback(privacy-incorrect)

; end of [app-directory]

[app-echo-test]
include => app-echo-test-custom
exten => *43,1,Answer
exten => *43,n,Wait(1)
exten => *43,n,Playback(demo-echotest)
exten => *43,n,Echo()
exten => *43,n,Playback(demo-echodone)
exten => *43,n,Hangup

; end of [app-echo-test]

[app-speakextennum]
include => app-speakextennum-custom
exten => *65,1,Answer
exten => *65,n,Wait(1)
exten => *65,n,Macro(user-callerid,)
exten => *65,n,Playback(your)
exten => *65,n,Playback(extension)
exten => *65,n,Playback(number)
exten => *65,n,Playback(is)
exten => *65,n,SayDigits(${AMPUSER})
exten => *65,n,Wait(2)
exten => *65,n,Hangup

; end of [app-speakextennum]

[app-speakingclock]
include => app-speakingclock-custom
exten => *60,1,Answer
exten => *60,n,Wait(1)
exten => *60,n,Set(NumLoops=0)
exten => *60,n(start),Set(FutureTime=$[${EPOCH} + 11])
exten => *60,n,Playback(at-tone-time-exactly)
exten => *60,n,GotoIf($["${TIMEFORMAT}" = “kM”]?hr24format)
exten => *60,n,SayUnixTime(${FutureTime},IM ‘and’ S ‘seconds’ p)
exten => *60,n,Goto(waitloop)
exten => *60,n(hr24format),SayUnixTime(${FutureTime},kM ‘and’ S ‘seconds’)
exten => *60,n(waitloop),Set(TimeLeft=$[${FutureTime} - ${EPOCH}])
exten => *60,n,GotoIf($[${TimeLeft} < 1]?playbeep)
exten => *60,n,Wait(1)
exten => *60,n,Goto(waitloop)
exten => *60,n(playbeep),Playback(beep)
exten => *60,n,Wait(5)
exten => *60,n,Set(NumLoops=$[${NumLoops} + 1])
exten => *60,n,GotoIf($[${NumLoops} < 5]?start)
exten => *60,n,Playback(goodbye)
exten => *60,n,Hangup

; end of [app-speakingclock]

[app-recordings]
include => app-recordings-custom
exten => *77,1,Macro(user-callerid,)
exten => *77,n,Wait(2)
exten => *77,n,Macro(systemrecording,dorecord)
exten => *99,1,Macro(user-callerid,)
exten => *99,n,Wait(2)
exten => *99,n,Macro(systemrecording,docheck)

; end of [app-recordings]

[app-pbdirectory]
include => app-pbdirectory-custom
exten => 411,1,Answer
exten => 411,n,Wait(1)
exten => 411,n,Goto(pbdirectory,1)
exten => pbdirectory,1,Macro(user-callerid,)
exten => pbdirectory,n,AGI(pbdirectory)
exten => pbdirectory,n,GotoIf($["${dialnumber}"=""]?hangup,1)
exten => pbdirectory,n,Noop(Got number to dial: ${dialnumber})
exten => pbdirectory,n,Dial(Local/${dialnumber}@from-internal/n,)
exten => hangup,1,Hangup

; end of [app-pbdirectory]

[app-userlogonoff]
include => app-userlogonoff-custom
exten => *12,1,Macro(user-logoff,)
exten => *12,n,Hangup
exten => *11,1,Macro(user-logon,)
exten => *11,n,Hangup
exten => _*11.,1,Macro(user-logon,${EXTEN:3},)
exten => _*11.,n,Hangup

; end of [app-userlogonoff]

[app-pickup]
include => app-pickup-custom
exten => _.,1,Noop(Attempt to Pickup ${EXTEN:2} by ${CALLERID(num)})
exten => _
.,n,Pickup(${EXTEN:2})

; end of [app-pickup]

[app-zapbarge]
include => app-zapbarge-custom
exten => 888,1,Macro(user-callerid,)
exten => 888,n,Set(GROUP()=${CALLERID(number)})
exten => 888,n,Answer
exten => 888,n,Wait(1)
exten => 888,n,ZapBarge()
exten => 888,n,Hangup

; end of [app-zapbarge]

[app-chanspy]
include => app-chanspy-custom
exten => 555,1,Macro(user-callerid,)
exten => 555,n,Answer
exten => 555,n,Wait(1)
exten => 555,n,ChanSpy()
exten => 555,n,Hangup

; end of [app-chanspy]

[ext-test]
include => ext-test-custom
exten => 7777,1,Goto(from-pstn,s,1)
exten => 666,1,Goto(ext-fax,in_fax,1)
exten => h,1,Macro(hangupcall,)

; end of [ext-test]

[ext-did]
include => ext-did-custom
exten => fax,1,Goto(ext-fax,in_fax,1)

; end of [ext-did]

[ext-did-catchall]
include => ext-did-catchall-custom
exten => s,1,Noop(No DID or CID Match)
exten => s,n,Answer
exten => s,n,Wait(2)
exten => s,n,Playback(ss-noservice)
exten => s,n,SayAlpha(${FROM_DID})
exten => _[#X].,1,Set(__FROM_DID=${EXTEN})
exten => _[
#X].,n,Noop(Received an unknown call with DID set to ${EXTEN})
exten => _[*#X].,n,Goto(ext-did,s,1)

; end of [ext-did-catchall]

[ext-local]
include => ext-local-custom
exten => 990,1,Macro(exten-vm,990,990)
exten => 990,n,Hangup
exten => 990,hint,SIP/990
exten => ${VM_PREFIX}990,1,Macro(vm,990,DIRECTDIAL)
exten => ${VM_PREFIX}990,n,Hangup
exten => vmb990,1,Macro(vm,990,BUSY)
exten => vmb990,n,Hangup
exten => vmu990,1,Macro(vm,990,NOANSWER)
exten => vmu990,n,Hangup
exten => vms990,1,Macro(vm,990,NOMESSAGE)
exten => vms990,n,Hangup
exten => 999,1,Macro(exten-vm,novm,999)
exten => 999,n,Hangup
exten => 999,hint,SIP/999

; end of [ext-local]

[from-did-direct-ivr]
include => from-did-direct-ivr-custom
exten => 990,1,ExecIf($["${BLKVM_OVERRIDE}" != “”],dbDel,${BLKVM_OVERRIDE})
exten => 990,n,Set(__NODEST=)
exten => 990,n,Goto(from-did-direct,990,1)
exten => ${VM_PREFIX}990,1,ExecIf($["${BLKVM_OVERRIDE}" != “”],dbDel,${BLKVM_OVERRIDE})
exten => ${VM_PREFIX}990,n,Set(__NODEST=)
exten => ${VM_PREFIX}990,n,Macro(vm,990,DIRECTDIAL)
exten => 999,1,ExecIf($["${BLKVM_OVERRIDE}" != “”],dbDel,${BLKVM_OVERRIDE})
exten => 999,n,Set(__NODEST=)
exten => 999,n,Goto(from-did-direct,999,1)

; end of [from-did-direct-ivr]

[outbound-allroutes]
include => outbound-allroutes-custom
include => outrt-001-9_outside
exten => foo,1,Noop(bar)

; end of [outbound-allroutes]

[outrt-001-9_outside]
include => outrt-001-9_outside-custom
exten => _9.,1,Macro(user-callerid,SKIPTTL,)
exten => _9.,n,Set(_NODEST=)
exten => _9.,n,Macro(record-enable,${AMPUSER},OUT,)
exten => _9.,n,Macro(dialout-trunk,1,${EXTEN:1},)
exten => _9.,n,Macro(outisbusy,)

; end of [outrt-001-9_outside]

[app-blackhole]
include => app-blackhole-custom
exten => hangup,1,Noop(Blackhole Dest: Hangup)
exten => hangup,n,Hangup
exten => zapateller,1,Noop(Blackhole Dest: Play SIT Tone)
exten => zapateller,n,Answer
exten => zapateller,n,Zapateller()
exten => musiconhold,1,Noop(Blackhole Dest: Put caller on hold forever)
exten => musiconhold,n,Answer
exten => musiconhold,n,MusicOnHold()
exten => congestion,1,Noop(Blackhole Dest: Congestion)
exten => congestion,n,Answer
exten => congestion,n,Playtones(congestion)
exten => congestion,n,Congestion(20)
exten => congestion,n,Hangup
exten => busy,1,Noop(Blackhole Dest: Busy)
exten => busy,n,Answer
exten => busy,n,Playtones(busy)
exten => busy,n,Busy(20)
exten => busy,n,Hangup
exten => ring,1,Noop(Blackhole Dest: Ring)
exten => ring,n,Answer
exten => ring,n,Playtones(ring)
exten => ring,n,Wait(300)
exten => ring,n,Hangup

; end of [app-blackhole]

[bad-number]
include => bad-number-custom
exten => _X.,1,ResetCDR()
exten => _X.,n,NoCDR()
exten => _X.,n,Wait(1)
exten => _X.,n,Playback(silence/1&cannot-complete-as-dialed&check-number-dial-again,noanswer)
exten => _X.,n,Wait(1)
exten => _X.,n,Congestion(20)
exten => _X.,n,Hangup
exten => _.,1,ResetCDR()
exten => _
.,n,NoCDR()
exten => _.,n,Wait(1)
exten => _
.,n,Playback(silence/1&feature-not-avail-line&silence/1&cannot-complete-as-dialed&check-number-dial-again,noanswer)
exten => _.,n,Wait(1)
exten => _
.,n,Congestion(20)
exten => _*.,n,Hangup

; end of [bad-number]

[macro-dialout-trunk]
include => macro-dialout-trunk-custom
exten => s,1,Set(DIAL_TRUNK=${ARG1})
exten => s,n,ExecIf($[$["${ARG3}" != “”] & $["${DB(AMPUSER/${AMPUSER}/pinless)}" != “NOPASSWD”]],Authenticate,${ARG3})
exten => s,n,GotoIf($[“x${OUTDISABLE_${DIAL_TRUNK}}” = “xon”]?disabletrunk,1)
exten => s,n,Set(DIAL_NUMBER=${ARG2})
exten => s,n,Set(DIAL_TRUNK_OPTIONS=${DIAL_OPTIONS})
exten => s,n,Set(GROUP()=OUT_${DIAL_TRUNK})
exten => s,n,GotoIf($["${OUTMAXCHANS_${DIAL_TRUNK}}foo" = “foo”]?nomax)
exten => s,n,GotoIf($[ ${GROUP_COUNT(OUT_${DIAL_TRUNK})} > ${OUTMAXCHANS_${DIAL_TRUNK}} ]?chanfull)
exten => s,n(nomax),GotoIf($["${INTRACOMPANYROUTE}" = “YES”]?skipoutcid)
exten => s,n,Set(DIAL_TRUNK_OPTIONS=${TRUNK_OPTIONS})
exten => s,n,Macro(outbound-callerid,${DIAL_TRUNK})
exten => s,n(skipoutcid),AGI(fixlocalprefix)
exten => s,n,Set(OUTNUM=${OUTPREFIX_${DIAL_TRUNK}}${DIAL_NUMBER})
exten => s,n,Set(custom=${CUT(OUT_${DIAL_TRUNK},:,1)})
exten => s,n,GotoIf($[$["${MOHCLASS}" = “default”] | $[“foo${MOHCLASS}” = “foo”]]?gocall)
exten => s,n,Set(DIAL_TRUNK_OPTIONS=M(setmusic^${MOHCLASS})${DIAL_TRUNK_OPTIONS})
exten => s,n(gocall),Macro(dialout-trunk-predial-hook,)
exten => s,n,GotoIf($["${PREDIAL_HOOK_RET}" = “BYPASS”]?bypass,1)
exten => s,n,GotoIf($["${custom}" = “AMP”]?customtrunk)
exten => s,n,Dial(${OUT_${DIAL_TRUNK}}/${OUTNUM},300,${DIAL_TRUNK_OPTIONS})
exten => s,n,Goto(s-${DIALSTATUS},1)
exten => s,n(customtrunk),Set(pre_num=${CUT(OUT_${DIAL_TRUNK},$,1)})
exten => s,n,Set(the_num=${CUT(OUT_${DIAL_TRUNK},$,2)})
exten => s,n,Set(post_num=${CUT(OUT_${DIAL_TRUNK},$,3)})
exten => s,n,GotoIf($["${the_num}" = “OUTNUM”]?outnum:skipoutnum)
exten => s,n(outnum),Set(the_num=${OUTNUM})
exten => s,n(skipoutnum),Dial(${pre_num:4}${the_num}${post_num},300,${DIAL_TRUNK_OPTIONS})
exten => s,n,Goto(s-${DIALSTATUS},1)
exten => s,n(chanfull),Noop(max channels used up)
exten => s-BUSY,1,Noop(Dial failed due to trunk reporting BUSY - giving up)
exten => s-BUSY,n,Playtones(busy)
exten => s-BUSY,n,Busy(20)
exten => s-NOANSWER,1,Noop(Dial failed due to trunk reporting NOANSWER - giving up)
exten => s-NOANSWER,n,Playtones(congestion)
exten => s-NOANSWER,n,Congestion(20)
exten => s-CANCEL,1,Noop(Dial failed due to trunk reporting CANCEL - giving up)
exten => s-CANCEL,n,Playtones(congestion)
exten => s-CANCEL,n,Congestion(20)
exten => s-.,1,GotoIf($["x${OUTFAIL${ARG1}}" = “x”]?noreport)
exten => s-.,n,AGI(${OUTFAIL${ARG1}})
exten => s-.,n(noreport),Noop(TRUNK Dial failed due to ${DIALSTATUS} - failing through to other trunks)
exten => disabletrunk,1,Noop(TRUNK: ${OUT
${DIAL_TRUNK}} DISABLED - falling through to next trunk)
exten => bypass,1,Noop(TRUNK: ${OUT_${DIAL_TRUNK}} BYPASSING because dialout-trunk-predial-hook)
exten => h,1,Macro(hangupcall,)

; end of [macro-dialout-trunk]

[macro-dialout-dundi]
include => macro-dialout-dundi-custom
exten => s,1,Set(DIAL_TRUNK=${ARG1})
exten => s,n,ExecIf($[$["${ARG3}" != “”] & $["${DB(AMPUSER/${AMPUSER}/pinless)}" != “NOPASSWD”]],Authenticate,${ARG3})
exten => s,n,GotoIf($[“x${OUTDISABLE_${DIAL_TRUNK}}” = “xon”]?disabletrunk,1)
exten => s,n,Set(DIAL_NUMBER=${ARG2})
exten => s,n,Set(DIAL_TRUNK_OPTIONS=${DIAL_OPTIONS})
exten => s,n,Set(GROUP()=OUT_${DIAL_TRUNK})
exten => s,n,GotoIf($["${OUTMAXCHANS_${DIAL_TRUNK}}foo" = “foo”]?nomax)
exten => s,n,GotoIf($[ ${GROUP_COUNT(OUT_${DIAL_TRUNK})} > ${OUTMAXCHANS_${DIAL_TRUNK}} ]?chanfull)
exten => s,n(nomax),GotoIf($["${INTRACOMPANYROUTE}" = “YES”]?skipoutcid)
exten => s,n,Set(DIAL_TRUNK_OPTIONS=${TRUNK_OPTIONS})
exten => s,n,Macro(outbound-callerid,${DIAL_TRUNK})
exten => s,n(skipoutcid),AGI(fixlocalprefix)
exten => s,n,Set(OUTNUM=${OUTPREFIX_${DIAL_TRUNK}}${DIAL_NUMBER})
exten => s,n,GotoIf($[$["${MOHCLASS}" = “default”] | $[“foo${MOHCLASS}” = “foo”]]?gocall)
exten => s,n,Set(DIAL_TRUNK_OPTIONS=M(setmusic^${MOHCLASS})${DIAL_TRUNK_OPTIONS})
exten => s,n(gocall),Macro(dialout-dundi-predial-hook,)
exten => s,n,GotoIf($["${PREDIAL_HOOK_RET}" = “BYPASS”]?bypass,1)
exten => s,n,GotoIf($["${custom}" = “AMP”]?customtrunk)
exten => s,n,Macro(dundi-${DIAL_TRUNK},${OUTNUM})
exten => s,n,Goto(s-${DIALSTATUS},1)
exten => s,n(chanfull),Noop(max channels used up)
exten => s-BUSY,1,Noop(Dial failed due to trunk reporting BUSY - giving up)
exten => s-BUSY,n,Playtones(busy)
exten => s-BUSY,n,Busy(20)
exten => s-NOANSWER,1,Noop(Dial failed due to trunk reporting NOANSWER - giving up)
exten => s-NOANSWER,n,Playtones(congestion)
exten => s-NOANSWER,n,Congestion(20)
exten => s-CANCEL,1,Noop(Dial failed due to trunk reporting CANCEL - giving up)
exten => s-CANCEL,n,Playtones(congestion)
exten => s-CANCEL,n,Congestion(20)
exten => s-.,1,GotoIf($["x${OUTFAIL${ARG1}}" = “x”]?noreport)
exten => s-.,n,AGI(${OUTFAIL${ARG1}})
exten => s-.,n(noreport),Noop(TRUNK Dial failed due to ${DIALSTATUS} - failing through to other trunks)
exten => disabletrunk,1,Noop(TRUNK: ${OUT
${DIAL_TRUNK}} DISABLED - falling through to next trunk)
exten => bypass,1,Noop(TRUNK: ${OUT_${DIAL_TRUNK}} BYPASSING because dialout-dundi-predial-hook)
exten => h,1,Macro(hangupcall,)

; end of [macro-dialout-dundi]

[macro-user-callerid]
include => macro-user-callerid-custom
exten => s,1,Noop(user-callerid: ${CALLERID(name)} ${CALLERID(number)})
exten => s,n,Set(AMPUSER=${IF($[“foo${AMPUSER}” = “foo”]?${CALLERID(number)}:${AMPUSER})})
exten => s,n,GotoIf($["${CHANNEL:0:5}" = “Local”]?report)
exten => s,n,ExecIf($["${REALCALLERIDNUM:1:2}" = “”],Set,REALCALLERIDNUM=${CALLERID(number)})
exten => s,n(start),Noop(REALCALLERIDNUM is ${REALCALLERIDNUM})
exten => s,n,Set(AMPUSER=${DB(DEVICE/${REALCALLERIDNUM}/user)})
exten => s,n,Set(AMPUSERCIDNAME=${DB(AMPUSER/${AMPUSER}/cidname)})
exten => s,n,GotoIf($[“x${AMPUSERCIDNAME:1:2}” = “x”]?report)
exten => s,n,Set(AMPUSERCID=${IF($["${DB_EXISTS(AMPUSER/${AMPUSER}/cidnum)}" = “1”]?${DB_RESULT}:${AMPUSER})})
exten => s,n,Set(CALLERID(all)="${AMPUSERCIDNAME}" <${AMPUSERCID}>)
exten => s,n,Set(REALCALLERIDNUM=${DB(DEVICE/${REALCALLERIDNUM}/user)})
exten => s,n,ExecIf($["${DB(AMPUSER/${AMPUSER}/language)}" != “”],Set,CHANNEL(language)=${DB(AMPUSER/${AMPUSER}/language)})
exten => s,n(report),Noop(TTL: ${TTL} ARG1: ${ARG1})
exten => s,n,GotoIf($[ “${ARG1}” = “SKIPTTL” ]?continue)
exten => s,n(report2),Set(__TTL=${IF($[“foo${TTL}” = “foo”]?64:$[ ${TTL} - 1 ])})
exten => s,n,GotoIf($[ ${TTL} > 0 ]?continue)
exten => s,n,Wait(${RINGTIMER})
exten => s,n,Answer
exten => s,n,Wait(2)
exten => s,n,Playback(im-sorry&an-error-has-occured&with&call-forwarding)
exten => s,n,Macro(hangupcall,)
exten => s,n,Congestion(20)
exten => s,n(continue),Noop(Using CallerID ${CALLERID(all)})
exten => h,1,Macro(hangupcall,)

; end of [macro-user-callerid]

[macro-dialout-enum]
include => macro-dialout-enum-custom
exten => s,1,ExecIf($[$["${ARG3}" != “”] & $["${DB(AMPUSER/${AMPUSER}/pinless)}" != “NOPASSWD”]],Authenticate,${ARG3})
exten => s,n,Macro(outbound-callerid,${ARG1})
exten => s,n,Set(GROUP()=OUT_${ARG1})
exten => s,n,GotoIf($["${OUTMAXCHANS_${ARG1}}foo" = “foo”]?nomax)
exten => s,n,GotoIf($[ ${GROUP_COUNT(OUT_${ARG1})} > ${OUTMAXCHANS_${ARG1}} ]?nochans)
exten => s,n(nomax),Set(DIAL_NUMBER=${ARG2})
exten => s,n,Set(DIAL_TRUNK=${ARG1})
exten => s,n,AGI(fixlocalprefix)
exten => s,n,AGI(enumlookup.agi)
exten => s,n(dialloop),GotoIf($[“foo${DIALARR}”=“foo”]?end)
exten => s,n,Set(TRYDIAL=${CUT(DIALARR,%,1)})
exten => s,n,Set(DIALARR=${CUT(DIALARR,%,2-)})
exten => s,n,Dial(${TRYDIAL},)
exten => s,n,Noop(Dial exited in macro-enum-dialout with ${DIALSTATUS})
exten => s,n,GotoIf($[ $[ “${DIALSTATUS}” = “CHANUNAVAIL” ] | $[ “${DIALSTATUS}” = “CONGESTION” ] ]?dialloop)
exten => s,n(dialfailed),Goto(s-${DIALSTATUS},1)
exten => s,n(nochans),Noop(max channels used up)
exten => s,n(end),Noop(Exiting macro-dialout-enum)
exten => s-BUSY,1,Noop(Trunk is reporting BUSY)
exten => s-BUSY,n,Busy(20)
exten => _s-.,1,Noop(Dial failed due to ${DIALSTATUS})

; end of [macro-dialout-enum]

[macro-outbound-callerid]
include => macro-outbound-callerid-custom
exten => s,1,GotoIf($["${REALCALLERIDNUM:1:2}" != “”]?start)
exten => s,n,Set(REALCALLERIDNUM=${CALLERID(number)})
exten => s,n(start),Noop(REALCALLERIDNUM is ${REALCALLERIDNUM})
exten => s,n,GotoIf($["${KEEPCID}" != “TRUE”]?normcid)
exten => s,n,GotoIf($[“x${OUTKEEPCID_${ARG1}}” = “xon”]?normcid)
exten => s,n,GotoIf($[“foo${REALCALLERIDNUM}” = “foo”]?normcid)
exten => s,n,Set(USEROUTCID=${REALCALLERIDNUM})
exten => s,n,GotoIf($[“foo${DB(AMPUSER/${REALCALLERIDNUM}/device)}” = “foo”]?bypass:normcid)
exten => s,n(normcid),Set(USEROUTCID=${DB(AMPUSER/${REALCALLERIDNUM}/outboundcid)})
exten => s,n(bypass),Set(EMERGENCYCID=${DB(DEVICE/${REALCALLERIDNUM}/emergency_cid)})
exten => s,n,Set(TRUNKOUTCID=${OUTCID_${ARG1}})
exten => s,n,GotoIf($["${EMERGENCYROUTE:1:2}" = “”]?trunkcid)
exten => s,n,GotoIf($["${EMERGENCYCID:1:2}" = “”]?trunkcid)
exten => s,n,Set(CALLERID(all)=${EMERGENCYCID})
exten => s,n,Goto(report)
exten => s,n(trunkcid),GotoIf($["${TRUNKOUTCID:1:2}" = “”]?usercid)
exten => s,n,Set(CALLERID(all)=${TRUNKOUTCID})
exten => s,n(usercid),GotoIf($["${USEROUTCID:1:2}" = “”]?report)
exten => s,n,Set(CALLERID(all)=${USEROUTCID})
exten => s,n,GotoIf($[“x${CALLERID(name)}”!=“xhidden”]?report:hidecid)
exten => s,n(hidecid),SetCallerPres(prohib_passed_screen)
exten => s,n(report),Noop(CallerID set to ${CALLERID(all)})

; end of [macro-outbound-callerid]

[macro-agent-add]
include => macro-agent-add-custom
exten => s,1,Wait(1)
exten => s,n,Macro(user-callerid,SKIPTTL)
exten => s,n(a3),Read(CALLBACKNUM,agent-user,)
exten => s,n,GotoIf($["${CALLBACKNUM}" != “”]?a7)
exten => s,n(a5),Set(CALLBACKNUM=${AMPUSER})
exten => s,n,ExecIf($["${CALLBACKNUM}" = “”],Set,CALLBACKNUM=${CALLERID(number)})
exten => s,n,GotoIf($["${CALLBACKNUM}" = “”]?a3)
exten => s,n(a7),GotoIf($["${CALLBACKNUM}" = “${ARG1}”]?invalid)
exten => s,n,ExecIf($["${ARG2}" != “”],Authenticate,${ARG2})
exten => s,n(a9),AddQueueMember(${ARG1},Local/${CALLBACKNUM}@from-internal/n)
exten => s,n,UserEvent(Agentlogin,Agent: ${CALLBACKNUM})
exten => s,n,Wait(1)
exten => s,n,Playback(agent-loginok&with&extension)
exten => s,n,SayDigits(${CALLBACKNUM})
exten => s,n,Hangup
exten => s,n,MacroExit()
exten => s,n(invalid),Playback(pbx-invalid)
exten => s,n,Goto(a3)

; end of [macro-agent-add]

[macro-agent-del]
include => macro-agent-del-custom
exten => s,1,Wait(1)
exten => s,n,Macro(user-callerid,SKIPTTL)
exten => s,n(a3),Read(CALLBACKNUM,agent-user,)
exten => s,n,GotoIf($["${CALLBACKNUM}" = “”]?a5:a7)
exten => s,n(a5),Set(CALLBACKNUM=${AMPUSER})
exten => s,n,ExecIf($["${CALLBACKNUM}" = “”],Set,CALLBACKNUM=${CALLERID(number)})
exten => s,n,GotoIf($["${CALLBACKNUM}" = “”]?a3)
exten => s,n(a7),RemoveQueueMember(${ARG1},Local/${CALLBACKNUM}@from-internal/n)
exten => s,n,UserEvent(RefreshQueue)
exten => s,n,Wait(1)
exten => s,n,Playback(agent-loggedoff)
exten => s,n,Hangup

; end of [macro-agent-del]

[macro-systemrecording]
include => macro-systemrecording-custom
exten => s,1,Goto(${ARG1},1)
exten => dorecord,1,Record(/tmp/${AMPUSER}-ivrrecording:wav)
exten => dorecord,n,Wait(1)
exten => dorecord,n,Goto(confmenu,1)
exten => docheck,1,Playback(/tmp/${AMPUSER}-ivrrecording)
exten => docheck,n,Wait(1)
exten => docheck,n,Goto(confmenu,1)
exten => confmenu,1,Background(to-listen-to-it&press-1&to-rerecord-it&press-star,m,${CHANNEL(language)},macro-systemrecording)
exten => confmenu,n,Read(RECRESULT,1,4)
exten => confmenu,n,GotoIf($[“x${RECRESULT}”=“x*”]?dorecord,1)
exten => confmenu,n,GotoIf($[“x${RECRESULT}”=“x1”]?docheck,1)
exten => confmenu,n,Goto(1)
exten => 1,1,Goto(docheck,1)
exten => *,1,Goto(dorecord,1)
exten => t,1,Playback(goodbye)
exten => t,n,Hangup
exten => i,1,Playback(pm-invalid-option)
exten => i,n,Goto(confmenu,1)
exten => h,1,Hangup

; end of [macro-systemrecording]

[from-internal-additional]
include => from-internal-additional-custom
include => app-dialvm
include => app-vmmain
include => app-calltrace
include => app-directory
include => app-echo-test
include => app-speakextennum
include => app-speakingclock
include => app-recordings
include => ext-group
include => grps
include => app-pbdirectory
include => ext-findmefollow
include => fmgrps
include => app-userlogonoff
include => app-pickup
include => app-zapbarge
include => app-chanspy
include => ext-test
include => ext-local
include => outbound-allroutes
exten => h,1,Hangup

; end of [from-internal-additional]

Alright and which extension are you trying to dial when you call another phone?

Paste the output from asterisk when you make the call as well.

I am trying to call 999 from 990.
Here is the log from Asterisk console.
Now I see that I don’t have all the files in folder /usr/share/asterisk/agi-bin/
Do you know why that might be ?
And how can I fix it ?

router*CLI> 
    -- Registered SIP '999' at 192.168.254.6 port 5060 expires 600
[May 26 20:35:34] NOTICE[29203]: chan_sip.c:12599 handle_response_peerpoke: Peer '999' is now Reachable. (16ms / 2000ms)
router*CLI> 
    -- Executing [999@from-internal:1] Macro("SIP/990-081a65f0", "exten-vm|novm|999") in new stack
    -- Executing [s@macro-exten-vm:1] Macro("SIP/990-081a65f0", "user-callerid") in new stack
    -- Executing [s@macro-user-callerid:1] NoOp("SIP/990-081a65f0", "user-callerid: device 990") in new stack
    -- Executing [s@macro-user-callerid:2] Set("SIP/990-081a65f0", "AMPUSER=990") in new stack
    -- Executing [s@macro-user-callerid:3] GotoIf("SIP/990-081a65f0", "0?report") in new stack
    -- Executing [s@macro-user-callerid:4] ExecIf("SIP/990-081a65f0", "1|Set|REALCALLERIDNUM=990") in new stack
    -- Executing [s@macro-user-callerid:5] NoOp("SIP/990-081a65f0", "REALCALLERIDNUM is 990") in new stack
    -- Executing [s@macro-user-callerid:6] Set("SIP/990-081a65f0", "AMPUSER=990") in new stack
    -- Executing [s@macro-user-callerid:7] Set("SIP/990-081a65f0", "AMPUSERCIDNAME=Sorcerer") in new stack
    -- Executing [s@macro-user-callerid:8] GotoIf("SIP/990-081a65f0", "0?report") in new stack
    -- Executing [s@macro-user-callerid:9] Set("SIP/990-081a65f0", "AMPUSERCID=990") in new stack
    -- Executing [s@macro-user-callerid:10] Set("SIP/990-081a65f0", "CALLERID(all)="Sorcerer" <990>") in new stack
    -- Executing [s@macro-user-callerid:11] Set("SIP/990-081a65f0", "REALCALLERIDNUM=990") in new stack
    -- Executing [s@macro-user-callerid:12] ExecIf("SIP/990-081a65f0", "0|Set|CHANNEL(language)=") in new stack
    -- Executing [s@macro-user-callerid:13] NoOp("SIP/990-081a65f0", "TTL:  ARG1: novm") in new stack
    -- Executing [s@macro-user-callerid:14] GotoIf("SIP/990-081a65f0", "0?continue") in new stack
    -- Executing [s@macro-user-callerid:15] Set("SIP/990-081a65f0", "__TTL=64") in new stack
    -- Executing [s@macro-user-callerid:16] GotoIf("SIP/990-081a65f0", "1?continue") in new stack
    -- Goto (macro-user-callerid,s,23)
    -- Executing [s@macro-user-callerid:23] NoOp("SIP/990-081a65f0", "Using CallerID "Sorcerer" <990>") in new stack
    -- Executing [s@macro-exten-vm:2] Set("SIP/990-081a65f0", "FROMCONTEXT=exten-vm") in new stack
    -- Executing [s@macro-exten-vm:3] Set("SIP/990-081a65f0", "VMBOX=novm") in new stack
    -- Executing [s@macro-exten-vm:4] Set("SIP/990-081a65f0", "EXTTOCALL=999") in new stack
    -- Executing [s@macro-exten-vm:5] Set("SIP/990-081a65f0", "CFUEXT=") in new stack
    -- Executing [s@macro-exten-vm:6] Set("SIP/990-081a65f0", "CFBEXT=") in new stack
    -- Executing [s@macro-exten-vm:7] Set("SIP/990-081a65f0", "RT=""") in new stack
    -- Executing [s@macro-exten-vm:8] Macro("SIP/990-081a65f0", "record-enable|999|IN") in new stack
    -- Executing [s@macro-record-enable:1] GotoIf("SIP/990-081a65f0", "0?2:4") in new stack
    -- Goto (macro-record-enable,s,4)
    -- Executing [s@macro-record-enable:4] AGI("SIP/990-081a65f0", "recordingcheck|20080526-203541|asterisk-29192-1211823341.21") in new stack
    -- Launched AGI Script /usr/share/asterisk/agi-bin/recordingcheck
  ==  recordingcheck|20080526-203541|asterisk-29192-1211823341.21: Failed to execute '/usr/share/asterisk/agi-bin/recordingcheck': Permission denied
    -- AGI Script recordingcheck completed, returning 0
    -- Executing [s@macro-record-enable:5] NoOp("SIP/990-081a65f0", "No recording needed") in new stack
    -- Executing [s@macro-exten-vm:9] Macro("SIP/990-081a65f0", "dial||tr|999") in new stack
    -- Executing [s@macro-dial:1] GotoIf("SIP/990-081a65f0", "1?dial") in new stack
    -- Goto (macro-dial,s,3)
    -- Executing [s@macro-dial:3] AGI("SIP/990-081a65f0", "dialparties.agi") in new stack
    -- Launched AGI Script /usr/share/asterisk/agi-bin/dialparties.agi
  ==  dialparties.agi: Failed to execute '/usr/share/asterisk/agi-bin/dialparties.agi': Permission denied
    -- AGI Script dialparties.agi completed, returning 0
    -- Executing [s@macro-dial:4] NoOp("SIP/990-081a65f0", "Returned from dialparties with no extensions to call and DIALSTATUS: ") in new stack
    -- Executing [s@macro-exten-vm:10] Set("SIP/990-081a65f0", "SV_DIALSTATUS=") in new stack
    -- Executing [s@macro-exten-vm:11] GosubIf("SIP/990-081a65f0", "0?docfu|1") in new stack
    -- Executing [s@macro-exten-vm:12] GosubIf("SIP/990-081a65f0", "0?docfb|1") in new stack
    -- Executing [s@macro-exten-vm:13] Set("SIP/990-081a65f0", "DIALSTATUS=") in new stack
    -- Executing [s@macro-exten-vm:14] NoOp("SIP/990-081a65f0", "Voicemail is novm") in new stack
    -- Executing [s@macro-exten-vm:15] GotoIf("SIP/990-081a65f0", "1?s-|1") in new stack
    -- Goto (macro-exten-vm,s-,1)
    -- Executing [999@from-internal:2] Hangup("SIP/990-081a65f0", "") in new stack
  == Spawn extension (from-internal, 999, 2) exited non-zero on 'SIP/990-081a65f0'
    -- Executing [h@from-internal:1] Macro("SIP/990-081a65f0", "hangupcall") in new stack
    -- Executing [s@macro-hangupcall:1] ResetCDR("SIP/990-081a65f0", "w") in new stack
    -- Executing [s@macro-hangupcall:2] NoCDR("SIP/990-081a65f0", "") in new stack
    -- Executing [s@macro-hangupcall:3] GotoIf("SIP/990-081a65f0", "1?skiprg") in new stack
    -- Goto (macro-hangupcall,s,6)
    -- Executing [s@macro-hangupcall:6] GotoIf("SIP/990-081a65f0", "1?skipblkvm") in new stack
    -- Goto (macro-hangupcall,s,9)
    -- Executing [s@macro-hangupcall:9] GotoIf("SIP/990-081a65f0", "1?theend") in new stack
    -- Goto (macro-hangupcall,s,11)
    -- Executing [s@macro-hangupcall:11] Hangup("SIP/990-081a65f0", "") in new stack
  == Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'SIP/990-081a65f0' in macro 'hangupcall'
  == Spawn extension (macro-hangupcall, s, 11) exited non-zero on 'SIP/990-081a65f0'
router*CLI> 

is there anyone who can help me with this ?

thanks.