Troubleshooting help "Call not approved"

I just setup axvoice account, followed the nerdvittles setup guide… but am having problems here with my X-Lite softphone. I instantly get “Call not approved” when I try to dial out.

Are there any troubleshooting things I could try? I have opened up my firewall udp ports.

Here are my SIP settings;

asterisk1CLI> sip show settings
asterisk1
CLI>

Global Settings:

SIP Port: 5060
Bindaddress: 0.0.0.0
Videosupport: No
AutoCreatePeer: No
Allow unknown access: Yes
Promsic. redir: No
SIP domain support: No
Call to non-local dom.: Yes
URI user is phone no: No
Our auth realm asterisk
Realm. auth: No
User Agent: Asterisk PBX
MWI checking interval: 10 secs
Reg. context: (not set)
Caller ID: Unknown
From: Domain:
Record SIP history: Off
Call Events: Off
IP ToS: 0x0
OSP Support: No
SIP realtime: Disabled
asterisk1*CLI>
Global Signalling Settings:

Codecs: ulaw,alaw
Relax DTMF: No
Compact SIP headers: No
RTP Timeout: 0 (Disabled)
RTP Hold Timeout: 0 (Disabled)
MWI NOTIFY mime type: application/simple-message-summary
DNS SRV lookup: No
Pedantic SIP support: No
Reg. max duration: 3600 secs
Reg. default duration: 120 secs
Outbound reg. timeout: 20 secs
Outbound reg. attempts: 0
Notify ringing state: Yes
asterisk1*CLI>
Default Settings:

Context: from-sip-external
Nat: RFC3581
DTMF: rfc2833
Qualify: 0
Use ClientCode: No
Progress inband: Never
Language: (Defaults to English)
Musicclass: default
Voice Mail Extension: asterisk

asterisk1*CLI> sip show registry
Host Username Refresh State
sip.axvoice.com:5060 mszor9 105 Registered

asterisk1*CLI> sip show peers
Name/username Host Dyn Nat ACL Port Status
axvoice/mszor9 216.143.130.36 N 5060 Unmonitored
232/232 (Unspecified) D 0 Unmonitored

Post Your sip.conf and extensions.conf

Thanks man, ive been exploring, but just dont know what direction to head. I was watching the CLI and got this when receiving a call;

– Executing Set(“SIP/username-4540”, “TIMEOUT(absolute)=15”) in new stack
– Channel will hangup at 2006-04-20 12:50:22 UTC.
– Executing Answer(“SIP/username-4540”, “”) in new stack
– Executing Wait(“SIP/username-4540”, “2”) in new stack
– Executing Playback(“SIP/fusername-4540”, “ss-noservice”) in new stack
– Playing ‘ss-noservice’ (language ‘en’)
– Executing Congestion(“SIP/username-4540”, “”) in new stack
== Spawn extension (from-sip-external, s, 5) exited non-zero on ‘SIP/fusername-4540’

Here are the confs

SIP.CONF

; Note: If your SIP devices are behind a NAT and your Asterisk
; server isn’t, try adding “nat=1” to each peer definition to
; solve translation problems.

[general]

port = 5060 ; Port to bind to (SIP is 5060)
bindaddr = 0.0.0.0 ; Address to bind to (all addresses on machine)
disallow=all
allow=ulaw
allow=alaw
; If you need to answer unauthenticated calls, you should change this
; next line to ‘from-trunk’, rather than ‘from-sip-external’.
; You’ll know this is happening if when you call in you get a message
; saying “The number you have dialed is not in service. Please check the
; number and try again.”
context = from-sip-external ; Send unknown SIP callers to this context
callerid = Unknown

#include sip_nat.conf
#include sip_custom.conf
#include sip_additional.conf

EXTENSIONS.CONF

; include extension contexts generated from AMP
#include extensions_additional.conf

; Customizations to this dialplan should be made in extensions_custom.conf
; See extensions_custom.conf.sample for an example
#include extensions_custom.conf

[from-trunk] ; just an alias since VoIP shouldn’t be called PSTN
include => from-pstn

[from-pstn]
include => from-pstn-custom ; create this context in extensions_custom.conf to include customizations
include => ext-did
exten => fax,1,Goto(ext-fax,in_fax,1)

; ############################################################################
; Macros [macro]
; ############################################################################

; Rings one or more extensions. Handles things like call forwarding and DND
; We don’t call dial directly for anything internal anymore.
; ARGS: $TIMER, $OPTIONS, $EXT1, $EXT2, $EXT3, …
; Use a Macro call such as the following:
; Macro(dial,$DIAL_TIMER,$DIAL_OPTIONS,$EXT1,$EXT2,$EXT3,…)
[macro-dial]
;exten => s,1,GotoIf($[ “${MACRO_CONTEXT}” = “macro-rg-group” ]?4:2) ; if this is from rg-group, don’t strip prefix
;exten => s,2,GotoIf($[“${CALLERID(name):0:${LEN(${RGPREFIX})}}” != “${RGPREFIX}”]?4:3) ; check for ring-group prefix
;exten => s,3,Set(CALLERID(name)=${CALLERID(name):${LEN(${RGPREFIX})}}) ; strip off prefix
exten => s,1,AGI,dialparties.agi
exten => s,2,NoOp(Returned from dialparties with no extensions to call)
exten => s,3,Set(DIALSTATUS=BUSY)
exten => s,10,Dial(${ds}) ; dialparties will set the priority to 10 if $ds is not null
exten => s,20,NoOp(Returned from dialparties with hunt groups to dial )
exten => s,21,Set(HuntLoop=0)
exten => s,22,GotoIf($[${HuntMembers} >= 1]?30 ) ; if this is from rg-group, don’t strip prefix
exten => s,23,NoOp(Returning there are no members left in the hunt group to ring)

