Speed dial numbers Issue >> sent into invalid extension?

In FreePBX 2.9 i have several numbers added to the asterisk directory which that follow the format 1 plus the area code and then the number which works nice with caller id superfecta. However, if i choose to set a speed dial code for those same items i have issues trying to dial them as my outbound dialing rules are set to require a 9 plus the 1 and area code. I’m not certain it would good to add a rule there and allow 11 digit dialing without a 9 for this to work and am curious how i might solve this another/better way?

As it is a the moment, the lookup is a success in the logs, but then get an error as noted below…

-- Executing [*02@from-internal:2] Set("SIP/102-00000015", "SPEEDDIALLOCATION=2") in new stack
-- Executing [*02@from-internal:3] Macro("SIP/102-00000015", "speeddial-lookup,2,102") in new stack
-- Executing [s@macro-speeddial-lookup:1] GotoIf("SIP/102-00000015", "0]?lookupsys") in new stack
-- Executing [s@macro-speeddial-lookup:2] Set("SIP/102-00000015", "SPEEDDIALNUMBER=") in new stack
-- Executing [s@macro-speeddial-lookup:3] Set("SIP/102-00000015", "SPEEDDIALNUMBER=") in new stack
-- Executing [s@macro-speeddial-lookup:4] GotoIf("SIP/102-00000015", "1?lookupsys") in new stack
-- Goto (macro-speeddial-lookup,s,104)
-- Executing [s@macro-speeddial-lookup:104] Set("SIP/102-00000015", "SPEEDDIALNUMBER=16031234567") in new stack
-- Executing [s@macro-speeddial-lookup:105] GotoIf("SIP/102-00000015", "0?failed") in new stack
-- Executing [s@macro-speeddial-lookup:106] NoOp("SIP/102-00000015", "Found system speeddial 2: 16031234567") in new stack
-- Executing [s@macro-speeddial-lookup:107] Goto("SIP/102-00000015", "end") in new stack
-- Goto (macro-speeddial-lookup,s,206)
-- Executing [s@macro-speeddial-lookup:206] NoOp("SIP/102-00000015", "End of Speeddial-lookup") in new stack
-- Executing [*02@from-internal:4] GotoIf("SIP/102-00000015", "0?failed") in new stack
-- Executing [*02@from-internal:5] Goto("SIP/102-00000015", "from-internal,16031234567,1") in new stack
-- Goto (from-internal,16031234567,1)

[Jan 14 11:04:38] WARNING[16109]: pbx.c:4971 __ast_pbx_run: Channel ‘SIP/102-00000015’ sent into invalid extension ‘16031234567’ in context ‘from-internal’, but no invalid handler

thanks

Personally I don’t see the point of dialing 9 for an outside call. I have been running an office PBX for years that permits external calls to be made with 7 digit dialing, 10 digit dialing, and 11 digit dialing with no dialing prefix and I have had zero issues.

To answer your question, look at:/etc/asterisk/extension_additional.conf

where you will find these lines:[macro-speeddial-lookup] include => macro-speeddial-lookup-custom exten => s,1,GotoIf($["${ARG2}"=""]]?lookupsys) exten => s,n,Set(SPEEDDIALNUMBER=) exten => s,n(lookupuser),Set(SPEEDDIALNUMBER=${DB(AMPUSER/${ARG2}/speeddials/${ARG1})}) exten => s,n,GotoIf($["${SPEEDDIALNUMBER}"=""]?lookupsys) exten => s,n,Noop(Found speeddial ${ARG1} for user ${ARG2}: ${SPEEDDIALNUMBER}) exten => s,n,Goto(end) exten => s,lookupuser+101(lookupsys),Set(SPEEDDIALNUMBER=${DB(sysspeeddials/${ARG1})}) exten => s,n,GotoIf($["${SPEEDDIALNUMBER}"=""]?failed) exten => s,n,Noop(Found system speeddial ${ARG1}: ${SPEEDDIALNUMBER}) exten => s,n,Goto(end) exten => s,lookupsys+101(failed),Noop(No system or user speeddial found) exten => s,n(end),Noop(End of Speeddial-lookup) ; end of [macro-speeddial-lookup]

You are not supposed to edit this file directly, changes will be overwritten by FreePBX. You need to edit:/etc/asterisk/extension_custom.conf and add something this this:[macro-speeddial-lookup-custom] <...more lines go here...> ; end of [macro-speeddial-lookup-custom]

Then add the necessary asterisk dialplan code to alter the stock speeddial macro. Unfortunately I can’t help with how to do that and I couldn’t find any help via google, this is just meant to point you in the right direction.

anyone know which file to edit to change the dialing behavior for speed dial?

thanks for the info… i’m also thinking i might be able to simply change the numbers in my phonebook to include the leading “9” which should allow that to all work and then add rules to my superfecta config with DID/CID to match on a subset without the 9. Yah?

Editing all of your address book entries will work (of course you will test first with one entry) but it will complicate your Superfecta setup a bit. You will need to create a separate Superfecta scheme just for Asterisk Phonebook lookups. In this separate scheme you will create a rule that prepends the prefix digit(s) to all incoming numbers in the CID Rules field. This field accepts the “old fashioned” style of dialing rules, something like “9+X.” (without quotes). You will want the Phonebook scheme to come before the next scheme where all of your other lookup sources are defined.

What do you do when you want to redial a number from your phone history? Have you configured the phone dialing rules to prepend a ‘9’ to the outgoing number or do you just not use redial?

cool stuff… i think we have it… thanks for the suggestions. If i store my Asterisk Phonebook entries with a leading “9” (for speed dial to work), then i setup two schemas like you said it works. The one with just the Asterisk Phonebook uses a CID mask of: 9+1ZZZNXXXXXX
and is moved up in priority. Gotta love how flexible this system is… thanks again!

Quick comment, I believe your Superfecta dialing rule should be: 9+1NXXNXXXXXX the Z’s will not work with some area codes. I assume you are in CAN/USA, if not disregard this.

Thanks for that list, Igaetz, just what I was looking for :slight_smile: