Open Source Training Seminar


Not Logged in - No Account?

Don't have an account? Registering an account with us allows you to post to the forums, easily track new posts, subscribe to threads, pm (private message) other forum members, and receive periodic news letters (you can opt out if you desire). Once you are logged in this message will no longer appear. If you don't have an account, you can create one by registering here. Lost your password, request a new password. We respect your privacy which means we collect minimal information when you register and we do not resell that information or use it in any objectionable way. You can review our privacy policy for full details.


Custom Contexts broken in FreePBX 2.3.1.3

jscoulter's picture

Hi All.
I am using FreePBX 2.3.1.3 which is in the latest Trixbox update I have just freshly installed.
I installed custom contexts as per the instructions on http://freepbx.org/support/documentation/module-documentation/third-part...

When I installed the module thu the module admin, this all goes ok, but then when I add a custom context, submit it then click "apply changes" I get the following error. Has anyone else had this error? is there a fix? I see from the tricBox forum that atleast one other who has updated to Trixbox 2.4 also has this error.
Thanks, Jeremy

exit: 1

Checking for PEAR DB..OK
Checking for PEAR Console::Getopt..OK
Checking for /etc/amportal.conf ..OK
Bootstrapping /etc/amportal.conf ..OK
Parsing /etc/amportal.conf ..OK
Parsing /etc/asterisk/asterisk.conf ..OK
Connecting to database..OK
Connecting to Asterisk manager interface..OK
Added to globals: ASTETCDIR = /etc/asterisk
Added to globals: ASTMODDIR = /usr/lib/asterisk/modules
Added to globals: ASTVARLIBDIR = /var/lib/asterisk
Added to globals: ASTAGIDIR = /var/lib/asterisk/agi-bin
Added to globals: ASTSPOOLDIR = /var/spool/asterisk
Added to globals: ASTRUNDIR = /var/run/asterisk
Added to globals: ASTLOGDIR = /var/log/asterisk
Added to globals: CWINUSEBUSY = true
Added to globals: AMPMGRUSER = admin
Added to globals: AMPMGRPASS = amp111

Warning: array_keys(): The first argument should be an array in /var/www/html/admin/extensions.class.php on line 189

Warning: Invalid argument supplied for foreach() in /var/www/html/admin/extensions.class.php on line 189
Please update your modules and reload Asterisk by browsing to your server.

1 error(s) occured, you should view the notification log on the dashboard or main screen to check for more details.


__________________


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

fix for customcontexts error on reload

naftali5's picture

there are a few other bugs, but this one crashes.
I must point out that I have not had time to upgrade the module properly, so as before - use at your own risk.
with that said...

the following line
						$sql = "INSERT INTO customcontexts_includes_list (context, include, description, sort) VALUES ('$section', '$include', '$include', $i)";
should be replaced with
						$sql = "INSERT IGNORE INTO customcontexts_includes_list (context, include, description, sort) VALUES ('$section', '$include', '$include', $i)";
in 
/var/www/html/admin/modules/customcontexts/functions.inc.php line 53 of 1411

naftali5, the module is in

p_lindheimer's picture

naftali5,
the module is in the contributed_modules directory on svn. (Which of course you have access to since you have dev access, plus I always give contributors access when modules get put there). You may want to go and update it, there is a publish script right there which you can use to build the tarball and all.
philippe


__________________

Philippe Lindheimer - FreePBX Project Leader
FreePBX Training Opportunities - Click Here
Get Official Paid Support - Click Here


YAY !!! well that SQL

jscoulter's picture

YAY !!! well that SQL script DID fix part of the problem, i.e. I can now save changes again :-)
Philippe, or anyone else for that matter, do you have a URL or something for the svn where I can get the script etc. you mention?

Thanks, Jeremy


there is a

p_lindheimer's picture

there is a "contributed_modules" directory that is at the same level as "modules" and "freepbx" just browse over on the dev site into the repo and you should see it.


__________________

Philippe Lindheimer - FreePBX Project Leader
FreePBX Training Opportunities - Click Here
Get Official Paid Support - Click Here


am I in the right

jscoulter's picture

am I in the right place??

http://freepbx.org/trac/browser/contributed_modules/modules/customcontex...

