Inbound tollfree calls are dead silent. Non-tollfree are ok

Inbound toll-free calls are completely silent for the caller. They are unable to hear greeting prompt. It seems this occurs right after astrisk tries to begin recording the call.

Some errors then begin to fly out:

[Apr 27 14:11:10] WARNING[3246]: translate.c:268 ast_translator_build_path: No translator path from alaw to unknown [Apr 27 14:11:10] WARNING[3246]: chan_sip.c:5813 sip_write: Asked to transmit frame type 4, while native formats is 0x100 (g729)(256) read/write = 0x4 (ulaw)(4)/0x4 (ulaw)(4) [Apr 27 14:11:10] WARNING[3246]: translate.c:268 ast_translator_build_path: No translator path from alaw to unknown [Apr 27 14:11:10] WARNING[3246]: chan_sip.c:5813 sip_write: Asked to transmit frame type 4, while native formats is 0x100 (g729)(256) read/write = 0x4 (ulaw)(4)/0x4 (ulaw)(4) [Apr 27 14:11:10] WARNING[3246]: translate.c:268 ast_translator_build_path: No translator path from alaw to unknown [Apr 27 14:11:10] WARNING[3246]: chan_sip.c:5813 sip_write: Asked to transmit frame type 4, while native formats is 0x100 (g729)(256) read/write = 0x4 (ulaw)(4)/0x4 (ulaw)(4) [Apr 27 14:11:10] WARNING[3246]: translate.c:268 ast_translator_build_path: No translator path from alaw to unknown [Apr 27 14:11:10] WARNING[3246]: chan_sip.c:5813 sip_write: Asked to transmit frame type 4, while native formats is 0x100 (g729)(256) read/write = 0x4 (ulaw)(4)/0x4 (ulaw)(4)

Here is an entire test call from start to hangup:

== Using SIP RTP CoS mark 5 -- Executing [18664043282@flowroute-in:1] Set("SIP/flowroute-00000027", "__CALLTO=8664043282") in new stack -- Executing [18664043282@flowroute-in:2] Goto("SIP/flowroute-00000027", "s,1") in new stack -- Goto (flowroute-in,s,1) -- Executing [s@flowroute-in:1] Set("SIP/flowroute-00000027", "CALLERID(num)=17862533984") in new stack -- Executing [s@flowroute-in:2] Set("SIP/flowroute-00000027", "CALLERID(num)=7862533984") in new stack -- Executing [s@flowroute-in:3] Set("SIP/flowroute-00000027", "CALLERID(name)=Unknown Caller") in new stack -- Executing [s@flowroute-in:4] Set("SIP/flowroute-00000027", "INFO=Inbound call from Flowroute. ") in new stack -- Executing [s@flowroute-in:5] Set("SIP/flowroute-00000027", "__CALLID=1335551569.41") in new stack -- Executing [s@flowroute-in:6] AGI("SIP/flowroute-00000027", "cdr-start.pl,7862533984,Unknown Caller,8664043282,1,1335551569.41,SIP/flowroute-00000027,incoming") in new stack -- Launched AGI Script /var/lib/asterisk/agi-bin/cdr-start.pl -- <SIP/flowroute-00000027>AGI Script cdr-start.pl completed, returning 0 -- Executing [s@flowroute-in:7] NoOp("SIP/flowroute-00000027", "Call 1335551569.41 from 7862533984 received. Fri Apr 27 14:32:49 2012") in new stack -- Executing [s@flowroute-in:8] AGI("SIP/flowroute-00000027", "blacklist.pl,7862533984") in new stack -- Launched AGI Script /var/lib/asterisk/agi-bin/blacklist.pl -- <SIP/flowroute-00000027>AGI Script blacklist.pl completed, returning 0 -- Executing [s@flowroute-in:9] GotoIf("SIP/flowroute-00000027", "0?blocked,s,1") in new stack -- Executing [s@flowroute-in:10] Goto("SIP/flowroute-00000027", "incoming,s,1") in new stack -- Goto (incoming,s,1) -- Executing [s@incoming:1] NoOp("SIP/flowroute-00000027", "Processing call 1335551569.41 to 8664043282 from 7862533984. Fri Apr 27 14:32:49 2012") in new stack -- Executing [s@incoming:2] Set("SIP/flowroute-00000027", "CALLFILENAME=20120427-143249-7862533984") in new stack -- Executing [s@incoming:3] AGI("SIP/flowroute-00000027", "cdr-recorded.pl,1335551569.41,20120427-143249-7862533984.gsm") in new stack -- Launched AGI Script /var/lib/asterisk/agi-bin/cdr-recorded.pl -- <SIP/flowroute-00000027>AGI Script cdr-recorded.pl completed, returning 0 -- Executing [s@incoming:4] MixMonitor("SIP/flowroute-00000027", "20120427-143249-7862533984.gsm") in new stack -- Executing [s@incoming:5] Goto("SIP/flowroute-00000027", "autoattendant,s,1") in new stack -- Goto (autoattendant,s,1) -- Executing [s@autoattendant:1] NoOp("SIP/flowroute-00000027", "call sent to auto attendant. Fri Apr 27 14:32:49 2012") in new stack -- Executing [s@autoattendant:2] Set("SIP/flowroute-00000027", "INFO=Inbound call from Flowroute. Auto Attendant.") in new stack -- Executing [s@autoattendant:3] Answer("SIP/flowroute-00000027", "") in new stack == Begin MixMonitor Recording SIP/flowroute-00000027 [Apr 27 14:32:50] WARNING[3110]: channel.c:3669 set_format: Unable to find a codec translation path from 0x100 (g729) to 0x4 (ulaw) [Apr 27 14:32:50] WARNING[3110]: channel.c:3669 set_format: Unable to find a codec translation path from 0x100 (g729) to 0x4 (ulaw) -- Executing [s@autoattendant:4] Wait("SIP/flowroute-00000027", "2") in new stack [Apr 27 14:32:50] WARNING[3722]: translate.c:268 ast_translator_build_path: No translator path from alaw to unknown [Apr 27 14:32:50] WARNING[3722]: translate.c:268 ast_translator_build_path: No translator path from alaw to unknown [Apr 27 14:32:50] WARNING[3722]: translate.c:268 ast_translator_build_path: No translator path from alaw to unknown [Apr 27 14:32:50] WARNING[3722]: translate.c:268 ast_translator_build_path: No translator path from alaw to unknown [Apr 27 14:32:50] WARNING[3722]: translate.c:268 ast_translator_build_path: No translator path from alaw to unknown [Apr 27 14:32:50] WARNING[3722]: translate.c:268 ast_translator_build_path: No translator path from alaw to unknown [Apr 27 14:32:50] WARNING[3722]: translate.c:268 ast_translator_build_path: No translator path from alaw to unknown [Apr 27 14:32:50] WARNING[3722]: translate.c:268 ast_translator_build_path: No translator path from alaw to unknown [Apr 27 14:32:50] WARNING[3722]: translate.c:268 ast_translator_build_path: No translator path from alaw to unknown [Apr 27 14:32:50] WARNING[3722]: translate.c:268 ast_translator_build_path: No translator path from alaw to unknown [Apr 27 14:32:50] WARNING[3722]: translate.c:268 ast_translator_build_path: No translator path from alaw to unknown [Apr 27 14:32:50] WARNING[3722]: translate.c:268 ast_translator_build_path: No translator path from alaw to unknown [Apr 27 14:32:50] WARNING[3722]: translate.c:268 ast_translator_build_path: No translator path from alaw to unknown [Apr 27 14:32:50] WARNING[3722]: translate.c:268 ast_translator_build_path: No translator path from alaw to unknown [Apr 27 14:32:50] WARNING[3722]: translate.c:268 ast_translator_build_path: No translator path from alaw to unknown [Apr 27 14:32:50] WARNING[3722]: translate.c:268 ast_translator_build_path: No translator path from alaw to unknown [Apr 27 14:32:50] WARNING[3722]: translate.c:268 ast_translator_build_path: No translator path from alaw to unknown [Apr 27 14:32:50] WARNING[3722]: translate.c:268 ast_translator_build_path: No translator path from alaw to unknown [Apr 27 14:32:50] WARNING[3722]: translate.c:268 ast_translator_build_path: No translator path from alaw to unknown [Apr 27 14:32:50] WARNING[3722]: translate.c:268 ast_translator_build_path: No translator path from alaw to unknown [Apr 27 14:32:50] WARNING[3722]: translate.c:268 ast_translator_build_path: No translator path from alaw to unknown [Apr 27 14:32:51] WARNING[3722]: translate.c:268 ast_translator_build_path: No translator path from alaw to unknown == Spawn extension (autoattendant, s, 4) exited non-zero on 'SIP/flowroute-00000027' -- Executing [h@autoattendant:1] Goto("SIP/flowroute-00000027", "endcall,h,1") in new stack -- Goto (endcall,h,1) -- Executing [h@endcall:1] AGI("SIP/flowroute-00000027", "cdr-end.pl,ANSWERED,Inbound call from Flowroute. Auto Attendant.,SIP/flowroute-00000027,1335551569.41") in new stack -- Launched AGI Script /var/lib/asterisk/agi-bin/cdr-end.pl -- <SIP/flowroute-00000027>AGI Script cdr-end.pl completed, returning 0 == End MixMonitor Recording SIP/flowroute-00000027

