Incoming not being passed to extension

I’m having trouble with inbound calls. My SIP provider is I have setup the trunk, inbound, outbound, and extension per the documentation. My VOIP phone is registering with the PBX. The SIP provider is connected via the trunk. So the problem appears to be handing off incoming calls to the extension. I’m using Ubuntu 14.04LTS, Asterisk 12.6.0 and FreePBX 12.0.4. Here is the appropriate section in the log:

pbx.c: -- Executing [[email protected]:1] NoOp("PJSIP/VMS-00000004", "No DID or CID Match") in new stack
pbx.c: -- Executing [[email protected]:2] Answer("PJSIP/VMS-00000004", "") in new stack
chan_sip.c: This function can only be used on SIP channels.
pbx.c: -- Executing [[email protected]:3] Log("PJSIP/VMS-00000004", "WARNING,Friendly Scanner from ") in new stack
Ext. s: Friendly Scanner from
pbx.c: -- Executing [[email protected]:4] Wait("PJSIP/VMS-00000004", "2") in new stack
pbx.c: -- Executing [[email protected]:5] Playback("PJSIP/VMS-00000004", "ss-noservice") in new stack
file.c: -- <PJSIP/VMS-00000004> Playing 'ss-noservice.ulaw' (language 'en')
app_playback.c: Playback failed on PJSIP/VMS-00000004 for ss-noservice
pbx.c: -- Executing [[email protected]:1] Macro("PJSIP/VMS-00000004", "hangupcall,") in new stack
pbx.c: -- Executing [[email protected]:1] GotoIf("PJSIP/VMS-00000004", "1?theend") in new stack
pbx.c: -- Goto (macro-hangupcall,s,3)
pbx.c: -- Executing [[email protected]:3] ExecIf("PJSIP/VMS-00000004", "0?Set(CDR(recordingfile)=)") in new stack
pbx.c: -- Executing [[email protected]:4] Hangup("PJSIP/VMS-00000004", "") in new stack
app_macro.c: == Spawn extension (macro-hangupcall, s, 4) exited non-zero on 'PJSIP/VMS-00000004' in macro 'hangupcall'
pbx.c: == Spawn extension (from-pstn, h, 1) exited non-zero on 'PJSIP/VMS-00000004'

Any suggestions on where to look to fix this? Thanks!

Last time I checked “Friendly Scanner” was SIPVicious - an attack tool used to look for exploitable SIP Servers - This seems really odd to me…

The above log snippet was the result of a call I made to my DID that is trunked through my PBX, so it’s unlikely to be an outside attack, unless I don’t understand what’s going on (which is very likely).

You must have a mis-configuration of your trunk, the DID is not coming in with the inbound call. When I get a call from, the first line looks like this:

pbx.c: -- Executing [[email protected]:1] Set("SIP/voipms-00000ae1", "__FROM_DID=9........7") in new stack

I have sanitized the actual DID with dots in place of digits.

You are correct. Even though my SIP provider didn’t specify this, I needed to put a DID at the end of my trunk registration string. This article details the fix:

Thanks for the help.

I found the problem and list it here for future users who may have the same problem. My SIP provider is VOIP.MS. When you create an account at VOIP.MS, the default inbound setting assumes that you will receive the calls on a VOIP phone or ATA appliance. If you change the default from “ATA Device, IP Phone or Softphone” to “IP PBX Server, Asterisk of Softswitch”, then the DID is passed, and all is right with the world.

If your provider does not send the DID you can solve it with:

adding in the pjsip [registration]
contact_user = blahblahblah

Incoming call doesn’t go anymore to the "s"
extenstons but now to the blahblahblah extension.

How do we add these lines if we are using freePBX ?

adding in the pjsip [registration]
contact_user = blahblahblah


I created a custom context like this :

exten => 6135554114,1,Noop(Fixing DID using information from SIP TO header)
exten => 6135554114,n,Set(pseudodid=${SIP_HEADER(To)})
exten => 6135554114,n,Set(pseudodid=${CUT(pseudodid,@,1)})
exten => 6135554114,n,Set(pseudodid=${CUT(pseudodid,:,2)})
exten => 6135554114,n,Goto(from-trunk,${pseudodid},1)

and gave this as the context in my trunk. Now, I don’t any message from asterisk, but from trunk that this number does not exist ?

Is there something wrong in what I have done ?

I followed what was given here :