<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[FOP2 Modifications for FreePBX with BRIA module]]></title><description><![CDATA[<p dir="auto">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.</p>
<p dir="auto">There is a way to make the FOP2 Manager and FOP2 autoconfiguration scripts works, but requires some tweaks:</p>
<ol>
<li>Create a mysql trigger</li>
<li>Use a customized <a href="http://autoconfig-buttons.sh" rel="nofollow ugc">autoconfig-buttons.sh</a> script</li>
</ol>
<p dir="auto">For the MySQL trigger, create a file named trigger.sql with this content:</p>
<pre><code>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 ;
</code></pre>
<p dir="auto">You have to create it in MySQL with this command (you must know the MySQL root password):</p>
<p dir="auto">[fixed]<br />
mysql -u root -p asterisk &lt; trigger.sql<br />
[/fixed]</p>
<p dir="auto">The trigger will populate the channel field in the fop2buttons table with the extra device that Bria uses.</p>
<p dir="auto">Then you must alter <a href="http://autoconfig-buttons.sh" rel="nofollow ugc">autoconfig-buttons.sh</a>, look for this query:</p>
<pre><code>mysql -EB -u $DBUSER $DBPASS -h $DBHOST $DBNAME -e \
    "SET NAMES utf8; SELECT device AS channel,type,if(type&lt;&gt;'trunk',exten,'') AS extension,\
    label, mailbox, context, privacy,\`group\`,IF(type='trunk',IF(email&lt;&gt;'',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 LINEA
</code></pre>
<p dir="auto">and replace it with this one instead:</p>
<pre><code>mysql -EB -u $DBUSER $DBPASS -h $DBHOST $DBNAME -e \
    "SET NAMES utf8; SELECT IF(type='extension' AND channel&lt;&gt;'',channel,device) AS channel,type,if(type&lt;&gt;'trunk',exten,'') AS extension,\
    label, mailbox, context, privacy,\`group\`,IF(type='trunk',IF(email&lt;&gt;'',concat('splitme-',email),''),email) as email, \
    IF(type='extension' AND channel&lt;&gt;'',device,channel) as extrachannel, $FINAL_FIELDS FROM fop2buttons \
    WHERE exclude=0 \
    ORDER BY $ORDER" | sed '/\*\*/d' | sed 's/: /=/g' | sed '/.*=$/d' | while read LINEA
</code></pre>
<p dir="auto">Finally log into the FOP2 Manager and select the Buttons tab, and then restart the FOP2 service.</p>
]]></description><link>http://localhost:4567/topic/1934/fop2-modifications-for-freepbx-with-bria-module</link><generator>RSS for Node</generator><lastBuildDate>Tue, 27 Oct 2026 00:39:37 GMT</lastBuildDate><atom:link href="http://localhost:4567/topic/1934.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 17 Mar 2015 15:12:39 GMT</pubDate><ttl>60</ttl></channel></rss>