They just keep piling up.

Asterisk Versions
1.6.1.18

On CentOS 5.4

My sip.conf:

[code][general]
port=5060 ; Port to bind to (SIP is 5060)
bindaddr=0.0.0.0 ; Address to bind to (all addresses on machine)
externip=99.99.99.99
localnet=10.0.1.15/255.255.255.0
context=default
autocreatepeer=no
disallow=all
allow=g722
allow=ulaw
allow=alaw
nat=yes
relaxdtmf=yes
maxepiry=30
register => private@sip.flowroute.com

;
; sip trunks
;
[flowroute]
type=friend
secret=password
username=username
host=sip.flowroute.com
dtmfmode=rfc2833
rfc2833compensate=yes
context=flowroute-in
canreinvite=no
disallow=all
allow=ulaw
allow=g729
relaxdtmf=yes
insecure=port,invite

;
; templates
;
lansoftphone
;modifed 2010-02-08
host=dynamic
nat=no
type=friend
call-limit=10
canreinvite=no
context=sipuserout
dtmfmode=auto
allowsubscribe=yes
qualify=yes
disallow=all
allow=ulaw
allow=alaw
allow=gsm

;
; extensions
;

;###########################
;######### Sales ###########
;###########################
123
secret=Password
callerid=First Last<123>
mailbox=123@mailbox
[/code]

Extensions.conf:

[code];
; comtread init config 08-FEB-2010
; last updated 30-MAR-2010
;
[general]
static=yes
writeprotect=no
autofallthrough=no
clearglobalvars=no
priorityjumping=no

[globals]
SNDFRMT => .ulaw

include => default

[default]
include => parkedcalls
exten => _X.,1,Set(__CALLTO=${EXTEN:-10})
exten => _X.,n,Goto(s,1)
exten => s,1,Set(CALLERID(num)=${FILTER(0-9,${CALLERID(num)})})
exten => s,n,Set(CALLERID(num)=${IF($[“foo${CALLERID(num)}” = “foo”]?0000000000:${CALLERID(num):-10})})
exten => s,n,Set(CALLERID(name)=${IF($[“foo${CALLERID(name)}” = “foo”]?Unknown Caller:${CALLERID(name)})})
exten => s,n,Set(INFO=Inbound call from Unknown. )
exten => s,n,Set(__CALLID=${UNIQUEID})
exten => s,n,AGI(cdr-start.pl,${CALLERID(num)},${CALLERID(name)},${CALLTO},1,${CALLID},${CHANNEL},incoming)
exten => s,n,NoOp(Call ${CALLID} from ${CALLERID(num)} received. ${STRFTIME(${EPOCH},%c)})
exten => s,n,AGI(blacklist.pl,${CALLERID(num)})
exten => s,n,GotoIf($["${RESULT}" = “block”]?blocked,s,1)
exten => s,n,Goto(incoming,s,1)
exten => h,1,Goto(endcall,h,1)