Just that I noticed that the files are 4mths old and when I check line 53 as above, its still the same as the old one.

Sorry :-)

Jeremy


yes you are in the right

p_lindheimer's picture

yes you are in the right place. The "contributed_modules" repository are not maintained by the FreePBX team, they are put there as a service for those who want access to them. Until a module is adopted into the main stream release they will only be maintained to the extent that the original contributor chooses to do such, or if someone else wants to volunteer to do some work on them and contacts us about it. I created that repository and moved the module there originally as it had previously been nothing more than a tarball attached to a ticket.


__________________

Philippe Lindheimer - FreePBX Project Leader
FreePBX Training Opportunities - Click Here
Get Official Paid Support - Click Here


oh I see....I miss

jscoulter's picture

oh I see....I miss inturprited what you meant.....I thought the FIX was in this section :-)
I still get an error displayed at the top of my page "Warning: Invalid argument supplied for foreach() in /var/www/html/admin/modules/customcontexts/functions.inc.php on line 590" when I enter the custom contexts page, but if I ignore that, it still seems to work.

Jeremy


Ok, had a look at line 590,

jscoulter's picture

Ok, had a look at line 590, and figured the array being passed might be empty, so I have changed the code below, and it seems to solve the issue. Not sure what the flow on affect would be :-

(at line 590)

foreach ($timegroups as $val)
{
$currentcomponent->addoptlistitem('includeyn', $val[0], $val[1]);
}

To

if (!empty($timegroups))
{
foreach ($timegroups as $val)
{
$currentcomponent->addoptlistitem('includeyn', $val[0], $val[1]);
}
}


Trunk Issue

hardocp's picture

I followed all of the instruction listed above and my custom context module appears to now be installed property and does not show any error

If naftali is too busy to

p_lindheimer's picture

If naftali is too busy to maintain it in the contributed repository and someone out there feels comfortable enough to help out I'd be glad to give you svn write access to the contributed repository to do such.


__________________

Philippe Lindheimer - FreePBX Project Leader
FreePBX Training Opportunities - Click Here
Get Official Paid Support - Click Here


Line 405

cell's picture

When editing an extension, at bottom apears Warning: Invalid argument supplied for foreach() ... at line 405. I make a change like for line 590 (added an if for empty), and now working the warning does not appear...


This would be near and dear

IcelandDreams's picture

This would be near and dear to me as well (tieing * with a legacy system). Over at trixbox it wasn't clear if this was an issue with freepbx or * 1.4. Before I get confused and lost I'm going to try the fixes seen here. I think this would be very useful to many and hope to see it as a core function or module.


this is not planned as

p_lindheimer's picture

this is not planned as standard because the way trunking/routing is going to be ripped out and replaced will completely break this module and the work involved to seamlessly move people to the new design, in addition to the fact that it may not be possible to completely migrate what they were doing, is not something that we are willing to invest in. As you can see, the current author has not had the resourced to even maintain this for the few issues that have come up here...


__________________

Philippe Lindheimer - FreePBX Project Leader
FreePBX Training Opportunities - Click Here
Get Official Paid Support - Click Here


ok thanks. Does the

IcelandDreams's picture

ok thanks. Does the functionality of controlling outbound trunks per extension as is often asked sound like something that could get into the new design? Not as an unmaintained module (thanks to the author anyway) like it is but as a core function for at least this feature? I'm trying to come up with a way to have SIP extensions get to the legacy via a specific FXO line so that the lego extension knows who is calling (lego won't pass the * extension and only sees the line it came in on).

And thanks again for your help these last weeks. I'm online and functional with only a few kinks left to beat down.

edit-> you said it wouldn't be standard, sorry.


yes - dial context will have

p_lindheimer's picture

yes - dial context will have abilities such as creating different route arrangements for different dial contexts.


__________________

Philippe Lindheimer - FreePBX Project Leader
FreePBX Training Opportunities - Click Here
Get Official Paid Support - Click Here


excellent... Thanks, I know

IcelandDreams's picture

excellent... Thanks, I know a lot of people will be very thankful for that one.
Now if I can get my local Bell and friends to bring back ISDN I'll be a happy camper...