exten => s,30,Set(HuntMember=HuntMember${HuntLoop})
exten => s,31,GotoIf($[$[“${CALLTRACE_HUNT}” != “” ] & $[“${RingGroupMethod}” = “hunt” ]]?32:35 ) ; Set CAll Trace for Hunt member we are g$
exten => s,32,Set(CT_EXTEN=${CUT(ARG3,$[${HuntLoop} + 1])})
exten => s,33,Set(DB(CALLTRACE/${CT_EXTEN})=${CALLTRACE_HUNT})
exten => s,34,Goto(s,42)

exten => s,35,GotoIf($[$[“${CALLTRACE_HUNT}” != “” ] & $[“${RingGroupMethod}” = “memoryhunt” ]]?36:50 ) ;Set Call Trace for each hunt membe$
exten => s,36,Set(CTLoop=0)
exten => s,37,GotoIf($[${CTLoop} > ${HuntLoop}]?42 ) ; if this is from rg-group, don’t strip prefix
exten => s,38,Set(CT_EXTEN=${CUT(ARG3,$[${CTLoop} + 1])})
exten => s,39,Set(DB(CALLTRACE/${CT_EXTEN})=${CALLTRACE_HUNT})
exten => s,40,Set(CTLoop=$[1 + ${CTLoop}])
exten => s,41,Goto(s,37)
exten => s,42,Dial(${${HuntMember}}${ds} ) ; dialparties will set the priority to 20 if $ds is not null and its a hunt group
exten => s,43,Set(HuntLoop=$[1 + ${HuntLoop}])
exten => s,44,Set(HuntMembers=$[${HuntMembers} - 1])
exten => s,45,Goto(s,22)
exten => s,50,DBdel(CALLTRACE/${CT_EXTEN})
exten => s,51,Goto(s,42)

;exten => s,1,GotoIf($[ “${MACRO_CONTEXT}” = “macro-rg-group” ]?4:2) ; if this is from rg-group, don’t strip prefix
;exten => s,2,GotoIf($[${CALLERID(name):0:${LEN(${RGPREFIX})}} != ${RGPREFIX}]?4:3) ; check for ring-group prefix
;exten => s,3,Set(CALLERID(name)=${CALLERID(name):${LEN(${RGPREFIX})}}) ; strip off prefix
;exten => s,4,AGI,dialparties.agi
;exten => s,5,NoOp(Returned from dialparties with no extensions to call)
;exten => s,6,Set(DIALSTATUS=BUSY)
;exten => s,10,Dial(${ds}) ; dialparties will set the priority to 10 if $ds is not null

; Ring an extension, if the extension is busy or there is no answer send it
; to voicemail
; ARGS: $VMBOX, $EXT
[macro-exten-vm]
exten => s,1,Macro(user-callerid)
exten => s,n,Set(FROMCONTEXT=exten-vm)
exten => s,n,Macro(record-enable,${ARG2},IN)
exten => s,n,GotoIf($[“${CHANNEL:0:5}” = “Local”]?dolocaldial,1) ; if the channel is Local
exten => s,n,Macro(dial,${RINGTIMER},${DIAL_OPTIONS},${ARG2})
exten => s,n,GotoIf($[“${ARG1}” = “novm”]?s-${DIALSTATUS},1) ; no voicemail in use for this extension
exten => s,n,NoOp(Sending to Voicemail box ${ARG2})
exten => s,n,Macro(vm,${ARG1},${DIALSTATUS})

exten => dolocaldial,1,Macro(dial,${DIAL_OPTIONS},${ARG2})
exten => dolocaldial,n,Goto(?s-${DIALSTATUS},1) ; Do not go to voicemail. This is primarily to avoid vm for call-forwarded extensions in ri$

exten => s-BUSY,1,NoOp(Extension is reporting BUSY and not passing to Voicemail)
exten => s-BUSY,n,Busy()
exten => s-BUSY,n,Wait(60)
exten => s-BUSY,n,NoOp()

exten => _s-.,1,Congestion()

[macro-vm]
exten => s,1,Macro(user-callerid)
exten => s,2,Goto(s-${ARG2},1)
exten => s-BUSY,1,Macro(get-vmcontext,${ARG1})
exten => s-BUSY,2,Voicemail(b${ARG1}@${VMCONTEXT}) ; Voicemail Busy message
exten => s-BUSY,3,Hangup()
exten => _s-.,1,Macro(get-vmcontext,${ARG1})
exten => _s-.,2,Voicemail(u${ARG1}@${VMCONTEXT}) ; Voicemail Unavailable message
exten => _s-.,3,Hangup()
exten => o,1,Background(one-moment-please) ; 0 during vm message will hangup
exten => o,2,GotoIf($[“foo${FROM_DID}” = “foo”]?from-pstn,s,1:from-pstn,${FROM_DID},1)
exten => a,1,Macro(get-vmcontext,${ARG1})
exten => a,2,VoiceMailMain(${ARG1}@${VMCONTEXT})
exten => a,3,Hangup

; get the voicemail context for the user in ARG1
[macro-get-vmcontext]
exten => s,1,Set(VMCONTEXT=${DB(AMPUSER/${ARG1}/voicemail)})
exten => s,2,GotoIf($[“foo${VMCONTEXT}” = “foo”]?200:300)
exten => s,200,Set(VMCONTEXT=default)
exten => s,300,NoOp()