;
; inbound route from Flowroute via SIP
;
[flowroute-in]
exten => _X.,1,Set(__CALLTO=${EXTEN:-10})
exten => _X.,n,Goto(s,1)
exten => s,1,Set(CALLERID(num)=${FILTER(0-9,${CALLERID(num)})})
exten => s,n,Set(CALLERID(num)=${IF($[“foo${CALLERID(num)}” = “foo”]?0000000000:${CALLERID(num):-10})})
exten => s,n,Set(CALLERID(name)=${IF($[“foo${CALLERID(name)}” = “foo”]?Unknown Caller:${CALLERID(name)})})
exten => s,n,Set(INFO=Inbound call from Flowroute. )
exten => s,n,Set(__CALLID=${UNIQUEID})
exten => s,n,AGI(cdr-start.pl,${CALLERID(num)},${CALLERID(name)},${CALLTO},1,${CALLID},${CHANNEL},incoming)
exten => s,n,NoOp(Call ${CALLID} from ${CALLERID(num)} received. ${STRFTIME(${EPOCH},%c)})
exten => s,n,AGI(blacklist.pl,${CALLERID(num)})
exten => s,n,GotoIf($["${RESULT}" = “block”]?blocked,s,1)
exten => s,n,Goto(incoming,s,1)
exten => h,1,Goto(endcall,h,1)

;
;
;
[blocked]
exten => s,1,Set(INFO={$INFO} Blacklisted.)
exten => s,n,Busy(5)
exten => s,n,Hangup()
exten => h,1,Goto(endcall,h,1)

;
; incoming
; No DIDs. All Calls routed to Auto-Attendant
;
[incoming]
exten => s,1,NoOp(Processing call ${CALLID} to ${CALLTO} from ${CALLERID(num)}. ${STRFTIME(${EPOCH},%c)})
exten => s,n,Set(CALLFILENAME=${STRFTIME(${EPOCH},%Y%m%d-%H%M%S)}-${CALLERID(num)})
exten => s,n,AGI(cdr-recorded.pl,${CALLID},${CALLFILENAME}.gsm)
exten => s,n,MixMonitor(${CALLFILENAME}.gsm)
exten => s,n,Goto(autoattendant,s,1)
exten => h,1,Goto(endcall,h,1)

;
; autoattendant
;
; Press 1 for Customer Support
; Press 2 for Sales
; Press 3 for Dial by Name directory
; or Enter an extension
; 0 goes back to main menu
;
[autoattendant]
exten => s,1,NoOp(call sent to auto attendant. ${STRFTIME(${EPOCH},%c)})
exten => s,n,Set(INFO=${INFO} Auto Attendant.)
exten => s,n,Answer()
exten => s,n,Wait(2)
exten => s,n(main),Read(PRESSED,autoatt/greeting,3,1,1.5)
exten => s,n,GotoIf($["${PRESSED}" = “1”]?sales,s,1)
exten => s,n,GotoIf($["${PRESSED}" = “2”]?sales,s,1)
exten => s,n,GotoIf($["${PRESSED}" = “3”]?directory)
exten => s,n,GotoIf($["${PRESSED}" = “900”]?conference,quick,1)
exten => s,n,GotoIf($["${PRESSED}" = “998”]?getmail,general,1)
exten => s,n,GotoIf($["${PRESSED}" = “999”]?conference,s,1)
exten => s,n,Gotoif($["${LEN(${PRESSED})}" = “3”]?extdial)
exten => s,n,GotoIf($["${PRESSED}" = “0”]?invalid)
exten => s,n,GotoIf($["${PRESSED}" = “*”]?invalid)
exten => s,n,GotoIf($[“foo${PRESSED}” = “foo”]?nothing)
exten => s,n,Wait(1)
exten => s,n,Goto(invalid)
exten => s,n(extdial),Wait(1)
exten => s,n,Set(INFO=${INFO} TXFR to ${PRESSED}.)
;exten => s,n,Playback(pls-hold-while-try)
exten => s,n,Goto(extensions,${PRESSED},1)
exten => s,n(directory),Directory(comtread,extensions,eb)
exten => s,n(invalid),Set(INFO=${INFO} Pressed ${PRESSED}.)
exten => s,n,Goto(main)
exten => s,n(nothing),Set(INFO=${INFO} Nothing Entered.)
exten => s,n,GotoIf($["${ENDNOW}" = “END”]?done)
exten => s,n,Set(ENDNOW=END)
exten => s,n,Goto(main)
exten => s,n(done),Set(INFO=${INFO} Ending Call.)
exten => s,n,Playback(vm-goodbye)
exten => s,n,Hangup()
exten => h,1,Goto(endcall,h,1)

[conference]
exten => s,1,Wait(1)
exten => s,n,Playback(pls-hold-while-try)
exten => s,n,Read(CONFNUM,conf-getconfno,6,2)
exten => s,n,GotoIf($[${MATH(${LEN(${CONFNUM})}>=3,i)}=TRUE]?good)
exten => s,n,Playback(invalid)
exten => s,n,Hangup()
exten => s,n(good),Meetme(${CONFNUM},dMIwx)
exten => s,n,Hangup()
exten => quick,1,Wait(1)
exten => quick,n,Playback(pls-hold-while-try)
exten => quick,n,Meetme(2222,dMIwx)
exten => quick,n,Hangup()
exten => h,1,Goto(endcall,h,1)

[conference-create]
exten => s,1,Wait(1)
exten => s,n,Read(CONFNUM,conf-getconfno,6,2)
exten => s,n,GotoIf($[${MATH(${LEN(${CONFNUM})}>=3,i)}=TRUE]?good)
exten => s,n,Playback(invalid)
exten => s,n,Hangup()
exten => s,n(good),Meetme(${CONFNUM},DMAc)
exten => quick,1,Meetme(2222,dMAc)
exten => quick,n,Hangup()
exten => i,1,Goto(s,1)
exten => t,1,Hangup()
exten => h,1,NoOp(ending call ${STRFTIME(${EPOCH},%c)})
exten => h,n,AGI(cdr-end.pl)

