External callers get NOANSWER instead of trans to voicemail

Hello. I am running Asterisk 10.2.1. I have 1 local area DID that routes calls to my only local extension 6020. All calls terminate well. The only problem, like the post title suggests, is that when there is no answer to calls coming from external callers, the extension just rings for the set amount then gets dropped with a NOANSWER flag. See the log below. What am I missing that makes voicemail inaccessible to external caller when busy or no answer?

Internal caller will get each other’s voicemail when there is no answer or if the line being hailed is busy. I have tried disabling auto fallthrough, the extension will ring forever. Internal extensions can dial into the PSTN network without issues. External calls, when picked up by the internal extension, work, no hang up. Call goes for as long as neither party hangs up. The only thing that is broken is incoming calls from external callers not terminating to voicemail on no answer. Below is my CLI log and the extensions and sip conf files. Please help.

== Using SIP RTP CoS mark 5
– Executing [XXXXXXXXXX@voipmstrunk:1] Answer(“SIP/voipms-0000003c”, “”) in new stack
– Executing [XXXXXXXXXX@voipmstrunk:2] Dial(“SIP/voipms-0000003c”, “SIP/6020,10”) in new stack
== Using SIP RTP CoS mark 5
– Called SIP/6020
– SIP/6020-0000003d is ringing
– Nobody picked up in 10000 ms
– Auto fallthrough, channel ‘SIP/voipms-0000003c’ status is ‘NOANSWER’

Part of my Extensions.conf:

[code][voipms-inbound]
exten => XXXXXXXXXX,1,Answer() ;your DID
exten => XXXXXXXXXX,n,Dial(SIP/6020,10)
exten => 6020,n,Hangup()

[default]
include => voipmstrunk
include => internal-extensions
include => voicemail-generalaccess
include => voicemail-easyaccess

[macro-simple];
; ${ARG1} - extension(s) being called (e.g. SIP/123&SIP/124)
; ${ARG2} - Mailbox (usually the same as ${MACRO_EXTEN})
exten => s,1,Dial(${ARG1},10) ; ring extension for a maximum of 30 seconds
exten => s,n,Goto(s-${DIALSTATUS},10) ; go to status priority (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)
exten => s-NOANSWER,1,VoiceMail(${ARG2},u) ; Person at extension “is unavailable” message
exten => s-BUSY,1,VoiceMail(${ARG2},b) ; Person at extension “is busy” message
exten => s-ANSWER,1,Hangup() ; To be safe, clean up the call after an answer by hanging up
exten => _s-.,1,Goto(s-NOANSWER,1) ; Handle any unhandled status the same way we handle NOANSWER

[internal-extensions]
exten => 6020,1,Macro(simple,SIP/${EXTEN},${EXTEN})
exten => 6021,1,Macro(simple,SIP/${EXTEN},${EXTEN})[/code]

Sip.conf

[code][general]
register => YYYYY:xxxxxxxx@seattle.voip.ms:5060

[voipms]
canreinvite=no
context=mycontext
host=seattle.voip.ms
secret=xxxxxxxxx
type=peer
qualify=yes
username=YYYYYY
disallow=all
allow=ulaw
allow=g711
allow=g726
allow=g723
allow=gsm
fromuser=YYYYYYYYY
trustrpid=yes
sendrpid=yes
insecure=invite
nat=yes

[6020]
username=6020
callerid=“Asterisk PBX” <7XXXXXXXXX>
nat=yes
secret=33333333333
type=Friend
host=Dynamic
mailbox=7XXXXXXXXX@default
dtmfmode=rfc2833
callwaiting = yes
jitterbuffer=yes
qualify=yes
context=default
canreinvite=no

[6021]
username=6021
callerid=“Caller ID” <7XXXXXXXX>
nat=yes
secret=44444444444
type=Friend
host=Dynamic
mailbox=6021@default
dtmfmode=rfc2833
callwaiting = yes
jitterbuffer=yes
qualify=yes
context=default
canreinvite=no[/code]

Call the macro from voipms-inbound. Also, I don’t see any need to Answer - it will just cause people to get charged for wrong numbers.

How do I do that, David? Please help me with the actual script to achieve that. This macro was just copy/paste.

Thanks for your speedy feedback David.

exten => XXXXXXXXXX,n,Dial(SIP/macro-simple,10) ???

Thanks David. The issue has been solved. I removed the following line:

…from my voipms-inbound context.

[voipms-inbound] exten => XXXXXXXXXX,1,Answer() ;your DID exten => XXXXXXXXXX,n,Dial(SIP/6020,10) exten => 6020,n,Hangup()
…all is good now. Voicemail now picks up even for external callers.