Installation hosed after trying to create an extension

Hi!

As a test I tried to create a PJSIP extension (I normally use Chan_SIPā€¦) on my PBX and when I submitted the web interface stopped workingā€¦

I tried to restart the machine and now nothing worksā€¦

The web interface tells me ā€œCan Not Connect to Asteriskā€ and many entries are greyed out including, unfortunately, Extensions and more importantly ā€œBackup & Restoreā€ (very useful, how am I supposed to restore now?").

It was also complaining about retrieve_conf not returning data or something. I believe someone else had a similar problem in a thread I posted to recently and there was a module update so I updated my packagesā€¦

Now I get an exception at line 11 which apparently means that asman is not connectedā€¦

Is there a way to manually start it to see where it complains and, failing that, a way to restore from a backup even if the web interace greyed out the entry?

By the way, I am running FreePBX 13.0.190.12.

Thank you and have a nice day!

Nick

PS: That test entry I created was actually to help someone hereā€¦ :unamused:

I found the syntax to restore from the command line but it throws an exception telling my that ā€œAsterisk is not connectedā€ā€¦

I reallllly didnā€™t need thatā€¦

Bonjour Nick:

Is Asterisk running? If not can you restart or does it fail to start? You can start Asterisk with verbose flags with:

sudo -u asterisk asterisk -cvvv

Perhaps you will get a clue if it throws some errors as the startup fails. My guess is that there is something in one of the pjsip conf files that Asterisk doesnā€™t like, but I donā€™t know how that would be possible. For what itā€™s worth, I use pjsip on most of my systems without ever having seen this happen.

1 Like

:wink:

Bonjour Lorne!

I tried to restart it multiple times and it seemed to start but I did not actually check if that was trueā€¦ It complained a lot each time I tried to shutdown about things such as zulu, ucpnode, etcā€¦

I ran ā€œasterisk -cvvvā€ as you suggested and there were a few ā€œerrorsā€ (like a missing calendar.conf) but the most interesting entries were these ones:

 Loading pbx_lua.so.
[2017-01-26 21:35:25] ERROR[5542]: pbx_lua.c:1635 load_or_reload_lua_stuff: Error loading extensions.lua: cannot open '/etc/asterisk/extensions.lua' for reading: No such file or directory
 Loading res_pjsip_endpoint_identifier_dpma.so.
  == Parsing '/etc/asterisk/res_digium_phone.conf': Found
  == Parsing '/etc/asterisk/res_digium_phone_general.conf': Found
  == Parsing '/etc/asterisk/res_digium_phone_devices.conf': Found
  == Parsing '/etc/asterisk/res_digium_phone_applications.conf': Found
  == Parsing '/etc/asterisk/res_digium_phone_additional.conf': Found
  == Parsing '/etc/asterisk/res_digium_phone_firmware.conf': Found
asterisk: symbol lookup error: /usr/lib64/asterisk/modules/res_pjsip_endpoint_identifier_dpma.so: undefined symbol: dpma_register_config_handler

The LUA stuff i will have to check what it is about but, as you suggested, there is clearly some wrong with PJSIPā€¦

asterisk: symbol lookup error: /usr/lib64/asterisk/modules/res_pjsip_endpoint_identifier_dpma.so: undefined symbol: dpma_register_config_handler

To me this sounded like that specific module didnā€™t match the Asterisk currently installedā€¦ I checked the date and it was indeed not compiled on the same dateā€¦

The others were compiled on the 16th on December, this one on the 3rd of Novemberā€¦

DPMA, isnā€™t that the Digium phone stuff (which as far as I remember I did remove ages agoā€¦)?

I moved the module out of the way and now FreePBX does see Asterisk runningā€¦

For some reason something got messed up in my modules when I tried to deinstall or update them but I am fixing this right nowā€¦

I did issue a ā€œyum updateā€ and I am up to dateā€¦

It seems this was a module which was distributed in the past but no longer seems to beā€¦ As soon as I created a PJSIP extension its presence made all hell break loseā€¦

Thank you very much for your help Lorne! Things are really looking up nowā€¦

Take care and have a nice day!

Nick

1 Like

Hi!

Looks like I am not out of the woods yet and this time it seems to be because of the restore I did.

(i did /var/lib/asterisk/bin/restore.php --restore=/var/spool/asterisk/backup/Full_backup/20170126-000001-1485406801-13.0.190.12-397423084.tgz --items=all , I hope that was the right syntaxā€¦)

Now when I try to edit my trunks (I did not try anything else, maybe the same thing would happen) I get:

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ā€˜tr-peer-2-accountā€™ for key ā€˜PRIMARYā€™

INSERT INTO sip (id, keyword, data, flags) values (ā€˜tr-peer-2ā€™,?,?,ā€˜0ā€™)::
/var/www/html/admin/libraries/utility.functions.php

	if(is_object($extended_text) && method_exists($extended_text,"getMessage")) {
		$e = $extended_text;
		$extended_text = htmlentities($e->getMessage());
		$code = $e->getCode();
		throw new \Exception($text . "::" . $extended_text,$code,$e);
	} else {
		$extended_text = htmlentities($extended_text);
		throw new \Exception($text . "::" . $extended_text);

tr-peer-2 is indeed there but it looks like it forgot it belongs to that trunkā€¦

Things are not perfect but it looks like they are at least functioning well enough for now so I will restore the database one more time and try to fix this on the weekendā€¦

Have a nice day!

Nick

This is not related to your Asterisk issues or your restore. This is a bug in the edge version of the core module:
http://issues.freepbx.org/browse/FREEPBX-14015

We should see a fix published shortly to edge, but if necessary, you can roll back Core to 13.0.117.3.

1 Like

Hi Lorne!

Thank you very much! I will test it as soon as I can (looks like it will have to be tomorrow)ā€¦

Do you think I should create a ticket about that mismatched and possibly deprecated module which had not been erased? Was it just something that went wrong only for me or is there a possibility others might be affected?

Thank you very much and have a nice day!

Nick

Things seems to have went back to normal after I applied the latest module updatesā€¦

Thank you very much for your help Lorne!

Nick

1 Like

The same problem happened again todayā€¦

I had recently updated the asterisk packages using yum and the server was rebooted today and had the exact same problemā€¦

I donā€™t quite understand why that mismatched module was installed againā€¦

Have a nice day!

Nick

Hi!

I found the source of my problemsā€¦

It looks like I might, a long time ago, excluded res_digium_phone.so from loading. I assume I did that to stop having those annoying No Valid DPMA License found error messagesā€¦

It worked well for quite a while until recently when res_pjsip_endpoint_identifier_dpma.so started complaining about an undefined symbol, dpma_register_config_handler and crashing Asterisk.

This was most likely provided by res_digium_phone.so and since it was no longer loading that dependency was no longer metā€¦

Removing res_digium_phone.so from the exclusions fixed the problem without having to move/delete/exclude res_pjsip_endpoint_identifier_dpma.so.

I will definitely think twice about excluding a module from now onā€¦

Have a nice day!

Nick

1 Like