; For some reason, if I don’t run setCIDname, CALLERID(name) will be blank in my AGI
; ARGS: none
[macro-fixcid]
exten => s,1,Set(CALLERID(name)=${CALLERID(name)})

; Ring groups of phones
; ARGS: comma separated extension list
; 1 - Ring Group Strategy
; 2 - ringtimer
; 3 - prefix
; 4 - extension list
[macro-rg-group]
exten => s,1,Macro(user-callerid)
exten => s,2,GotoIf($[“${CALLERID(name):0:${LEN(${RGPREFIX})}}” != “${RGPREFIX}”]?4:3) ; check for old prefix
exten => s,3,Set(CALLERID(name)=${CALLERID(name):${LEN(${RGPREFIX})}}) ; strip off old prefix
exten => s,4,Set(RGPREFIX=${ARG3}) ; set new prefix
exten => s,5,Set(CALLERID(name)=${RGPREFIX}${CALLERID(name)}) ; add prefix to callerid name
exten => s,6,Set(RecordMethod=Group) ; set new prefix
exten => s,7,Macro(record-enable,${MACRO_EXTEN},${RecordMethod})
exten => s,8,Set(RingGroupMethod=${ARG1}) ;
exten => s,9,Macro(dial,${ARG2},${DIAL_OPTIONS},${ARG4})
exten => s,10,Set(RingGroupMethod=‘’) ;

;
; Outgoing channel(s) are busy … inform the client
;
[macro-outisbusy]
exten => s,1,Playback(all-circuits-busy-now)
exten => s,2,Playback(pls-try-call-later)
exten => s,3,Macro(hangupcall)

; What to do on hangup.
[macro-hangupcall]
exten => s,1,ResetCDR(w)
exten => s,2,NoCDR()
exten => s,3,Wait(5)
exten => s,4,Hangup

[macro-faxreceive]
exten => s,1,Set(FAXFILE=/var/spool/asterisk/fax/${UNIQUEID}.tif)
exten => s,2,Set(EMAILADDR=${FAX_RX_EMAIL})
exten => s,3,rxfax(${FAXFILE})
exten => s,103,Set(EMAILADDR=${FAX_RX_EMAIL})
exten => s,104,Goto(3)

; dialout and strip the prefix
[macro-dialout]
exten => s,1,Macro(user-callerid)
exten => s,2,GotoIf($[“${ECID${CALLERID(number)}}” = “”]?5) ;check for CID override for exten
exten => s,3,Set(CALLERID(all)=${ECID${CALLERID(number)}})
exten => s,4,Goto(7)
exten => s,5,GotoIf($[“${OUTCID_${ARG1}}” = “”]?7) ;check for CID override for trunk
exten => s,6,Set(CALLERID(all)=${OUTCID_${ARG1}})
exten => s,7,Set(length=${LEN(${DIAL_OUT_${ARG1}})})
exten => s,8,Dial(${OUT_${ARG1}}/${ARG2:${length}})
exten => s,9,Congestion
exten => s,109,Macro(outisbusy)

; dialout using default OUT trunk - no prefix
[macro-dialout-default]
exten => s,1,Macro(user-callerid)
exten => s,2,Macro(record-enable,${CALLERID(number)},OUT)
exten => s,3,Macro(outbound-callerid,${ARG1})
exten => s,4,Dial(${OUT}/${ARG1})
exten => s,5,Congestion
exten => s,105,Macro(outisbusy)

; dialout using a trunk, using pattern matching (don’t strip any prefix)
; arg1 = trunk number, arg2 = number, arg3 = route password
[macro-dialout-trunk]
exten => s,1,GotoIf($[“${ARG3}” = “”]?3:2) ; arg3 is pattern password
exten => s,2,Authenticate(${ARG3})
exten => s,3,Macro(user-callerid)
exten => s,4,Macro(record-enable,${CALLERID(number)},OUT)
exten => s,5,Macro(outbound-callerid,${ARG1})
exten => s,6,Set(GROUP()=OUT_${ARG1})
exten => s,7,GotoIf($[ ${GROUP_COUNT()} > ${OUTMAXCHANS_${ARG1}} ]?108)
; if we’ve used up the max channels, continue at (n+101)
exten => s,8,Set(DIAL_NUMBER=${ARG2})
exten => s,9,Set(DIAL_TRUNK=${ARG1})
exten => s,10,AGI(fixlocalprefix) ; this sets DIAL_NUMBER to the proper dial string for this trunk
exten => s,11,Set(OUTNUM=${OUTPREFIX_${ARG1}}${DIAL_NUMBER}) ; OUTNUM is the final dial number
exten => s,12,Set(custom=${CUT(OUT_${ARG1},:,1)}) ; Custom trunks are prefixed with “AMP:”
exten => s,13,GotoIf($[“${custom}” = “AMP”]?16)
exten => s,14,Dial(${OUT_${ARG1}}/${OUTNUM}|120|${DIAL_OPTIONS}) ; Regular Trunk Dial, allow recording.
exten => s,15,Goto(s-${DIALSTATUS},1)

