FOP2 Modifications for FreePBX with BRIA module
-
There is a commercial module for FreePBX to be used with BRIA softphones that does strange things to the FreePBX configuration tables/databases, and then breaks the FOP2 manager auto configuration as it generates TWO devices for a user, without being in user^device mode.
There is a way to make the FOP2 Manager and FOP2 autoconfiguration scripts works, but requires some tweaks:
- Create a mysql trigger
- Use a customized autoconfig-buttons.sh script
For the MySQL trigger, create a file named trigger.sql with this content:
DROP TRIGGER IF EXISTS AddNines; DELIMITER $$ CREATE TRIGGER AddNines BEFORE INSERT ON fop2buttons FOR EACH ROW BEGIN IF(new.Device like '%/%' AND new.Device not like '%/999%' AND new.type='extension') then set new.`Channel` = REPLACE( new.Device, '/', '/999'); END IF; END; $$ DELIMITER ;You have to create it in MySQL with this command (you must know the MySQL root password):
[fixed]
mysql -u root -p asterisk < trigger.sql
[/fixed]The trigger will populate the channel field in the fop2buttons table with the extra device that Bria uses.
Then you must alter autoconfig-buttons.sh, look for this query:
mysql -EB -u $DBUSER $DBPASS -h $DBHOST $DBNAME -e \ "SET NAMES utf8; SELECT device AS channel,type,if(type<>'trunk',exten,'') AS extension,\ label, mailbox, context, privacy,\`group\`,IF(type='trunk',IF(email<>'',concat('splitme-',email),''),email) as email, \ channel as extrachannel, $FINAL_FIELDS FROM fop2buttons \ WHERE exclude=0 \ ORDER BY $ORDER" | sed '/\*\*/d' | sed 's/: /=/g' | sed '/.*=$/d' | while read LINEAand replace it with this one instead:
mysql -EB -u $DBUSER $DBPASS -h $DBHOST $DBNAME -e \ "SET NAMES utf8; SELECT IF(type='extension' AND channel<>'',channel,device) AS channel,type,if(type<>'trunk',exten,'') AS extension,\ label, mailbox, context, privacy,\`group\`,IF(type='trunk',IF(email<>'',concat('splitme-',email),''),email) as email, \ IF(type='extension' AND channel<>'',device,channel) as extrachannel, $FINAL_FIELDS FROM fop2buttons \ WHERE exclude=0 \ ORDER BY $ORDER" | sed '/\*\*/d' | sed 's/: /=/g' | sed '/.*=$/d' | while read LINEAFinally log into the FOP2 Manager and select the Buttons tab, and then restart the FOP2 service.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login