Inbound calls dropped

Hi!
My setup:
Debian 7 vps + asterisk 11.2 + freepbx v12

I am trying to get an inbound sip call to ring my extension. very simple, yet somehow it is not working.
Basically the call gets hangup right away and I hear a message saying “the number you have dialed is invalid” and repeats the digits of the did of the trunk used for inbound calls.

Here is a log of the call

  == Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5
    -- Executing [s@from-trunk-sip-MESSAGENET:1] Set("SIP/MESSAGENET-0000001a", "GROUP()=OUT_2") in new stack
    -- Executing [s@from-trunk-sip-MESSAGENET:2] Goto("SIP/MESSAGENET-0000001a", "from-trunk,s,1") in new stack
    -- Goto (from-trunk,s,1)
    -- Executing [s@from-trunk:1] Set("SIP/MESSAGENET-0000001a", "__DIRECTION=INBOUND") in new stack
    -- Executing [s@from-trunk:2] Gosub("SIP/MESSAGENET-0000001a", "app-blacklist-check,s,1()") in new stack
    -- Executing [s@app-blacklist-check:1] GotoIf("SIP/MESSAGENET-0000001a", "0?blacklisted") in new stack
    -- Executing [s@app-blacklist-check:2] Set("SIP/MESSAGENET-0000001a", "CALLED_BLACKLIST=1") in new stack
    -- Executing [s@app-blacklist-check:3] Return("SIP/MESSAGENET-0000001a", "") in new stack
    -- Executing [s@from-trunk:3] ExecIf("SIP/MESSAGENET-0000001a", "1?Set(__FROM_DID=s)") in new stack
    -- Executing [s@from-trunk:4] Set("SIP/MESSAGENET-0000001a", "CDR(did)=s") in new stack
    -- Executing [s@from-trunk:5] ExecIf("SIP/MESSAGENET-0000001a", "0 ?Set(CALLERID(name)=+393456957535)") in new stack
    -- Executing [s@from-trunk:6] Set("SIP/MESSAGENET-0000001a", "CHANNEL(musicclass)=default") in new stack
    -- Executing [s@from-trunk:7] Set("SIP/MESSAGENET-0000001a", "__MOHCLASS=default") in new stack
