Error After Applying Latest Beta 10 module upgrades

I received the following error message when I downloaded the modules to upgrade a current FreePBX 10 installation (PBX in a Flash, Version 2.0.6.2.1, Asterisk 10.1.12)

Reload failed because retrieve_conf encountered an error: 255
click here for more info

exit: 255 not writable

Added to globals: ASTETCDIR = /etc/asteriskAdded to globals: ASTMODDIR = /usr/lib/asterisk/modulesAdded to globals: ASTVARLIBDIR = /var/lib/asteriskAdded to globals: ASTAGIDIR = /var/lib/asterisk/agi-binAdded to globals: ASTSPOOLDIR = /var/spool/asteriskAdded to globals: ASTRUNDIR = /var/run/asteriskAdded to globals: ASTLOGDIR = /var/log/asteriskAdded to globals: CWINUSEBUSY = trueAdded to globals: AMPMGRUSER = adminAdded to globals: AMPMGRPASS = amp111Added to globals: AMPDBENGINE = mysqlAdded to globals: AMPDBHOST = localhostAdded to globals: AMPDBNAME = asteriskAdded to globals: AMPDBUSER = asteriskuserAdded to globals: AMPDBPASS = amp109Added to globals: VMX_CONTEXT = from-internalAdded to globals: VMX_PRI = 1Added to globals: VMX_TIMEDEST_CONTEXT =Added to globals: VMX_TIMEDEST_EXT = dovmAdded to globals: VMX_TIMEDEST_PRI = 1Added to globals: VMX_LOOPDEST_CONTEXT =Added to globals: VMX_LOOPDEST_EXT = dovmAdded to globals: VMX_LOOPDEST_PRI = 1Added to globals: MIXMON_DIR =Added to globals: MIXMON_POST =Notice: no Queues definedNotice: no Conferences definedNotice: no iax trunks definedNotice: no AMP Users definedPHP

Fatal error: Cannot redeclare class ext_senddtmf /var/www/html/admin/modules/googlevoice/functions.inc.php on line 331 error(s) occurred, you should view the notification log on the dashboard or main screen to check for more details.

It appears to be a google voicemail module issue. Not sure who is maintaining that as it is not part of the FreePBX core team or out core modules that we support.

Looks like the google voice module declares a class, ext_senddtmf, before checking to make sure the class is not there.

This is a common mistake of module writers. They need something in extenstiones.class .php that we have not created so they declare it without checking if the class already exists or not.

The proper way to do this is to check for the class first and only declare it if it is not there. Furthermore, it’s not hard to make sure that one of the developers get’s it in extensions.class.php much earlier.

Anyhow … I believe there is a copy of that module in the contrubuted_modules directory, I’ll have a look at updating it.

Looks like there is some sort of class check in GV 0.6 module… but I could be wrong. http://www.youtube.com/watch?v=d-J8_oXmWpo

The check is apparently no longer checking against the right ‘class’. This function was described to me by Moshe and Mikael. Where as Mikael and I made it work as seen in the current file.

I will have to check this out

Here is the fix:

function googlevoice_hookGet_config($engine) {
	global $ext;	
	if (!method_exists($ext, 'ext_senddtmf') && (!class_exists('ext_senddtmf'))) {
		class ext_senddtmf extends extension {
			var $digits;
			function ext_senddtmf($digits) {
				$this->digits = $digits;
			} 
			function output() {
				return 'SendDTMF('.$this->digits.')';
			}
		}
	}
}

The code above is the approved fix.

As you can see here, my dialplan is a-ok with the above code (specifically this was an issue with the SendDTMF functionality)

[googlein]
include => googlein-custom
exten => ****@gmail.com,1,Noop(Receiving GoogleVoice call)
exten => ****@gmail.com,n,Set(CALLERID(name)=${CUT(CALLERID(name),@,1)})
exten => ****@gmail.com,n,GotoIf($["${CALLERID(name):0:2}" != "+1"]?notrim)
exten => ****@gmail.com,n,Set(CALLERID(name)=${CALLERID(name):2})
exten => ****@gmail.com,n(notrim),Set(CALLERID(number)=${CALLERID(name)})
exten => ****@gmail.com,n,Answer
exten => ****@gmail.com,n,Wait(1)
exten => ****@gmail.com,n,SendDTMF(1)
exten => ****@gmail.com,n,Goto(from-trunk,9999999999,1)

#5606 filed against the issue.

The tarball has been published out to the server.

What steps should I take to resolve this issue?

Found it. I edited /var/www/html/admin/modules/googlevoice/functions.inc.php

You guys rock!

The currently unsupported module (v0.70 - By Marcus Brown) for integration of Google Voice will not load, even with fix above still returns an error:

Reload failed because retrieve_conf encountered an error: 255

exit: 255
PHP Fatal error: Cannot redeclare class ext_gosub in /var/www/html/admin/libraries/extensions.class.php on line 471
1 error(s) occurred, you should view the notification log on the dashboard or main screen to check for more details.

Does Anyone have a solution?

Cheers…

Zeane,

That error is un-related to google voice.

The google voice module doesnt reference class ‘ext_gosub’ therefore not a google voice issue. Sorry.

Because, when I attempt to install the G Voice module (0.70), it will not allow me to proceed past the “apply config” button, returning the above error. When I uninstall the module, and “apply config” again, all is well (minus the G Voice module). Should I possibly completely re/uninstall something?

Error as shown on Dashboard

retrieve_conf failed, config not applied

Reload failed because retrieve_conf encountered an error: 255
Added 29 seconds ago
(freepbx.RCONFFAIL)

Any suggestions would be appreciated… THX

did you grab the google voice module form the contributed modules directory in our SVN tree?

here is the fix, try it

from the asterisk server,

(Invalid code editing removed)

credit for the fix goes to the forums here.

itme13,

Please don’t confuse people by making them dig through code to ‘fix’ a problem that is no longer a problem. It was fixed months ago. Both in the public freepbc svn and on the github repo.

Download is here: http://www.the159.com/googlevoice/googlevoice-0.8.0.tgz

I am removing your code edits to protect people from causing more problems.

this problem is back with v 0.9

this problem is back with v 0.9