r5617, r5618 - I bumped it

p_lindheimer's picture

r5617, r5618 - I bumped it up to 0.3.4 with the above suggested fix


__________________

Philippe Lindheimer - FreePBX Project Leader
FreePBX Training Opportunities - Click Here
Get Official Paid Support - Click Here


But what about jscoulter

cell's picture

But what about jscoulter fix, of the 590 line?


how about someone step up to

p_lindheimer's picture

how about someone step up to the plate and volunteer to maintain the module, as it seems like there is a small following.

There are plenty of other places in that code from the few minutes I looked at it that have similar bugs in them to line 590. The module is not in the main repository for a variety of reasons so it is not maintained by our development 'staff' of volunteers. However, being in the contributed modules directory, we are happy to give a reasonably responsible person write access to that area so that they can maintain this or other contributed modules located there.


__________________

Philippe Lindheimer - FreePBX Project Leader
FreePBX Training Opportunities - Click Here
Get Official Paid Support - Click Here


Happy to "Step Up to the Plate"

voipclear's picture

Hi,

I'm not a big hitter when it comes to writing code. But I'm more than an adequate pinch hitter and will be happy to step up to the plate.
Analogies aside, I'm saying that I'd like to volunteer to maintain the code for this contributed module, and perhaps other ones as well.

- Ethan Lee


Sorry for not replying

jscoulter's picture

Sorry for not replying earlier, It seems I didnt subscribe to this when I originalyl posted, so I am not getting emaisl to say anthing has been going one.

yes my fix was "hey thats not right, ah that fixes it" and as pointed out there are a few places that may also need to be sorted.
I am keen to contribute, but I am under a few time constraints at the moment on other projects as we are adding new functionality to some new software.
I will see what I can do over the next week or so.

Jeremy


pm or email me and we can

p_lindheimer's picture

pm or email me and we can make arrangements


__________________

Philippe Lindheimer - FreePBX Project Leader
FreePBX Training Opportunities - Click Here
Get Official Paid Support - Click Here


Any progress? I'm asking

cell's picture

Any progress? I'm asking because on FreePbx 2.4 they won't work :(

Added: Ok, i make some suplementary test and it work, but in "Extension" section i have to add the context manually, the drop-down menu show only "ALLOW ALL" context.


Me too

exile183's picture

I've just installed CustomContexts - first 0.3.3, then later 0.3.4, on my FreePBX 2.3.1.0

I can define custom contexts. When I go to EXTENSIONS and choose an extension from the dropdown list, and submit the change, and then click on the orange (formerly red) bar, the changes are *NOT* saved. By default, each extension has *NO* Custom Context defined, not even the "DEFAULT" setting. The whole thing is therefore not working because it simply won't let me set a Custom Context on any extension.

Help?


Whoops!

exile183's picture

Please disregard my last comment - looks like moving from 0.3.3 to 0.3.4 *DID* fix the problem, it just didn't do it in an obvious fashion - ie: each time I click on a particular extension, the "Custom Context" field defaults to blank, but when I choose one of the contexts, and then submit it, it *DOES* update the context properly. All is working perfectly - thanks to the author for an AWESOME module! :-)


Same issue with 0.3.4 than with 0.3.3

dlogiudice's picture

with version 0.3.3 and version 0.3.4 I can't save the extension's custom context..., it doesn't retain the setting.
The only thing that it's making me doubt it's if this module work mandatorely with authtype = database , because I have it set to authtype = none...
could someone let me know if this is necesary??
thank you!


Has anyone the problem with

cell's picture

Has anyone the problem with the directPickup (function **) with the FreePBX 2.4 + CustomContexts? I make changes described in the ticket 2510 , it work, but just for incoming external calls. For internal calls they not work at all.


Where is the information on dial context

marioja's picture

Philip,

Can you point to a place/link that talks about dial context and say:

what it is
what it will do
when it will come out

Thanks, much appreciated.


Yes what is dial context ?

orenyny's picture

Please advise as requested above.

Thanks.


you see the message 4

fskrotzki's picture

you see the message 4 up?

Notice that the word CustomContexts is a link? Click on it. It takes you to all kinds of information... Also if you search this site you'll find plenty of information.