Cannot call 3 digit external emergency number

Hello all,

I’m trying to dial to an emergency 3 digit number 117, but Asterisk keeps dialing the local SIP/117 extension which doesn’t exists.

Since I need to add a custom X-header, I’m using the from-internal-custom context in extension_custom:

[from-internal-custom]
exten => 117,1,NoOp(Emergency call...)
exten => 117,n,SIPAddHeader(X-Postalcode: 1000)
exten => 117,n,Set(CALLERID(num)=+3222222222)
exten => 117,n,Dial(SIP/trunk_prim_out/117)
exten => 117,n,Hangup

In the logs I see:

 -- Executing [[email protected]:1] Dial("SIP/1092-00000eb0", "SIP/117,10,tT") in new stack
  == Everyone is busy/congested at this time (1:0/0/1)
    -- Executing [[email protected]:2] GotoIf("SIP/1092-00000eb0", "1?TransferFailed") in new stack
  == Spawn extension (from-internal, 117, 2) exited non-zero on 'SIP/1092-00000eb0'
    -- Executing [[email protected]:1] Macro("SIP/1092-00000eb0", "hangupcall") in new stack
    -- Executing [[email protected]:1] GotoIf("SIP/1092-00000eb0", "1?theend") in new stack

When changing 117 to 1117 (4 digits) it is working correctly.

How can I call externally to 117 and prevent the call going to internal SIP/117?

Thanks a lot for your help!

You probably need an outbound route for it, with a prefix number.

Thanks for helping!

It works when changing the from-internal-custom context to a 4 digit number, for example: 1117

According to the context, the call should be routed directly via SIP/trunk_prim_out/

Though, I just tested with a new outbound route… same result.

You have another block of custom code that is running when you dial 117. One where the first line dials to SIP/117.

You mean the default “from-internal”?

How can I put my from-internal-custom in front of that?

Or how can I locate that custom code?

Thanks as always!

Hi Lorne,

Can you point me in the right direction please?

I’m unable to locate the custom code which could be used before the from-internal-custom.

I’m using the Distro…

Thanks for your help.

There is dialplan on your pbx that you placed there. The log lines provided are not indicative of FreePBX generated dialplan. There are only a few places you could have put it, probably in /etc/asterisk/extensions_custom.conf.

You saved my day Lorne, I missed that.

I had a second from-internal-custom context in the extensions_custom file.

After removing that one, I could call the emergency numbers.

Have a very nice weekend & keep up the great job :wink:

1 Like