; This is a custom trunk. Substitute $OUTNUM$ with the actual number and rebuild the dialstring
; example trunks: “AMP:CAPI/XXXXXXXX:b$OUTNUM$,30,r”, “AMP:OH323/$OUTNUM$@XX.XX.XX.XX:XXXX”
exten => s,16,Set(pre_num=${CUT(OUT_${ARG1},$,1)})
exten => s,17,Set(the_num=${CUT(OUT_${ARG1},$,2)}) ; this is where we expect to find string OUTNUM
exten => s,17,Set(the_num=${CUT(OUT_${ARG1},$,2)}) ; this is where we expect to find string OUTNUM
exten => s,18,Set(post_num=${CUT(OUT_${ARG1},$,3)})
exten => s,19,GotoIf($[“${the_num}” = “OUTNUM”]?20:21) ; if we didn’t find “OUTNUM”, then skip to Dial
exten => s,20,Set(the_num=${OUTNUM}) ; replace “OUTNUM” with the actual number to dial
exten => s,21,Dial(${pre_num:4}${the_num}${post_num})
exten => s,22,Goto(s-${DIALSTATUS},1)

exten => s,108,Noop(max channels used up)
exten => s-BUSY,1,NoOp(Trunk is reporting BUSY)
exten => s-BUSY,2,Busy()
exten => s-BUSY,3,Wait(60)
exten => s-BUSY,4,NoOp()

exten => _s-.,1,NoOp(Dial failed due to ${DIALSTATUS})

; Adds a dynamic agent/member to a Queue
; Prompts for call-back number - in not entered, uses CIDNum
[macro-agent-add]
exten => s,1,Wait(1)
exten => s,2,Macro(user-callerid)
exten => s,3,Read(CALLBACKNUM,agent-user) ; get callback number from user
exten => s,4,GotoIf($[“${CALLBACKNUM}” = “”]?5:7)) ; if user just pressed # or timed out, use cidnum
exten => s,5,Set(CALLBACKNUM=${CALLERID(number)})
exten => s,6,GotoIf($[“${CALLBACKNUM}” = “”]?2)) ; if still no number, start over
exten => s,7,GotoIf($[“${ARG2}” = “”]?9:8)) ; arg2 is queue password
exten => s,8,Authenticate(${ARG2})
exten => s,9,AddQueueMember(${ARG1}|Local/${CALLBACKNUM}@from-internal/n) ; using chan_local allows us to have agents over trunks
exten => s,10,UserEvent(Agentlogin|Agent: ${CALLBACKNUM})
exten => s,11,Wait(1)
exten => s,12,Playback(agent-loginok)
exten => s,13,Hangup()

; Removes a dynamic agent/member from a Queue
; Prompts for call-back number - in not entered, uses CIDNum
[macro-agent-del]
exten => s,1,Wait(1)
exten => s,2,Macro(user-callerid)
exten => s,3,Read(CALLBACKNUM,agent-user) ; get callback number from user
exten => s,4,GotoIf($[“${CALLBACKNUM}” = “”]?5:7)) ; if user just pressed # or timed out, use cidnum
exten => s,5,Set(CALLBACKNUM=${CALLERID(number)})
exten => s,6,GotoIf($[“${CALLBACKNUM}” = “”]?2)) ; if still no number, start over
exten => s,7,RemoveQueueMember(${ARG1}|Local/${CALLBACKNUM}@from-internal/n)
exten => s,8,UserEvent(RefreshQueue)
exten => s,9,Wait(1)
exten => s,10,Playback(agent-loggedoff)
exten => s,11,Hangup()

; arg1 = trunk number, arg2 = number
[macro-dialout-enum]
; This has been violently beaten upon by Rob Thomas, xrobau@gmail.com
; to 1: Be compliant with all the depreciated bits in asterisk 1.2 and
; above, and 2: to give a good shot at attempting to be compliant with
; RFC3761 by honouring the order in which records are returned.
exten => s,1,Macro(user-callerid)
exten => s,n,Macro(record-enable,${CALLERID(number)},OUT)
exten => s,n,Macro(outbound-callerid,${ARG1})
exten => s,n,Set(GROUP()=OUT_${ARG1})
exten => s,n,GotoIf($[ ${GROUP_COUNT()} > ${OUTMAXCHANS_${ARG1}} ]?nochans)
exten => s,n,Set(DIAL_NUMBER=${ARG2})
exten => s,n,Set(DIAL_TRUNK=${ARG1})
exten => s,n,AGI(fixlocalprefix) ; this sets DIAL_NUMBER to the proper dial string for this trunk
exten => s,n,Set(E164NETWORKS=e164.arpa-e164.info-e164.org) ; enum networks to check
exten => s,n,GotoIf($[“${DIAL_NUMBER:0:1}” = “+”]?begin) ; Skip next line if it already is prefixed by a plus
exten => s,n,Set(DIAL_NUMBER=+${DIAL_NUMBER}) ; Add a plus to the start, becasue ENUMLOOKUP needs it.

; start of main network loop
exten => s,n(begin),NoOp(E164NETWORKS is ${E164NETWORKS})
exten => s,n,GotoIf($[“${E164NETWORKS:1:2}”=“”]?failedtotally)
exten => s,n,Set(ENUMNET=${CUT(E164NETWORKS,-,1)})
exten => s,n,Set(E164NETWORKS=${CUT(E164NETWORKS,-,2-)})

exten => s,n,NoOp(E164NETWORKS is now ${E164NETWORKS})
exten => s,n,NoOp(ENUMNET is ${ENUMNET})

exten => s,n,Set(ENUMCOUNT=${ENUMLOOKUP(${DIAL_NUMBER},all,c,${ENUMNET})})
exten => s,n,Set(ENUMPTR=0)

; start of main lookup loop
exten => s,n(startloop),GotoIf($[“${ENUMPTR}”<“${ENUMCOUNT}”]?continue:failed)

