Including custom contexts

Hello,
Is it normal functionality to not include the custom contexts anymore? It seems I can add contexts to the extensions_override_freepbs.conf but if I add anything to extensions_custom.conf it’s not loaded at all.

I do have Disable -custom Context Includes set to false under Advanced Settings, and hence see the nonexistent context errors when reloading the dialplan.

If it’s enabled in Advanced Settings, then the custom includes are there. It is more probable that what you are trying to do can’t be done by using one. Explain what you are trying to do.

Utilize the ‘ChanSpy’ script that has worked forever…

This is the only thing that is in the extensions_custom.conf file.

#include extensions_queuemetrics.conf

[ext-local-custom]
;ChanSpy
exten => 555,1,Macro(user-callerid)
exten => 555,2,Read(SPYNUM,en/enter-ext-of-person)
exten => 555,3,ChanSpy(SIP/${SPYNUM})

Not sure if the queuemetrics.conf file is even getting included…

It is conventional to add dial plan like that in the context, [from-internal-custom]. It it probably not working because 555 is already defined by FreePBX. But that is a guess, to eliminate guessing you need to post a call trace.

On the Extensions page, in the past there was a text box for manually entering special contexts not generated by the CC module. This has been hidden in recent versions of CC for some reason. If this is what your problem is, here is the fix. Editing functions.inc.php before uploading the module is best for a permanent fix.

Thanks for the suggestion JohnF but I am not really sure this has anything to do with the Custom Context module. Rather it’s specific to the Asterisk dialplan custom contexts, although it does seems to be an issue with FreePBX distro (at least for me).

If I add the above chanspy context in extensions_override_freepbs.conf then it’s loaded and works with no problem. However, if I add the context to extensions_custom.conf then it never shows up in the dialplan at all.

extensions.conf has these includes in it.

#include extensions_override_freepbx.conf
#include extensions_additional.conf
#include extensions_custom.conf

and extensions_additional.conf has these lines

[ext-local]
include => ext-local-custom

Simply at a loss as to why it won’t load from extensions_custom.conf, which would be the proper place for it. I have plans to use the extensions_override_freepbx.conf file (for overridding a couple of contexts w/ html access for the users).

any extension will be found in sip.conf or the first included file in which it exists, so it would find 555 in override before additional and as it exists in additional then anything in custom is spurious, try changing to 556

1 Like

That’s it Dicko. Thank you sir.

555 was in Feature Codes as ChanSpy (ofc), disabled as always but I think there may have been a subtle change from a previous release. ChanSpy feature code is now set to 556 and the ext-local-custom context using 555 works perfectly.

Thanks again for setting me on the right track.

please kindly assist.
I have a freepbx 14 running on a raspi with 24 extensions having 3 extensions each on 1XX, 2XX…9XX.
I want only extensions in 1XX to be able to reach each other and same with the 2XX, 3XX to 8XX. but i want all extensions to be able to reach the 9XX and the 9XX able to call all extensions.
Please how do i go about it.
Thanks

Your request seems a lot like multi-tenant PBX, for which Asterisk is not your best choice.
If you are willing to test another solution, give FreeSWITCH/FusionPBX a try.
If you insist on Asterisk/FreePBX, there aren’t any current modules to do what you need that I’m aware of, so you probably will need some coding but even then I’m not sure you will be able to accomplish complete extension segregation.

Actually it doesn’t. You’re equating the need to have certain groups of extensions only call certain groups of extensions as multi-tenant when that is a common business need.

There is the Class of Service commercial module that allows you to manage what dialable extensions (extensions, ring groups, queues, outbound routes, etc) that an extension can dial.

This would only be a multi-tenant setup if all those groups of extensions belonged to different customers that are using them. That hasn’t been specified at all.

COS does not control extension to extension calls.

Well that’s a shame. Sounds like some custom dialplan is going to be needed. However, still doesn’t mean it’s a multi-tenant system.

@BlazeStudios COS module does not control extension to extension calling, so my observation is not incorrect.
Restricting extension to extension calls is generally related to multi-tenancy, that is why I mentioned it. In any case, multi-tenancy desired or not, restricting extension to extension calling is not something that FreePBX provides out of the box and that is what I was trying to explain to the OP.

Thank you for your response. Its for a block of flat. I am the facily manager and we have 3 extensions per flat for 8 flats. So i want a situation where extensions from flat 1(!XX) cannot call any other extension asides extensions within the flat. I am using 1 server for the entire building with 1 extension for the facility manager which should be accessible from all flat. So how can i achieve this.
Would Class of Service be able to provide this solution?
Thanks

How do i set up the custom dail plan.

Well that is going to require knowledge of dialplan and how FreePBX works. Now that you have actually provided more details, this is a multi-tenant setup and not something FreePBX was designed for as @arielgrin pointed out. If you don’t have the skillset for it, you may have to look at his suggestions.

I already have purchased the Freepbx. I read a few instruction from groups on how to proceed but i have few errors. "chan_sip.c:26407 handle_request_invite: Call from ‘101’ (192.166.1.154:53589) to extension ‘100’ rejected because extension not found in context ‘flat-1’)
I have set up a custom context called flat-1, flat-2,…Flat-8.
I specified the context while creating each extensions and also edited extensions_custom.config.

[flat-1]
exten => _2XX/_1XX,1,Hangup
exten => _1XX/_2XX,1,Hangup

Please where am i making a mistake? kindly point me to the right direction.

What you are trying to achieve is in fact multi-tenancy, for which FreePBX / Asterisk is not your best choice.
If you don’t know how to code for Asterisk, your next choice would be FusionPBX / FreeSWITCH.
It should be noted that even if you know how to code for Asterisk, extension segregation is not something that can be easily achieved, if at all.

He’s on a RasPian system.