Help,the section [from-internal-additional] in extensions_additional.conf seems not Registered successfully

plz help me!
I installed freepbx2.7,asterisk 1.6.2,after installation,I added two sip extensions 1001 and 1002. when one extension called another,asterisk replied “404 not found”.

I added a line “exten => _.,1,dial(SIP/${EXTEN})” to /etc/asterisk/extensions.conf,like this:
include => from-internal-custom
include => parkedcalls
include => ext-local-confirm
include => findmefollow-ringallv2
include => from-internal-additional
exten => _.,1,dial(SIP/${EXTEN})

then reload dialplan,it worked fine,one extension called another successful.

then I removeed “exten => _.,1,dial(SIP/${EXTEN})” from /etc/asterisk/extensions.conf,and added this line to /etc/asterisk/extensions_additional.conf,
like this:
exten => _.,1,dial(SIP/${EXTEN})
include => from-internal-additional-custom
include => app-recordings
include => app-dialvm
include => app-vmmain
include => app-fmf-toggle
include => ext-findmefollow
include => fmgrps
include => app-calltrace
include => app-directory
include => app-echo-test
include => app-speakextennum
include => app-speakingclock
include => app-languages
include => app-userlogonoff
include => app-pickup
include => app-zapbarge
include => app-chanspy
include => ext-test
include => ext-local
include => outbound-allroutes
exten => h,1,Hangup

then reload dialplan,it didn’t work,one extension called another,asterisk replied “404 not found”

so I think,it seems that section [from-internal-additional] in extensions_additional.conf was not registered successfully in asterisk,am i right and how can fix this problem?

the second time reload dialplan,debug info was:
—Registered extension context ‘from-internal-xfer’ (0x2aa0d3b930) in local table 0xf597b0; registrar: pbx_config
—Including context ‘from-internal-custom’ in context ‘from-internal-xfer’
—Including context ‘parkedcalls’ in context ‘from-internal-xfer’
—Including context ‘ext-local-confirm’ in context ‘from-internal-xfer’
—Including context ‘findmefollow-ringallv2’ in context ‘from-internal-xfer’
—Including context ‘from-internal-additional’ in context ‘from-internal-xfer’
—Including context ‘from-test’ in context ‘from-internal-xfer’
—Added extension ‘s’ priority 1 to from-internal-xfer (0x2aa0d3b930)
—Added extension ‘h’ priority 1 to from-internal-xfer (0x2aa0d3b930)
—Registered extension context ‘from-internal’ (0x2aa0d3f4e0) in local table 0xf597b0; registrar: pbx_config
—Including context ‘from-internal-xfer’ in context ‘from-internal’
—Including context ‘bad-number’ in context 'from-internal’
it doesn’t contain "Registered extension context ‘from-internal-additional’… "
contained only “Including context ‘from-internal-additional’ in context ‘from-internal-xfer’”


Why aren’t you using FreePBX Create SIP extension GUI? Why are you manually editing extensions_additional.conf? The next time you Apply Configuration Changes through FreePBX, it will write overtop the modified extensions_additional.conf…

I used freepbx first!
after installed asterisk and freepbx,I used freepbx webUI create two sip extensions, tow extensions registed successful.but could’t make call,one called another,asterisk replied “404 not found”,I don’t know what’s the problem,so I make a few tests, edit extensions.conf and then edit extensions_addtional.conf.

I know that freepbx will overwrite extensions_addtional.conf …this is just to test. because I don’t know,why extensions can’t call each other. after created extensions,is there anything else to do ?

and after I added “exten => _.,1,dial(SIP/${EXTEN})” to /etc/asterisk/extensions.conf,it works,so I think , setting of extensions are right.The problem had occurred to dialplan。


When you dial *65 (speak extension), does Asterisk reply with the extension number? Do you have the extensions on the local network or on the other side of a router?

I dial *65 or other any number,asterisk replied “404 not found”
two extensions on local lan ,and asterisk on internet.

the problem is that the file globals_custom.conf is not exist.
I create a blank file named globals_custom.conf and then it works.

is that a bug?

that would imply something went wrong in your install and you didn’t get to a point in your attempts to get it working to press the Apply Configuration Changes bar which both re-generates all the _additional.conf files and creates all the include files that are missing.

It also means you probably didn’t check the log file which is one of the first places to go when running into such issues.

Here’s the code that creates the missing conf files:

<?php /* As of Asterisk 1.4.16 or there abouts, a missing #include file will make the reload fail. So we need to make sure that we have such for everything that is in our configs. We will simply look for the #include statements and touch the files vs. trying to inventory everything we may need and then forgetting something. */ $output = array(); exec("grep '#include' ".$amp_conf['ASTETCDIR']."/*.conf | sed 's/;.*//; s/#include//'",$output,$retcode); if ($retcode != 0) { error("Error code $retcode: trying to search for missing #include files"); } foreach($output as $file) { if (trim($file) == '') { continue; } $parse1 = explode(':',$file); $parse2 = explode(';',$parse1[1]); $rawfile = trim($parse2[0]); if ($rawfile == '') { continue; } $target = ($rawfile[0] == '/') ? $rawfile : $amp_conf['ASTETCDIR']."/$rawfile"; if (!file_exists($target)) { $output = array(); exec("touch $target", $output, $retcode); if ($retcode != 0) { error("Error code $retcode: trying to create empty file $target"); } } } [/php]

yes,the log file contains “[Mar 23 08:56:08] ERROR[12831] config.c: The file ‘globals_custom.conf’ was listed as a #include but it does not exist.”,but I didn’t check it.sorry,I’m a beginner.
I remove the file ‘globals_custom.conf’ that created by myself,then change something that not important and press the Apply Configuration Changes bar,but the file ‘globals_custom.conf’ is not created, where is the error info of creating the missing conf files?
the log file /var/log/asterisk/full don’t contains anything about “Error code … trying to create empty file…” .
the error_log of apache don’t contains too.


no need to apologize for not checking the log, just mentioning its a good place to look when things go wrong.

As far as the global_custom.conf not being created, couldn’t say why. The code is above, it gets executed and if it wasn’t working you would have a lot of other errors because there are a lot of files that get created.

I know it’s working, I just deleted mine and ran to verify that it got re-created.

after I remove the file ‘globals_custom.conf’ that created by myself,the error “404 not found” comes back.
which file is above code in? I know a little about php,I want add some php codes for debugging.


you can also run it by itself at the command line, just run it as user asterisk.

You can also check at the top of the file for a debug flag that will print out more verbose debugging info and then add what ever debug statements you want in it to see what is going on with your system.

I run retrieve_conf at the command line,it creates all conf files.

since I run apache as user nobody, retrieve_conf could not work,I run apache as user asterisk,everything normal.

Thank you for your patience and guidance.

you need to either run apache as user asterisk, or you need to setup the proper environment and have a look at the variables in the freepbx_engine script that are pulled form amportal.conf to help get permissions and ownerships straight.

Most people just run apache as asterisk since they are running dedicated PBXs and getting things configured to do otherwise is pretty tedious. Even Digium can’t get it right on their AsteriskNOW distro where they have tried to change apache from asterisk to its own user…

You could change the /etc/passwd and /etc/group file to have asterisk and apache have same ID number. Then to the OS and applications, asterisk and apche is same user. You need to make that change before doing installation, so that all the installation will have proper permission.

if you do that there is no point in making them different, they are the same, so just make them the same by configuring apache to use user asterisk.

otherwise, do all the work to make them different if there are reasons that is desired.

Thanks,I got it.
and another question,I want add extensions via some program for user who registed on my website.does freepbx have any interface to do this? or other tools for asterisk could do?