; Now, let’s start through them.
exten => s,n(continue),Set(ENUMPTR=$[${ENUMPTR}+1])
exten => s,n,Set(ENUM=${ENUMLOOKUP(${DIAL_NUMBER},all,${ENUMPTR},${ENUMNET})})

; Deal with reponse
exten => s,n,GotoIf($[“${ENUM:0:3}” = “sip” ]?sipuri)
exten => s,n,GotoIf($[“${ENUM:0:3}” = “iax” ]?iaxuri)
; It doesn’t matter if you don’t have h323 enabled, as when it tries to dial, it cares
; about dialstatus and retries if there are any enum results left.
exten => s,n,GotoIf($[“${ENUM:0:3}” = “h32” ]?h323uri)

; OK. If we’re here, we’ve still got some enum entries to go through. Back to
; the start with you!
exten => s,n,Goto(startloop)

; If the prefix is ‘sip:’…
exten => s,n(sipuri),Set(DIALSTR=SIP/${ENUM:4})
exten => s,n,Goto(dodial)

; If it’s IAX2…
exten => s,n(iaxuri),Set(DIALSTR=IAX2/${ENUM:5})
exten => s,n,Goto(dodial)

; Or even if it’s H323.
exten => s,n(h323uri),Set(DIALSTR=H323/${ENUM:5})

exten => s,n(dodial),Dial(${DIALSTR})
exten => s,n,NoOp(Dial exited in macro-enum-dialout with ${DIALSTATUS})

; Now, if we’re still here, that means the Dial failed for some reason.
; If it’s CONGESTION or CHANUNAVAIL we probably want to try again on a
; different channel. However, if it’s the last one, we don’t have any
; left, and I didn’t keep any previous dialstatuses, so hopefully
; someone looking throught the logs would have seen the NoOp’s
exten => s,n,GotoIf($[“${ENUMPTR}”<“${ENUMCOUNT}”]?maybemore:dialfailed)
exten => s,n(maybemore),GotoIf($[ $[ “${DIALSTATUS}” = “CHANUNAVAIL” ] | $[ “${DIALSTATUS}” = “CONGESTION” ] ]?continue)

; If we’re here, then it’s BUSY or NOANSWER or something and well, deal with it.
; If we’re here, then it’s BUSY or NOANSWER or something and well, deal with it.
exten => s,n(dialfailed),Goto(s-${DIALSTATUS},1)

; Here are the exit points for the macro.
exten => s,n(failed),NoOp(EnumLookup failed on network ${ENUMNET})
exten => s,n,Goto(begin)

exten => s,n(failedtotally),NoOp(EnumLookup failed – no more networks to try)
exten => s,n,Goto(end)

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,2,Busy()
exten => s-BUSY,3,Wait(60)
exten => s-BUSY,4,NoOp()

exten => _s-.,1,NoOp(Dial failed due to ${DIALSTATUS})

[macro-record-enable]
exten => s,1,GotoIf(${LEN(${BLINDTRANSFER})} > 0?2:4)
exten => s,2,ResetCDR(w)
exten => s,3,StopMonitor()
exten => s,4,AGI(recordingcheck,${TIMESTAMP},${UNIQUEID})
exten => s,5,Noop(No recording needed)
exten => s,999,Monitor(wav49,${CALLFILENAME}, mb)

;exten => s,3,BackGround(for-quality-purposes)
;exten => s,4,BackGround(this-call-may-be)
;exten => s,5,BackGround(recorded)

; This macro is for dev purposes and just dumps channel/app variables. Useful when designing new contexts.
[macro-dumpvars]
exten => s,1,Noop(ACCOUNTCODE=${ACCOUNTCODE})
exten => s,2,Noop(ANSWEREDTIME=${ANSWEREDTIME})
exten => s,3,Noop(BLINDTRANSFER=${BLINDTRANSFER})
exten => s,4,Noop(CALLERID=${CALLERID(all)})
exten => s,5,Noop(CALLERID(name)=${CALLERID(name)})
exten => s,6,Noop(CALLERID(number)=${CALLERID(number)})
exten => s,7,Noop(CALLINGPRES=${CALLINGPRES})
exten => s,8,Noop(CHANNEL=${CHANNEL})
exten => s,9,Noop(CONTEXT=${CONTEXT})
exten => s,10,Noop(DATETIME=${DATETIME})
exten => s,11,Noop(DIALEDPEERNAME=${DIALEDPEERNAME})
exten => s,12,Noop(DIALEDPEERNUMBER=${DIALEDPEERNUMBER})
exten => s,13,Noop(DIALEDTIME=${DIALEDTIME})
exten => s,14,Noop(DIALSTATUS=${DIALSTATUS})
exten => s,15,Noop(DNID=${DNID})
exten => s,16,Noop(EPOCH=${EPOCH})
exten => s,17,Noop(EXTEN=${EXTEN})
exten => s,18,Noop(HANGUPCAUSE=${HANGUPCAUSE})
exten => s,19,Noop(INVALID_EXTEN=${INVALID_EXTEN})
exten => s,20,Noop(LANGUAGE=${LANGUAGE})
exten => s,21,Noop(MEETMESECS=${MEETMESECS})
exten => s,22,Noop(PRIORITY=${PRIORITY})
exten => s,23,Noop(RDNIS=${RDNIS})
exten => s,24,Noop(SIPDOMAIN=${SIPDOMAIN})
exten => s,25,Noop(SIP_CODEC=${SIP_CODEC})
exten => s,26,Noop(SIPCALLID=${SIPCALLID})
exten => s,27,Noop(SIPUSERAGENT=${SIPUSERAGENT})
exten => s,28,Noop(TIMESTAMP=${TIMESTAMP})
exten => s,29,Noop(TXTCIDNAME=${TXTCIDNAME})
exten => s,30,Noop(UNIQUEID=${UNIQUEID})
exten => s,31,Noop(TOUCH_MONITOR=${TOUCH_MONITOR})
exten => s,32,Noop(MACRO_CONTEXT=${MACRO_CONTEXT})
exten => s,33,Noop(MACRO_EXTEN=${MACRO_EXTEN})
exten => s,34,Noop(MACRO_PRIORITY=${MACRO_PRIORITY})

[macro-user-logon]
; check device type
exten => s,1,Set(DEVICETYPE=${DB(DEVICE/${CALLERID(number)}/type)})
exten => s,2,GotoIf($[“${DEVICETYPE}” = “fixed”]?s-FIXED,1)
; get user’s extension
exten => s,3,Set(AMPUSER=${ARG1})
exten => s,4,GotoIf($[“${AMPUSER}” = “”]?5:9)
exten => s,5,BackGround(please-enter-your)
exten => s,6,Playback(extension)
exten => s,7,Read(AMPUSER,then-press-pound)
; get user’s password and authenticate
exten => s,8,Wait(1)
exten => s,9,Set(AMPUSERPASS=${DB(AMPUSER/${AMPUSER}/password)})
exten => s,10,GotoIf($[${LEN(${AMPUSERPASS})} = 0]?s-NOPASSWORD,1)
; do not continue if the user has already logged onto this device
exten => s,11,Set(DEVICEUSER=${DB(DEVICE/${CALLERID(number)}/user)})
exten => s,12,GotoIf($[“${DEVICEUSER}” = “${AMPUSER}”]?s-ALREADYLOGGEDON,1)
exten => s,13,Authenticate(${AMPUSERPASS})
; devices can only be mapped to one user - loggoff anyone else who is here
exten => s,14,Macro(user-logoff)
; map user to device
exten => s,15,Set(AMPUSERDEVICES=${DB(AMPUSER/${AMPUSER}/device)})
exten => s,16,GotoIf($[${LEN(${AMPUSERDEVICES})} = 0]?18)
exten => s,17,Set(AMPUSERDEVICES=${AMPUSERDEVICES}&)
exten => s,18,Set(AMPUSERDEVICES=${AMPUSERDEVICES}${CALLERID(number)})
exten => s,19,Set(DB(AMPUSER/${AMPUSER}/device)=${AMPUSERDEVICES})
; map device to user
exten => s,20,Set(DB(DEVICE/${CALLERID(number)}/user)=${AMPUSER})
; create symlink from dummy device mailbox to user’s mailbox
exten => s,21,System(/bin/ln -s /var/spool/asterisk/voicemail/default/${AMPUSER}/ /var/spool/asterisk/voicemail/device/${CALLERID(number)})

exten => s-FIXED,1,NoOp(Device is FIXED and cannot be logged into)
exten => s-FIXED,2,Playback(ha/phone)
exten => s-FIXED,3,SayDigits(${CALLERID(number)})
exten => s-FIXED,4,Playback(is-curntly-unavail)
exten => s-FIXED,5,Playback(vm-goodbye)
exten => s-FIXED,6,Hangup ;TODO should play msg indicated device cannot be logged into

exten => s-ALREADYLOGGEDON,1,NoOp(This device has already been logged into by this user)
exten => s-ALREADYLOGGEDON,2,Playback(vm-goodbye)
exten => s-ALREADYLOGGEDON,3,Hangup ;TODO should play msg indicated device is already logged into

exten => s-NOPASSWORD,1,NoOp(This extension does not exist or no password is set)
exten => s-NOPASSWORD,2,Playback(an-error-has-occured)
exten => s-NOPASSWORD,3,Playback(vm-goodbye)
exten => s-NOPASSWORD,4,Hangup ;TODO should play msg indicated device is already logged into
[macro-user-logoff]
; check device type
exten => s,1,Set(DEVICETYPE=${DB(DEVICE/${CALLERID(number)}/type)})
exten => s,2,GotoIf($[“${DEVICETYPE}” = “fixed”]?s-FIXED,1)
; remove entry from user’s DEVICE key
; delete the symlink to user’s voicemail box
exten => s,3,System(rm -f /var/spool/asterisk/voicemail/device/${CALLERID(number)})
exten => s,4,Set(DEVAMPUSER=${DB(DEVICE/${CALLERID(number)}/user)})
exten => s,5,Set(AMPUSERDEVICES=${DB(AMPUSER/${DEVAMPUSER}/device)})
exten => s,6,AGI(list-item-remove.php,${AMPUSERDEVICES},${CALLERID(number)},AMPUSERDEVICES,&)
; reset user → device mapping
; users can log onto multiple devices, need to just remove device from value
exten => s,7,Set(DB(AMPUSER/${DEVAMPUSER}/device)=${AMPUSERDEVICES})
; reset device → user mapping
exten => s,8,Set(DB(DEVICE/${CALLERID(number)}/user)=none)
exten => s,9,Playback(vm-goodbye)

exten => s-FIXED,1,NoOp(Device is FIXED and cannot be logged out of)
exten => s-FIXED,2,Playback(an-error-has-occured)
exten => s-FIXED,3,Playback(vm-goodbye)
exten => s-FIXED,4,Hangup ;TODO should play msg indicated device cannot be logged into