;
; 30 MAR 2010: Modify calls to support to be CallerID(name) of Support Call
;
[support]
include => agent
exten => s,1,Answer()
exten => s,n,Set(CALLERID(name)=Support Call)
exten => s,n,GotoIfTime(9:00-18:00,mon-fri,,?doit)
exten => s,n,AGI(queue.pl,${CALLID},support,After Hours,0)
exten => s,n,AGI(queue.pl,${CALLID},support,Voicemail,5)
exten => s,n,Voicemail(901@comtread,u)
exten => s,n,Hangup()
exten => s,n(doit),AGI(queue.pl,${CALLID},support,Entered Queue,0)
exten => s,n,Playback(pls-hold-while-try)
exten => s,n,Set(MONITOR_OPTIONS=aW(2))
exten => s,n,Set(QNAME=support)
exten => s,n,Queue(support,t,12)
exten => s,n,AGI(queue.pl,${CALLID},support,Transfer to Combined,0)
exten => s,n,Set(MONITOR_OPTIONS=aW(2))
exten => s,n,Queue(combined,t,12)
exten => s,n,AGI(queue.pl,${CALLID},support,Option for Voicemail,0)
exten => s,n,Read(QUEUECHOICE,queue-voicemail,1,1,3)
exten => s,n,GotoIf($["${QUEUECHOICE}" = “1”]?vm)
exten => s,n,AGI(queue.pl,${CALLID},support,Transfer to Support2,0)
exten => s,n,Set(MONITOR_OPTIONS=aW(2))
exten => s,n,Queue(support2,t,600)
exten => s,n,AGI(queue.pl,${CALLID},support,Voicemail,15)
exten => s,n,Voicemail(901@comtread,u)
exten => s,n,Hangup()
exten => s,n(vm),AGI(queue.pl,${CALLID},support,Voicemail,12)
exten => s,n,Voicemail(901@comtread,u)
exten => s,n,Hangup()
exten => a,1,Goto(autoattendant,s,main)
exten => t,1,Hangup()
exten => h,1,AGI(queue.pl,${CALLID},support,Left Queue Hangupcause:${HANGUPCAUSE},20)
exten => h,n,Goto(endcall,h,1)

;
; 30 MAR 2010: Modify calls to sales to be CallerID(name) of Sales Call
;
[sales]
include => agent
exten => s,1,Answer()
exten => s,n,Set(CALLERID(name)=Sales Call)
exten => s,n,GotoIfTime(9:00-18:00,mon-fri,,?doit)
exten => s,n,AGI(queue.pl,${CALLID},sales,After Hours,0)
exten => s,n,AGI(queue.pl,${CALLID},sales,Voicemail,5)
exten => s,n,Voicemail(902@comtread,u)
exten => s,n,Hangup()
exten => s,n(doit),AGI(queue.pl,${CALLID},sales,Entered Queue,0)
exten => s,n,Playback(pls-hold-while-try)
exten => s,n,Set(QNAME=sales)
exten => s,n,Set(MONITOR_OPTIONS=aW(2))
exten => s,n,Queue(sales,t,12)
exten => s,n,AGI(queue.pl,${CALLID},sales,Transfer to Combined,0)
exten => s,n,Set(MONITOR_OPTIONS=aW(2))
exten => s,n,Queue(combined,t,12)
exten => s,n,AGI(queue.pl,${CALLID},sales,Option for Voicemail,0)
exten => s,n,Read(QUEUECHOICE,queue-voicemail,1,1,3)
exten => s,n,GotoIf($["${QUEUECHOICE}" = “1”]?vm)
exten => s,n,AGI(queue.pl,${CALLID},sales,Transfer to Sales2,0)
exten => s,n,Set(MONITOR_OPTIONS=aW(2))
exten => s,n,Queue(sales2,t,600)
exten => s,n,AGI(queue.pl,${CALLID},sales,Voicemail,15)
exten => s,n,Voicemail(902@comtread,u)
exten => s,n,Hangup()
exten => s,n(vm),AGI(queue.pl,${CALLID},sales,Voicemail,12)
exten => s,n,Voicemail(902@comtread,u)
exten => s,n,Hangup()
exten => a,1,Goto(autoattendant,s,main)
exten => t,1,Hangup()
exten => h,1,AGI(queue.pl,${CALLID},sales,Left Queue Hangupcause:${HANGUPCAUSE},20)
exten => h,n,Goto(endcall,h,1)

