Database, Asterisk Files, Create Extensions, another Page instead of FreePBX page

Hi guys
I set some telephony settings with FreePBX, Like: Inbound, outbound, IVR … settings.
I created my own page (instead of FreePBX page), and it work. (I wrote my page with PHP)
I want to create some new extensions (different from those i have created with FreePBX) with my new page, so I did this by using sip_custom.conf file. These new extensions are registered, but for their "contexts", i have no enough time to write new contexts in extensions_custom.conf file.
I tried to copy extensions_additional.conf file to extensions_custom.conf file and change some cases to modify it to my own needs, but I faced with many errors.
Now i make some scenario for myself to do this, But i don’t know which of them is the best:

  1. Instead of using sip_custom.conf file (for create new Extensions), I use the FreePBX database and enter new Extensions directly in FreePBX database.

  2. Under any circumstances, i use the contents of extensions_additional.conf file and change them to be useful for using in extensions_custom.conf file. (but i did this and faced with many errors, so how do this correctly?)

  3. Is there a simple way to write Dialplan, contexts, in extensions_custom.conf file? ( I write some simple context, but not professionally)

Now please tell me:

  • Are my scenarios OK? If they are OK, which one is better? and how i do that?

  • If the scenarios are not OK, show me a good way please.

Thankyou

It’s not clear what your goals are. Do you want custom contexts for each extension? If so, why? Maybe there’s a more straightforward way to do what you want. There are also a number of paid modules you may not have seen yet that will help you with your goal.

I don’t want custom contexts for each extension, I used freePBX contexts for my new Extensions, but they did not work, if there is a way that i can use freePBX contexts, please tell me.

Your extensions are in the from-internal context by default. You don’t need to change that unless you have some big customization in mind.

Creating extensions from bash:
https://wiki.freepbx.org/pages/viewpage.action?pageId=37912685#fwconsolecommands(13+)-BulkImport

Deleting extension:

2 Likes

Maybe i should ask the question via another way:
Can I use the FreePBX contexts (in extensions_additional.conf file) for my own extensions in sip_custom.conf ?
Or I should write new contexts (for extensions that are in sip_custom.conf file) in extensions_custom.conf file?

Hello @saha,

Can you show us a sip user that you creating in your sip_custom.conf file?

Thank you,

Daniel Friedman
Trixton LTD.

hi

 [100]
deny=0.0.0.0/0.0.0.0
secret=1gf0ghg9786@ujjfdl99767d$gh0
dtmfmode=rfc2833
canreinvite=no
context=from-internal-custom
host=dynamic
defaultuser=
trustrpid=yes
sendrpid=no
type=friend
session-timers=accept
nat=no
port=5060
qualify=yes
qualifyfreq=60
transport=udp
avpf=no
force_avp=no
encryption=no
videosupport=yes
namedcallgroup=
namedpickupgroup=
dial=SIP/100
permit=0.0.0.0/0.0.0.0
callerid=100 <100>
callcounter=yes
faxdetect=no

Can I use “from-internal” in extensions_additional.conf or i should create “from-internal-custom” in extensions_custom.conf?

Hello @saha,

you should use the from-internal context if you want to use the Freepbx framework.
The from-internal-custom context or any other context that usually ends with -custom is for customization of the original dialplan.

My suggestion is to configure an extension via the regular way and then copy its settings as a format for your customized extensions.
Another suggestion for you is not to configure extensions that start with 1 as it is usually used for emergency services or special services.

Thank you,

Daniel Friedman
Trixton LTD.

As I said before, i had set some settings with FreePBX, and added some new sip accounts in sip_custom.conf and for their contexts, i copied contents in extensions_additional.conf file into extensions_custom.conf file and change somethings to be compatible with my needs, but i faced to many errors.
Now question is this: how can I change contents in extensions_additional.conf file, and move them into extensions_custom.conf file, to be compatible with my needs?
Is it true at all?!?!

Hello @saha,

Stop messing with the framework and start reading my answers.
Any change to the Freepbx framework should be done in the -custom contexts like the from-internal-custom context.
Any -custom context is loaded first to the memory and then continues with the regular dialplan.

So, any change in the internal dialplan should be done in the from-internal-custom or at the custom macros like macro-dialout-trunk-predial-hook for outbound calls and macro-dialout-one-predial-hook for local calls.

Thank you,

Daniel Friedman
Trixton LTD.

You can’t create extensions by only editing .conf files. You will be missing all the AstDB entries that are also required.

thanks