;
; ############################################################################
; CallerID Handling
; ############################################################################

;sets the callerid of the device to that of the logged in user
[macro-user-callerid]
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,Set(AMPUSER=${DB(DEVICE/${REALCALLERIDNUM}/user)})
exten => s,n,Set(AMPUSERCIDNAME=${DB(AMPUSER/${AMPUSER}/cidname)})
exten => s,n,GotoIf($[“${AMPUSERCIDNAME:1:2}” = “”]?report)
exten => s,n,Set(CALLERID(all)=“${AMPUSERCIDNAME}” <${AMPUSER}>)
exten => s,n(report),NoOp(Using CallerID ${CALLERID(all)})

; overrides callerid out trunks
; arg1 is trunk
; macro-user-callerid should be called before using this macro
[macro-outbound-callerid]
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,Set(USEROUTCID=${DB(AMPUSER/${REALCALLERIDNUM}/outboundcid)})
exten => s,n,Set(EMERGENCYCID=${DB(DEVICE/${REALCALLERIDNUM}/emergency_cid)})
exten => s,n,Set(TRUNKOUTCID=${OUTCID_${ARG1}})
exten => s,n,GotoIf($[“${EMERGENCYROUTE:1:2}” = “”]?trunkcid) ; check EMERGENCY ROUTE
exten => s,n,GotoIf($[“${EMERGENCYCID:1:2}” = “”]?trunkcid) ; empty EMERGENCY CID, so default back to trunk
exten => s,n,Set(CALLERID(all)=${EMERGENCYCID}) ; emergency cid for device
exten => s,n,Goto(report)
exten => s,n(trunkcid),GotoIf($[“${TRUNKOUTCID:1:2}” = “”]?usercid) ;check for CID override for trunk (global var)
exten => s,n,Set(CALLERID(all)=${TRUNKOUTCID})
exten => s,n(usercid),GotoIf($[“${USEROUTCID:1:2}” = “”]?report) ; check CID override for extension
exten => s,n,Set(CALLERID(all)=${USEROUTCID})
exten => s,n(report),NoOp(CallerID set to ${CALLERID(all)})

;
; ############################################################################
; Inbound Contexts [from]
; ############################################################################

[from-sip-external]
;give external sip users congestion and hangup
exten => _X.,1,Goto(s,1)
exten => s,1,Set(TIMEOUT(absolute)=15)
exten => s,n,Answer
exten => s,n,Wait(2)
exten => s,n,Playback(ss-noservice)
exten => s,n,Congestion
exten => s,n,Hangup

[from-internal]
; applications are now mostly all found in from-internal-additional in _custom.conf
include => parkedcalls
include => from-internal-custom

; overrides callerid out trunks
; arg1 is trunk
; macro-user-callerid should be called before using this macro
[macro-outbound-callerid]
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,Set(USEROUTCID=${DB(AMPUSER/${REALCALLERIDNUM}/outboundcid)})
exten => s,n,Set(EMERGENCYCID=${DB(DEVICE/${REALCALLERIDNUM}/emergency_cid)})
exten => s,n,Set(TRUNKOUTCID=${OUTCID_${ARG1}})
exten => s,n,GotoIf($[“${EMERGENCYROUTE:1:2}” = “”]?trunkcid) ; check EMERGENCY ROUTE
exten => s,n,GotoIf($[“${EMERGENCYCID:1:2}” = “”]?trunkcid) ; empty EMERGENCY CID, so default back to trunk
exten => s,n,Set(CALLERID(all)=${EMERGENCYCID}) ; emergency cid for device
exten => s,n,Goto(report)
exten => s,n(trunkcid),GotoIf($[“${TRUNKOUTCID:1:2}” = “”]?usercid) ;check for CID override for trunk (global var)
exten => s,n,Set(CALLERID(all)=${TRUNKOUTCID})
exten => s,n(usercid),GotoIf($[“${USEROUTCID:1:2}” = “”]?report) ; check CID override for extension
exten => s,n,Set(CALLERID(all)=${USEROUTCID})
exten => s,n(report),NoOp(CallerID set to ${CALLERID(all)})
;
;
; ############################################################################
; Inbound Contexts [from]
; ############################################################################

[from-sip-external]
;give external sip users congestion and hangup
exten => _X.,1,Goto(s,1)
exten => s,1,Set(TIMEOUT(absolute)=15)
exten => s,n,Answer
exten => s,n,Wait(2)
exten => s,n,Playback(ss-noservice)
exten => s,n,Congestion
exten => s,n,Hangup

[from-internal]
; applications are now mostly all found in from-internal-additional in _custom.conf
include => parkedcalls
include => from-internal-custom
;allow phones to dial other extensions
include => ext-fax
;allow phones to access generated contexts
include => from-internal-additional
exten => s,1,Macro(hangupcall)
exten => h,1,Macro(hangupcall)

[from-zaptel]
exten => _X.,1,Set(DID=${EXTEN})
exten => _X.,n,Goto(s,1)
exten => s,1,NoOp(Entering from-zaptel with DID == ${DID})
; If ($did == “”) { $did = “s”; }
exten => s,n,Set(DID=${IF($[ “${DID}” = “”]?s:${DID))})
exten => s,n,NoOp(DID is now ${DID})
exten => s,n,GotoIf($[ “${CHANNEL:0:3}” = “Zap” ]?zapok:notzap)
exten => s,n(notzap),Goto(ext-did,${DID},1)
; If there’s no ext-did,s,1, that means there’s not a no did/no cid route. Hangup.
exten => s,n,Macro(hangup)
exten => s,n(zapok),NoOp(Is a Zaptel Channel)
exten => s,n,Set(CHAN=${CHANNEL:4})
exten => s,n,Set(CHAN=${CUT(CHAN,-,1)})