;
; agent
;
[agent]
exten => _XXX,1,NoOp(** calling AGENT - ${EXTEN} )
exten => _XXX,n,Set(__AgentID=${EXTEN})
exten => _XXX,n,Set(GROUP(agents)=${AgentID})
exten => _XXX,n,GotoIf($["${GROUP_COUNT(${AgentID}@agents)}" > “1” ]?busy)
exten => _XXX,n,AGI(queue.pl,${CALLID},${QNAME},${AgentID},10)
exten => _XXX,n,Dial(SIP/${EXTEN},tM(updateagent^${CALLID}^${QNAME}^${AgentID})L(7200000))
exten => _XXX,n,Hangup()
exten => _XXX,n(busy),(
AGENT ${AgentID} already on queue call **)
exten => _XXX,n,Set(DIALSTATUS=BUSY)
exten => _XXX,n,Busy()
exten => _XXX,n,Hangup()
exten => 901,1,Set(CALLEXT=${EXTEN})
exten => 901,n,Goto(support,s,1)
exten => 902,1,Set(CALLEXT=${EXTEN})
exten => 902,n,Goto(sales,s,1)
;
; extensions
;
[extensions]
exten => 900,1,Goto(conference,quick,1)
exten => 901,1,Set(CALLEXT=${EXTEN})
exten => 901,n,Goto(support,s,1)
exten => 902,1,Set(CALLEXT=${EXTEN})
exten => 902,n,Goto(sales,s,1)
exten => 999,1,Goto(conference,s,1)
exten => _3XX,1,Set(CALLEXT=${EXTEN})
exten => _3XX,n,NoOp(Extension lookup for ${CALLEXT})
exten => _3XX,n,Set(INFO=${INFO} Ext ${CALLEXT}.)
exten => _3XX,n,Set(NOANS=SALESFORCE)
exten => _3XX,n,goto(s,1)
exten => _XXX,1,Set(CALLEXT=${EXTEN})
exten => _XXX,n,NoOp(Extension lookup for ${CALLEXT})
exten => _XXX,n,Set(INFO=${INFO} Ext ${CALLEXT}.)
exten => _XXX,n,goto(s,1)
exten => _98XXX,1,Set(CALLEXT=${EXTEN:-3})
exten => _98XXX,n,Set(VMTX=VM)
exten => _98XXX,n,Goto(s,1)
exten => s,1,AGI(get-extension.pl,${CALLEXT})
exten => s,n,GotoIf($["${EXT}" = “fail”]?fail)
exten => s,n,GotoIf($["${DND}" = “1”]?dnd)
exten => s,n,GotoIf($["${VMTX}" = “VM”]?vm)
exten => s,n(dial),NoOp(Calling ${EXT}. ${STRFTIME(${EPOCH},%c)})
exten => s,n,Playback(pls-hold-while-try)
exten => s,n,Set(SPYGROUP=${EXT})
exten => s,n,Set(GROUP(spiedon)=${EXT})
exten => s,n,Dial(SIP/${EXT},14,tkM(updatesipuser^${CALLID}^${EXT}))
exten => s,n,NoOp(DIALSTATUS = ${DIALSTATUS})
exten => s,n,GotoIf($["${DIALSTATUS}" = “ANSWER”]?alldone)
exten => s,n,GotoIf($["${NOANS}" = “SALESFORCE”]?queued)
exten => s,n,Goto(vm)
exten => s,n(dnd),Set(INFO=${INFO} DND is set.)
exten => s,n,GotoIf($["${NOANS}" = “SALESFORCE”]?queued)
exten => s,n(vm),GotoIf($["${mailbox}" = “fail”]?novm)
exten => s,n,Set(INFO=${INFO} Sent to VM.)
exten => s,n,GotoIf($["${DIALSTATUS}" = “BUSY”]?busy)
exten => s,n,Voicemail(${mailbox}@comtread,u)
exten => s,n,Goto(alldone)
exten => s,n(queued),NoOp(SALESFORCE queue)
exten => s,n,Queue(support,tr,12)
exten => s,n,GotoIf($["${DIALSTATUS}" = “ANSWER”]?alldone)
exten => s,n,Goto(vm)
exten => s,n(busy),Voicemail(${mailbox}@comtread,b)
exten => s,n(alldone),Hangup()
exten => s,n(fail),NoOp(No user found for extension ${CALLEXT})
exten => s,n,Set(INFO=${INFO} No matching user found.)
exten => s,n,Goto(autoattendant,s,main)
exten => s,n(novm),Set(INFO=${INFO} No voicemail.)
exten => s,n,Busy(5)
exten => s,n,Hangup()
exten => a,1,Goto(autoattendant,s,main)
exten => i,1,NoOp(extension not found)
exten => i,n,Set(INFO=${INFO} Unknown Extension received. Sent to Autoattendant.)
exten => i,n,Goto(autoattendant,s,main)
exten => h,1,Goto(endcall,h,1)