[2017-01-30 16:58:14] WARNING[14205][C-00000015]: func_channel.c:538 func_channel_read: Unknown or unavailable item requested: 'reversecharge'
    -- Executing [s@from-trunk:8] GotoIf("SIP/MESSAGENET-0000001a", "0?macro-hangupcall") in new stack
    -- Executing [s@from-trunk:9] Set("SIP/MESSAGENET-0000001a", "__CALLINGPRES_SV=allowed_not_screened") in new stack
    -- Executing [s@from-trunk:10] Set("SIP/MESSAGENET-0000001a", "CALLERPRES()=allowed_not_screened") in new stack
    -- Executing [s@from-trunk:11] Goto("SIP/MESSAGENET-0000001a", "from-did-direct,1000,1") in new stack
    -- Goto (from-did-direct,1000,1)
    -- Executing [1000@from-did-direct:1] Set("SIP/MESSAGENET-0000001a", "__RINGTIMER=60") in new stack
    -- Executing [1000@from-did-direct:2] Macro("SIP/MESSAGENET-0000001a", "exten-vm,novm,1000,0,0,0") in new stack
    -- Executing [s@macro-exten-vm:1] Macro("SIP/MESSAGENET-0000001a", "user-callerid,") in new stack
    -- Executing [s@macro-user-callerid:1] Set("SIP/MESSAGENET-0000001a", "TOUCH_MONITOR=1485791894.26") in new stack
    -- Executing [s@macro-user-callerid:2] Set("SIP/MESSAGENET-0000001a", "AMPUSER=+393456957535") in new stack
    -- Executing [s@macro-user-callerid:3] GotoIf("SIP/MESSAGENET-0000001a", "0?report") in new stack
    -- Executing [s@macro-user-callerid:4] ExecIf("SIP/MESSAGENET-0000001a", "1?Set(REALCALLERIDNUM=+393456957535)") in new stack
    -- Executing [s@macro-user-callerid:5] Set("SIP/MESSAGENET-0000001a", "AMPUSER=") in new stack
    -- Executing [s@macro-user-callerid:6] GotoIf("SIP/MESSAGENET-0000001a", "0?limit") in new stack
    -- Executing [s@macro-user-callerid:7] Set("SIP/MESSAGENET-0000001a", "AMPUSERCIDNAME=") in new stack
    -- Executing [s@macro-user-callerid:8] GotoIf("SIP/MESSAGENET-0000001a", "1?report") in new stack
    -- Goto (macro-user-callerid,s,15)
    -- Executing [s@macro-user-callerid:15] GotoIf("SIP/MESSAGENET-0000001a", "0?continue") in new stack
    -- Executing [s@macro-user-callerid:16] Set("SIP/MESSAGENET-0000001a", "__TTL=64") in new stack
    -- Executing [s@macro-user-callerid:17] GotoIf("SIP/MESSAGENET-0000001a", "1?continue") in new stack
    -- Goto (macro-user-callerid,s,28)
    -- Executing [s@macro-user-callerid:28] Set("SIP/MESSAGENET-0000001a", "CALLERID(number)=+393456957535") in new stack
    -- Executing [s@macro-user-callerid:29] Set("SIP/MESSAGENET-0000001a", "CALLERID(name)=+393456957535") in new stack
    -- Executing [s@macro-user-callerid:30] Set("SIP/MESSAGENET-0000001a", "CDR(cnum)=+393456957535") in new stack
    -- Executing [s@macro-user-callerid:31] Set("SIP/MESSAGENET-0000001a", "CDR(cnam)=+393456957535") in new stack
    -- Executing [s@macro-user-callerid:32] Set("SIP/MESSAGENET-0000001a", "CHANNEL(language)=it") in new stack
    -- Executing [s@macro-exten-vm:2] Set("SIP/MESSAGENET-0000001a", "RingGroupMethod=none") in new stack
    -- Executing [s@macro-exten-vm:3] Set("SIP/MESSAGENET-0000001a", "__EXTTOCALL=1000") in new stack
    -- Executing [s@macro-exten-vm:4] Set("SIP/MESSAGENET-0000001a", "__PICKUPMARK=1000") in new stack
    -- Executing [s@macro-exten-vm:5] Set("SIP/MESSAGENET-0000001a", "RT=") in new stack
    -- Executing [s@macro-exten-vm:6] ExecIf("SIP/MESSAGENET-0000001a", "0?Macro(vm,novm,DIRECTDIAL,)") in new stack
    -- Executing [s@macro-exten-vm:7] ExecIf("SIP/MESSAGENET-0000001a", "0?MacroExit()") in new stack
    -- Executing [s@macro-exten-vm:8] Gosub("SIP/MESSAGENET-0000001a", "sub-record-check,s,1(exten,1000,dontcare)") in new stack
    -- Executing [s@sub-record-check:1] GotoIf("SIP/MESSAGENET-0000001a", "0?initialized") in new stack
    -- Executing [s@sub-record-check:2] Set("SIP/MESSAGENET-0000001a", "__REC_STATUS=INITIALIZED") in new stack
    -- Executing [s@sub-record-check:3] Set("SIP/MESSAGENET-0000001a", "NOW=1485791894") in new stack
    -- Executing [s@sub-record-check:4] Set("SIP/MESSAGENET-0000001a", "__DAY=30") in new stack
    -- Executing [s@sub-record-check:5] Set("SIP/MESSAGENET-0000001a", "__MONTH=01") in new stack
    -- Executing [s@sub-record-check:6] Set("SIP/MESSAGENET-0000001a", "__YEAR=2017") in new stack
    -- Executing [s@sub-record-check:7] Set("SIP/MESSAGENET-0000001a", "__TIMESTR=20170130-165814") in new stack
    -- Executing [s@sub-record-check:8] Set("SIP/MESSAGENET-0000001a", "__FROMEXTEN=+393456957535") in new stack
    -- Executing [s@sub-record-check:9] Set("SIP/MESSAGENET-0000001a", "__MON_FMT=wav") in new stack
    -- Executing [s@sub-record-check:10] NoOp("SIP/MESSAGENET-0000001a", "Recordings initialized") in new stack
    -- Executing [s@sub-record-check:11] ExecIf("SIP/MESSAGENET-0000001a", "0?Set(ARG3=dontcare)") in new stack
    -- Executing [s@sub-record-check:12] Set("SIP/MESSAGENET-0000001a", "REC_POLICY_MODE_SAVE=") in new stack
    -- Executing [s@sub-record-check:13] ExecIf("SIP/MESSAGENET-0000001a", "0?Set(REC_STATUS=NO)") in new stack
    -- Executing [s@sub-record-check:14] GotoIf("SIP/MESSAGENET-0000001a", "5?checkaction") in new stack
    -- Goto (sub-record-check,s,17)
    -- Executing [s@sub-record-check:17] GotoIf("SIP/MESSAGENET-0000001a", "1?sub-record-check,exten,1") in new stack
    -- Goto (sub-record-check,exten,1)
    -- Executing [exten@sub-record-check:1] NoOp("SIP/MESSAGENET-0000001a", "Exten Recording Check between +393456957535 and 1000") in new stack
    -- Executing [exten@sub-record-check:2] Set("SIP/MESSAGENET-0000001a", "CALLTYPE=external") in new stack
    -- Executing [exten@sub-record-check:3] ExecIf("SIP/MESSAGENET-0000001a", "0?Set(CALLTYPE=)") in new stack
    -- Executing [exten@sub-record-check:4] Set("SIP/MESSAGENET-0000001a", "CALLEE=never") in new stack
    -- Executing [exten@sub-record-check:5] ExecIf("SIP/MESSAGENET-0000001a", "0?Set(CALLEE=dontcare)") in new stack
    -- Executing [exten@sub-record-check:6] GotoIf("SIP/MESSAGENET-0000001a", "1?callee") in new stack
    -- Goto (sub-record-check,exten,11)
    -- Executing [exten@sub-record-check:11] Gosub("SIP/MESSAGENET-0000001a", "recordcheck,1(never,external,1000)") in new stack
    -- Executing [recordcheck@sub-record-check:1] NoOp("SIP/MESSAGENET-0000001a", "Starting recording check against never") in new stack
    -- Executing [recordcheck@sub-record-check:2] Goto("SIP/MESSAGENET-0000001a", "never") in new stack
    -- Goto (sub-record-check,recordcheck,14)
    -- Executing [recordcheck@sub-record-check:14] Set("SIP/MESSAGENET-0000001a", "__REC_POLICY_MODE=NEVER") in new stack
    -- Executing [recordcheck@sub-record-check:15] Goto("SIP/MESSAGENET-0000001a", "stoprec") in new stack
    -- Goto (sub-record-check,recordcheck,25)
    -- Executing [recordcheck@sub-record-check:25] NoOp("SIP/MESSAGENET-0000001a", "Stopping recording: external, 1000") in new stack
    -- Executing [recordcheck@sub-record-check:26] Set("SIP/MESSAGENET-0000001a", "__REC_STATUS=STOPPED") in new stack
    -- Executing [recordcheck@sub-record-check:27] System("SIP/MESSAGENET-0000001a", "/var/lib/asterisk/bin/stoprecording.php "SIP/MESSAGENET-0000001a"") in new stack

I cannot understand why the call is being dropped. I tried debugging but cannot get any useful info out of the logs. Can anyone provide more insight of what could be causing this?
Thank you for your time and effort, it is highly appreciated

What do your trunk settings look like

Hi Bob!
First of all, thank you for your time.
Here is the trunk config:

Outgoing settings:
> type=peer
> auth=md5
> username=user
> secret=secrer
> host=sip.messagenet.it
> dtmf=rfc2833
> port=5061
> qualify=yes
> insecure=very

Register string:
username:[email protected]:5061/5605168

two things

  1. not a good idea to post the password - not sure if you can edit your post but i would replace the actual stuff with x’s
  2. i think you are missing the context setting - try from-trunk. we also use the trustrpid=yes and the context=from-pstn-e164-us

Wow I’m so silly i cancelled it out in the reg string but forgot in the actual settings!!
Thanks ill try and let you know!

Hi!

I very highly suggest you change the password, we can see what it was in the post history…

Good luck and have a nice day!

Nick