exten => s,n,Macro(from-zaptel-${CHAN},${DID},1)
; If nothing there, then treat it as a DID
exten => s,n,NoOp(Returned from Macro from-zaptel-${CHAN})
exten => s,n,Goto(ext-did,${DID},1)

; ############################################################################
; Extension Contexts [ext]
; ############################################################################

[ext-fax]
exten => s,1,Answer
exten => s,2,Goto(in_fax,1)
exten => in_fax,1,GotoIf($[“${FAX_RX}” = “system”]?2:analog_fax,1)
exten => in_fax,2,Macro(faxreceive)
exten => in_fax,3,system(/var/lib/asterisk/bin/fax-process.pl --to ${EMAILADDR} --subject “Fax from ${CALLERID(number)} ${CALLERID(name)}” -$
exten => in_fax,4,Hangup
exten => analog_fax,1,GotoIf($[“${FAX_RX}” = “disabled”]?3:2) ;if fax is disabled, just hang up
exten => analog_fax,2,Set(DIAL=${DB(DEVICE/${FAX_RX}/dial)});
exten => analog_fax,3,Dial(${DIAL},20,d)
exten => analog_fax,4,Hangup
;exten => out_fax,1,wait(7)
exten => out_fax,1,txfax(${TXFAX_NAME}|caller)
exten => out_fax,2,Hangup
exten => h,1,Hangup()

;this is where parked calls go if they time-out. Should probably re-ring
[default]
include => ext-local
exten => s,1,Playback(vm-goodbye)
exten => s,2,Macro(hangupcall)

If You didn’t put context= in SP phones configuration
SIP phones uses this context for making calls:
context = from-sip-external

From extensions.conf:

Log

See any connection between context and log ?

from your first post:

Try changing [from-sip-external] to:
exten => _X.,1,Dial(SIP/axvoice/${EXTEN})
exten => _X.,2,hangup

ahhh… yes i see that…

So now I have in extensions.conf

[from-sip-external]
;give external sip users congestion and hangup
exten => _X.,1,Goto(s,1)
exten => s,1,Set(TIMEOUT(absolute)=15)
exten => s,n,Answer
exten => s,n,Wait(2)
exten => _X.,1,Dial(SIP/axvoice/${EXTEN})
exten => _X.,2,Hangup

But get this at CLI;

-- Executing Set("SIP/username", "TIMEOUT(absolute)=15") in new stack
-- Channel will hangup at 2006-04-20 13:40:30 UTC.
-- Executing Answer("SIP/username", "") in new stack
-- Executing Wait("SIP/username", "2") in new stack

The call times out with an incomplete message… BTW where did all this stuff come from in the extensions.conf? is that normal or from all the modules I installed?

[quote][from-sip-external]
;give external sip users congestion and hangup
exten => _X.,1,Goto(s,1)
exten => s,1,Set(TIMEOUT(absolute)=15)
exten => s,n,Answer
exten => s,n,Wait(2)
exten => _X.,1,Dial(SIP/axvoice/${EXTEN})
exten => _X.,2,Hangup [/quote]
Make it like this:

[from-sip-external]
 ;give external sip users congestion and hangup
 ;exten => _X.,1,Goto(s,1)
 ;exten => s,1,Set(TIMEOUT(absolute)=15)
 ;exten => s,n,Answer
 ;exten => s,n,Wait(2)
 exten => _X.,1,Dial(SIP/axvoice/${EXTEN})
 exten => _X.,2,Hangup 

You are using AMP
extensions.conf

sip.conf

there is some additional configuration in these files.

When I comment out the first 4 I just get sent directly to axvoice voicemail :smile:

I dont know if this is something, but when I was following the nerdvittles setup doc; nerdvittles.com/index.php?p=62

I was unable to complete the following;
“Only two more steps and we’ll be ready to try out our new system. Click the Incoming Calls tab. In both the Regular Hours and After Hours sections of the form, click the Extension radio button and choose your new extension number (1000) for receipt of incoming calls. Click Submit Changes and then click the red bar to reset Asterisk.”

I’m not sure if this is because of the update in Asterisk@Home, or why, but I do not have an Incoming Calls tab, only Inbound Routes, which mentions nothing about regular hours or after hours sections.

This is where im at now… when calling in nothing is heard, just dead silence… here is the CLI output

– Executing Set(“SIP/myusername-6802”, “TIMEOUT(absolute)=15”) in new stack
– Channel will hangup at 2006-04-21 01:20:34 UTC.
– Executing Answer(“SIP/myusername-6802”, “”) in new stack
– Executing Wait(“SIP/myusername-6802”, “2”) in new stack

[quote=“fpc”]I just setup axvoice account, followed the nerdvittles setup guide… but am having problems here with my X-Lite softphone. I instantly get “Call not approved” when I try to dial out.
[/quote]

It’s quite easy: you need to fill
Menu - System settings- Sip Proxy - Default
first!
And only after that you can add more sip proxy’s

Without filling default sip proxy (even if you add Proxy 1 or 2 or something like that) x-lite (and any soft phone of x-ten corp.) doesn’t permit any call with this error “Call not approved”. X-lite doesn’t send INVITE message in this case too