;
; regged phone outbound
;
[sipuserout]
include => features
exten => 911,1,NoOp(Emergency Call)
exten => 911,n,Goto(emergency,1)
exten => _XXX,1,Set(__CALLTO=${EXTEN})
exten => _XXX,n,Goto(internal,1)
exten => _NXXNXXXXXX,1,Set(__CALLTO=1${EXTEN})
exten => _NXXNXXXXXX,n,Goto(out,1)
exten => _1NXXNXXXXXX,1,Set(__CALLTO=${EXTEN})
exten => _1NXXNXXXXXX,n,Goto(out,1)
exten => _011X.,1,Set(__CALLTO=${EXTEN:3})
exten => _011X.,n,Goto(intl,1)
exten => emergency,1,Set(__CALLID=${UNIQUEID})
exten => emergency,n,Set(INFO=Emergency call.)
exten => emergency,n,Set(SIPUSER=${CUT(CHANNEL,-,1)})
exten => emergency,n,Set(SIPUSER=${CUT(SIPUSER,/,2)})
exten => emergency,n,AGI(cdr-start.pl,${CALLERID(num)},${CALLERID(name)},911,0,${CALLID},${CHANNEL},${SIPUSER})
;exten => emergency,n,Set(CALLERID(num)=NXXNXXXXXX)
;exten => emergency,n,Dial(DAHDI/g1/${CALLTO},120)
; No Emergency Route or Cannot Connect to 911
exten => emergency,n,Busy(5)
exten => emergency,n,Hangup()
exten => internal,1,NoOp(Internal from ${CALLERID(num)} to ${CALLTO})
exten => internal,n,Set(__CALLID=${UNIQUEID})
exten => internal,n,Set(INFO=Internal call.)
exten => internal,n,Set(SIPUSER=${CUT(CHANNEL,-,1)})
exten => internal,n,Set(SIPUSER=${CUT(SIPUSER,/,2)})
exten => internal,n,AGI(cdr-start.pl,${CALLERID(num)},${CALLERID(name)},${CALLTO},0,${CALLID},${CHANNEL},${SIPUSER})
exten => internal,n,Set(CALLFILENAME=${STRFTIME(${EPOCH},%Y%m%d-%H%M%S)}-${CALLTO})
exten => internal,n,AGI(cdr-recorded.pl,${CALLID},${CALLFILENAME}.gsm)
exten => internal,n,MixMonitor(${CALLFILENAME}.gsm)
exten => internal,n,Goto(extensions,${CALLTO},1)
exten => internal,n,Hangup()
exten => out,1,NoOp(Outbound non internal account)
exten => out,n,Set(SIPUSER=${CUT(CHANNEL,-,1)})
exten => out,n,Set(SIPUSER=${CUT(SIPUSER,/,2)})
exten => out,n(check),GotoIf($["${CALLTO:0:3}" = “555”]?blocked,1)
exten => out,n,GotoIf($["${CALLTO:0:3}" = “700”]?blocked,1)
exten => out,n,GotoIf($["${CALLTO:0:3}" = “900”]?blocked,1)
exten => out,n,GotoIf($["${CALLTO:0:3}" = “976”]?blocked,1)
exten => out,n,Goto(flowroute,1)
exten => flowroute,1,Set(__CALLID=${UNIQUEID})
exten => flowroute,n,Set(INFO=Outbound call.)
exten => flowroute,n,AGI(cdr-start.pl,${CALLERID(num)},${CALLERID(name)},${CALLTO},0,${CALLID},${CHANNEL},${SIPUSER})
exten => flowroute,n(dial),NoOp(** Outbound call from ${CALLERID(name) to ${CALLTO}. ${STRFTIME(${EPOCH},%c)} **)
exten => flowroute,n,Goto(monitor,1)
exten => flowroute,n(doit),Set(CALLERID(num)=9547076767)
exten => flowroute,n,Set(CALLERID(name)=9547076767)
exten => flowroute,n,Dial(SIP/${CALLTO}@flowroute,55,TK)
exten => flowroute,n,GotoIf($["${DIALSTATUS}" = “ANSWER”]?alldone)
exten => flowroute,n,Busy(5)
exten => flowroute,n,Hangup()
exten => flowroute,n(alldone),Hangup()
exten => monitor,1,NoOp(adding call to spygroup)
exten => monitor,n,Set(SPYGROUP=${CALLERID(num)})
exten => monitor,n,Set(GROUP(spiedon)=${CALLERID(num)})
; if recorded uncomment below
exten => monitor,n,Set(CALLFILENAME=${STRFTIME(${EPOCH},%Y%m%d-%H%M%S)}-${CALLERID(num)})
exten => monitor,n,AGI(cdr-recorded.pl,${CALLID},${CALLFILENAME}.gsm)
exten => monitor,n,MixMonitor(${CALLFILENAME}.gsm)
; if recorded uncomment above
exten => monitor,n,Goto(flowroute,doit)
exten => h,1,Goto(endcall,h,1)

;
; end call
;
[endcall]
exten => h,1,AGI(cdr-end.pl,${CDR(DISPOSITION)},${INFO},${CHANNEL},${CALLID})

;
; 100 to park call. 101 - 120 is parked extension.
; blind xfer => #1
; disconnect => *0
; attended xfer => #2
; parkcall => #72
;
[features]
include => parkedcalls
exten => *11,1,Goto(conference-create,s,1)
exten => *12,1,Goto(conference-create,quick,1)
exten => *21,1,Goto(conference,s,1)
exten => *22,1,Goto(conference,quick,1)
exten => *25,1,Goto(whisper,monitor,1)
exten => *26,1,Goto(whisper,whisper,1)
exten => *44,1,Goto(login,s,1)
exten => *45,1,Goto(login,logoff,1)
exten => *54,1,Goto(dnd,on,1)
exten => *55,1,Goto(dnd,off,1)
exten => *86,1,Goto(blacklist,s,1)
exten => *88,1,Goto(echotest,s,1)
exten => *98,1,Goto(getmail,s,1)
exten => *99,1,Goto(getmail,general,1)

[dnd]
exten => on,1,Answer()
exten => on,n,Wait(1)
exten => on,n,AGI(dnd.pl,${CALLERID(num)},on)
exten => on,n,GotoIf($["${RESULT}" = “good”]?pass)
exten => on,n(fail),Wait(1)
exten => on,n,Playback(invalid)
exten => on,n,Wait(1)
exten => on,n,Hangup()
exten => on,n(pass),Wait(1)
exten => on,n,Gosub(logoff,1)
exten => on,n,Playback(do-not-disturb)
exten => on,n,Playback(activated)
exten => on,n,Wait(1)
exten => on,n,Hangup()
exten => off,1,Answer()
exten => off,n,Wait(1)
exten => off,n,AGI(dnd.pl,${CALLERID(num)},off)
exten => off,n,GotoIf($["${RESULT}" = “good”]?pass)
exten => off,n(fail),Wait(1)
exten => off,n,Playback(invalid)
exten => off,n,Wait(1)
exten => off,n,Hangup()
exten => off,n(pass),Wait(1)
exten => off,n,Playback(do-not-disturb)
exten => off,n,Playback(de-activated)
exten => off,n,Wait(1)
exten => off,n,Hangup()
exten => logoff,1,AGI(agentlogin.pl,${CALLERID(num)})
exten => logoff,n,GotoIf($["${RESULT}" = “good”]?pass)
exten => logoff,n(fail),Wait(1)
exten => logoff,n,Return
exten => logoff,n(pass),Set(QueueCount=${FIELDQTY(queues,/)})
exten => logoff,n,GotoIf($[“foo${QueueCount}” = “foo” ]?fail)
exten => logoff,n,GotoIf($["${QueueCount}" = “1” ]?justone)
exten => logoff,n(addcheck),GotoIf($["${QueueCount}" = “0” ]?loginend:keepgoing)
exten => logoff,n(keepgoing),RemoveQueueMember(${CUT(queues,/,${QueueCount})},Local/${CALLERID(num)}@agent/n)
exten => logoff,n,Set(QueueCount=${MATH(${QueueCount}-1,i)})
exten => logoff,n,Goto(addcheck)
exten => logoff,n(justone),RemoveQueueMember(${queues},Local/${CALLERID(num)}@agent/n)
exten => logoff,n,Goto(loginend)
exten => logoff,n(loginend),Return

[blacklist]
exten => s,1,Answer()
exten => s,n,Authenticate(9876)
exten => s,n,Read(BLACKLISTPX,enter-phone-number10,10,1,3)
exten => s,n,GotoIf($[${MATH(${LEN(${BLACKLISTPX})}>=10,i)}=TRUE]?pass)
exten => s,n,Hangup()
exten => s,n,AGI(blacklist.pl,${BLACKLISTPX})
exten => s,n,GotoIf($["${RESULT}" = “block”]?blocked,1)
exten => s,n,Goto(notblocked,1)
exten => notblocked,1,Wait(1)
exten => notblocked,n,Playback(privacy-this-number-is)
exten => notblocked,n,Playback(privacy-not)
exten => notblocked,n,Playback(privacy-blacklisted)
exten => notblocked,n,Wait(1)
exten => notblocked,n,Read(BLOCKIT,custom-privacy-add,1,1,2)
exten => notblocked,n,GotoIf($["${BLOCKIT}" = “1”]?block)
exten => notblocked,n,Wait(1)
exten => notblocked,n,Playback(cancelled)
exten => notblocked,n,Wait(1)
exten => notblocked,n,Hangup()
exten => notblocked,n(block),AGI(blacklist-add.pl,${BLACKLISTPX})
exten => notblocked,n,Playback(privacy-blacklisted)
exten => notblocked,n,Wait(1)
exten => notblocked,n,Hangup()
exten => blocked,1,Wait(1)
exten => blocked,n,Playback(privacy-this-number-is)
exten => blocked,n,Playback(privacy-blacklisted)
exten => blocked,n,Wait(1)
exten => blocked,n,Read(BLOCKIT,custom-privacy-add,1,1,2)
exten => blocked,n,GotoIf($["${BLOCKIT}" = “7”]?block)
exten => blocked,n,Wait(1)
exten => blocked,n,Playback(cancelled)
exten => blocked,n,Wait(1)
exten => blocked,n,Hangup()
exten => blocked,n(block),AGI(blacklist-del.pl,${BLACKLISTPX})
exten => blocked,n,Playback(privacy-this-number-is)
exten => blocked,n,Playback(removed)
exten => blocked,n,Wait(1)
exten => blocked,n,Hangup()

[login]
exten => s,1,Answer()
exten => s,n,Wait(1)
exten => s,n,AGI(agentlogin.pl,${CALLERID(num)})
exten => s,n,GotoIf($["${RESULT}" = “good”]?pass)
exten => s,n(fail),Wait(1)
exten => s,n,Playback(invalid)
exten => s,n,Wait(1)
exten => s,n,Hangup()
exten => s,n(pass),Wait(1)
exten => s,n,Playback(welcome)
exten => s,n,Set(QueueCount=${FIELDQTY(queues,/)})
exten => s,n,GotoIf($[“foo${QueueCount}” = “foo” ]?fail)
exten => s,n,GotoIf($["${QueueCount}" = “1” ]?justone)
exten => s,n(addcheck),GotoIf($["${QueueCount}" = “0” ]?loginend:keepgoing)
exten => s,n(keepgoing),AddQueueMember(${CUT(queues,/,${QueueCount})},Local/${CALLERID(num)}@agent/n)
exten => s,n,Set(QueueCount=${MATH(${QueueCount}-1,i)})
exten => s,n,Goto(addcheck)
exten => s,n(justone),AddQueueMember(${queues},Local/${CALLERID(num)}@agent/n)
exten => s,n,Goto(loginend)
exten => s,n(loginend),Playback(agent-loginok)
exten => s,n,Hangup()
exten => logoff,1,Answer()
exten => logoff,n,AGI(agentlogin.pl,${CALLERID(num)})
exten => logoff,n,GotoIf($["${RESULT}" = “good”]?pass)
exten => logoff,n(fail),Wait(1)
exten => logoff,n,Playback(invalid)
exten => logoff,n,Wait(1)
exten => logoff,n,Hangup()
exten => logoff,n(pass),Wait(1)
exten => logoff,n,Playback(welcome)
exten => logoff,n,Set(QueueCount=${FIELDQTY(queues,/)})
exten => logoff,n,GotoIf($[“foo${QueueCount}” = “foo” ]?fail)
exten => logoff,n,GotoIf($["${QueueCount}" = “1” ]?justone)
exten => logoff,n(addcheck),GotoIf($["${QueueCount}" = “0” ]?loginend:keepgoing)
exten => logoff,n(keepgoing),RemoveQueueMember(${CUT(queues,/,${QueueCount})},Local/${CALLERID(num)}@agent/n)
exten => logoff,n,Set(QueueCount=${MATH(${QueueCount}-1,i)})
exten => logoff,n,Goto(addcheck)
exten => logoff,n(justone),RemoveQueueMember(${queues},Local/${CALLERID(num)}@agent/n)
exten => logoff,n,Goto(loginend)
exten => logoff,n(loginend),Playback(agent-loggedoff)
exten => logoff,n,Hangup()

[whisper]
exten => monitor,1,NoOp(Spy on Calls)
exten => monitor,n,Answer()
exten => monitor,n,Wait(1)
exten => monitor,n,AGI(allowmonitor.pl,${CALLERID(num)})
exten => monitor,n,GotoIf($["${ALLOW}" = “allow” ]?get)
exten => monitor,n,Busy(5)
exten => monitor,n,Hangup()
exten => monitor,n(get),Read(SpyOn,vm-extension,4,2)
exten => monitor,n,GotoIf($["${GROUP_COUNT(${SpyOn}@spiedon)}" > “0” ]?oncall)
exten => monitor,n,GotoIf($[${MATH(${LEN(${SpyOn})}<=3,i)}=TRUE]?end)
exten => monitor,n,NoOp(Agent not on call)
exten => monitor,n,Playback(spy-agent)
exten => monitor,n,SayDigits(${SpyOn})
exten => monitor,n,Playback(not-yet-connected)
exten => monitor,n,Goto(get)
exten => monitor,n(oncall),NoOp(Agent on call - begin spying in monitor mode)
exten => monitor,n,Set(GROUP(agents)=${SpyOn})
exten => monitor,n,Chanspy(SIP,g(${SpyOn})q)
exten => monitor,n(end),Hangup()
exten => whisper,1,NoOp(Spy on Calls)
exten => whisper,n,Answer()
exten => whisper,n,Wait(1)
exten => whisper,n,AGI(allowmonitor.pl,${CALLERID(num)})
exten => whisper,n,GotoIf($["${ALLOW}" = “allow” ]?get)
exten => whisper,n,Busy(5)
exten => whisper,n,Hangup()
exten => whisper,n(get),Read(SpyOn,vm-extension,4,2)
exten => whisper,n,GotoIf($["${GROUP_COUNT(${SpyOn}@agents)}" > “1” ]?spied)
exten => whisper,n,GotoIf($["${GROUP_COUNT(${SpyOn}@spiedon)}" > “0” ]?oncall)
exten => whisper,n,GotoIf($[${MATH(${LEN(${SpyOn})}<=3,i)}=TRUE]?end)
exten => whisper,n,NoOp(Agent not on call)
exten => whisper,n,Playback(spy-agent)
exten => whisper,n,SayDigits(${SpyOn})
exten => whisper,n,Playback(not-yet-connected)
exten => whisper,n,Goto(get)
exten => whisper,n(oncall),NoOp(Agent on call - begin spying in whisper mode)
exten => whisper,n,Set(GROUP(agents)=${SpyOn})
exten => whisper,n,Chanspy(SIP,g(${SpyOn})wq)
exten => whisper,n(end),Hangup()
exten => whisper,n(spied),NoOp(Already spied on)
exten => whisper,n,Playback(quiet-mode)
exten => whisper,n,Playback(is-in-use)
exten => whisper,n,Goto(get)

;
; *88 is for echo test
;
[echotest]
exten => s,1,NoOp(call entered echotest from ${CALLERID(num)}. ${STRFTIME(${EPOCH},%c)})
exten => s,n,AGI(cdr-start.pl,${CALLERID(num)},${CALLERID(name)},*88,0,${UNIQUEID},${CHANNEL},${SIPUSER})
exten => s,n,Set(INFO=${INFO} Echo test.)
exten => s,n,Answer()
exten => s,n,Playback(demo-echotest)
exten => s,n,Playback(beep)
exten => s,n,Echo()
exten => s,n,Playback(demo-echodone)
exten => s,n,Playback(goodbye)
exten => s,n,hangup()
exten => i,1,NoOp(invalid extension)
exten => i,n,playback(pm-invalid-option)
exten => h,1,goto(endcall,h,1)

;
; unknown issue
;
[somethingwentwrong]
exten => s,1,Set(INFO=${INFO} DID unknown. Sending to Auto Attendant.)
exten => s,n,Goto(autoattendant,s,1)
exten => h,1,Goto(endcall,s,1)

;
; get voicemail
;
[getmail]
exten => s,1,NoOp(${CALLERID(num)} checking voicemail. ${STRFTIME(${EPOCH},%c)})
exten => s,n,Voicemailmain(${CALLERID(num)}@comtread)
exten => s,n,Hangup()
exten => general,1,NoOp(${CALLERID(num)} checking voicemail. ${STRFTIME(${EPOCH},%c)})
exten => general,n,Voicemailmain(@comtread)
exten => general,n,Hangup()

;
; MACROS
;
[macro-updateagent]
exten => s,1,AGI(queue.pl,${ARG1},${ARG2},${ARG3},30)
exten => s,n,AGI(updatesipuser.pl,${ARG1},${ARG3})
exten => s,n,Set(GROUP(spiedon)=${ARG3})
exten => s,n,Set(SPYGROUP=${ARG3})

[macro-updatesipuser]
exten => s,1,AGI(updatesipuser.pl,${ARG1},${ARG2})
[/code]

I tried to add a disallow statement to sip.conf for g729 codec but that failed. I have not updated my configuration in a good month so I believe our sip provider is sending us calls with a new codec we haven’t configured.

Thank you in advance for your assistance.

In my sip.conf I commented out the following line: allow=g729

[flowroute]
type=friend
secret=password
username=username
host=sip.flowroute.com
dtmfmode=rfc2833
rfc2833compensate=yes
context=flowroute-in
canreinvite=no
disallow=all
allow=ulaw
;allow=g729
relaxdtmf=yes
insecure=port,invite

That fixed my issue.

[color=#FF0000]EDIT 9/10/2012[/color]
I came across this issue again while swapping ISPs to our new fiber connection. I have temporarily swapped back to our old connection and the issue persisted. I fixed it by editing my sip.conf and changing externip= to the appropriate external IP Address. I will test this fix on the fiber line later on this evening once call volume dies down. I had initially set the external IP address to what I thought was correct for the fiber link, but I could have made a mistake.

So an interesting update to this. I was trying to transition last night to our new ISP and discovered ALL DIDs are not working except our main DID. So every single number we have has dead silence on the callers end when the call comes in, however asterisk does report that it picks the call up and starts playing the auto attendant greeting.

What I did to transition:
[ul][li]Updated sip.conf with the new external IP address[/li]
[li]Configured 1-to-1 NAT on our cisco router[/li]
[li]Reconfigured eth0 to use the new gateway.[/li]
[li]Verified ports were opened and connections could be made to both 5060 and my RTP 10000-11000[/li]
[li]Attempted test calls to check quality and functionality (this is where i discovered the only one DID was functioning.[/li]
[li]did: tcpdump -i eth0 -n portrange 10000-11000 -s 0 -vvv -w working_did.pcap[/li]
[li]and: tcpdump -i eth0 -n portrange 10000-11000 -s 0 -vvv -w non_working_did.pcap
This was to see if there was a difference when i called using the non-working vs working did. It was late and no other calls were coming in. I was also watching asterisk console along with netstat -anpu | grep asterisk to make sure no other calls were coming. The non working DIDs had half the amount of packages captured as the working DID for the same call duration. The info saved is unreadable.[/li]
[li]Watched asterisk console to see if there is a difference between working and non-working dids, there was non other than call from. No errors reported either[/li]
[li]ran: grep -ir 3051112222 /etc/asterisk/* to see if i could find any mention of the working did in the config files, there was none.[/li][/ul]

So at this point i’m absolutely stumped. I know the following:
[ul][li]Asterisk is the problem as illustrated by the TCP Dumps, it is not transmitting audio back to the caller.[/li]
[li]Only one DID out of 19 is working although all settings are exactly the same.[/li][/ul]

please share with me your AGI scripts pl…

thanks in advances
here is my email bernad.has@gmail.com