Author Topic: Subqueues - Setting URL on a Queue() in FreePBX - Patch  (Read 9766 times)

barryf

  • Jr. Member
  • **
  • Posts: 62
  • Karma: 4
    • View Profile
Subqueues - Setting URL on a Queue() in FreePBX - Patch
« on: February 10, 2010, 15:00:46 »
Hi,

Just to let you know, I have created a patch against FreePBX 2.6 which allows the setting of the URL parameter to queues form within FreePBX. I have submitted this to the FreePBX trac as a patch today (Ticket #4035 http://www.freepbx.org/trac/ticket/4035). No idea whether they will include it, but if anyone else here would like to see it then perhaps drop them a note to that effect.

With this patch you can use QM subqueues seemlessly with FreePBX. I set the optionalurl to ${FROM_DID} which creates subqueues for each incoming number pointwed at the queue.

-Barry

QueueMetrics

  • Loway
  • Hero Member
  • *
  • Posts: 2999
  • Karma: 39
    • View Profile
    • QueueMetrics
Re: Subqueues - Setting URL on a Queue() in FreePBX - Patch
« Reply #1 on: February 11, 2010, 10:32:42 »
That's great! Good job man!

nellyb

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
    • View Profile
    • Email
Re: Subqueues - Setting URL on a Queue() in FreePBX - Patch
« Reply #2 on: October 12, 2011, 14:39:01 »
Hi Barry, many thanks for this - we're in a similar situtation with QM and Asterisk and want to use the optionalurl feature.

I have taken the diff files and applied them to my install of Asterisk and am having a problem - I can add/del and edit the queues and the optionalurl field is processed properly.  It even writes it to the field in mysql.

However, when I apply the settings to the PBX it is not written to the asterisk conf files - is there anything else I should be doing?

Many thnks,

Neil Tancock

barryf

  • Jr. Member
  • **
  • Posts: 62
  • Karma: 4
    • View Profile
Re: Subqueues - Setting URL on a Queue() in FreePBX - Patch
« Reply #3 on: October 12, 2011, 14:47:13 »
Hi Neil,

Are you sure you applied all the patches and they applied correctly? search the functions.inc.php file and ensure that the optionalurl lines appear in there. It is here that is responsible for writing out to the conf files.

Also, this was made against FPBX 2.6 I am not sure if it will work with a later version.

Hope this helps.

-Barry


nellyb

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
    • View Profile
    • Email
Re: Subqueues - Setting URL on a Queue() in FreePBX - Patch
« Reply #4 on: October 12, 2011, 15:29:05 »
Hi Barry, many thanks for the reply.

I wasn't able to use patch to apply the your diff files as the versions of my php files were newer.  I applied it manually so it could be a case of fat fingers.    I'll double-check it.

So the php files write to mysql and the conf files?

Neil

barryf

  • Jr. Member
  • **
  • Posts: 62
  • Karma: 4
    • View Profile
Re: Subqueues - Setting URL on a Queue() in FreePBX - Patch
« Reply #5 on: October 12, 2011, 15:35:23 »
Hi Barry, many thanks for the reply.

I wasn't able to use patch to apply the your diff files as the versions of my php files were newer.  I applied it manually so it could be a case of fat fingers.    I'll double-check it.

So the php files write to mysql and the conf files?

Neil

The patches do three things:

1. change the page.queues.php file which creates the input box in the GUI
2. changes the queues_config.sql to add the optionalurl field into the queues_config database table
3. changes the function.inc.php so that it reads the optionalurl value from the database, and writes it out to the config file along with the rest of the queue settings.

-Barry

nellyb

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
    • View Profile
    • Email
Re: Subqueues - Setting URL on a Queue() in FreePBX - Patch
« Reply #6 on: October 12, 2011, 15:46:55 »
ah-hah!  that's what i'm missing - i can't find the file that relates to queues_config.sql

in version 2.6, was the filename queues_config.sql?

Neio

barryf

  • Jr. Member
  • **
  • Posts: 62
  • Karma: 4
    • View Profile
Re: Subqueues - Setting URL on a Queue() in FreePBX - Patch
« Reply #7 on: October 12, 2011, 15:53:50 »
ah-hah!  that's what i'm missing - i can't find the file that relates to queues_config.sql

in version 2.6, was the filename queues_config.sql?

Neio

That is just the name of the file used to initially create the queues module's database on installation. all you need to do is to add a new field names optionalurl to the queues_config table in your database.

The SQL to do this directly would be

ALTER TABLE  `queues_config` ADD  `optionalurl` VARCHAR( 32 ) NULL DEFAULT NULL

-Barry

nellyb

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
    • View Profile
    • Email
Re: Subqueues - Setting URL on a Queue() in FreePBX - Patch
« Reply #8 on: October 12, 2011, 16:27:34 »
OK, thanks for that Barry.

In the functions.include.php file I have more fields than this earlier version.  For example:

function queues_add($account,$name,$password,$prefix,$goto,$agentannounce_id,$members,$joinannounce_id,$maxwait,$alertinfo='',$cwignore='0',$qregex='',$queuewait='0', $use_queue_context='0', $dynmembers = '', $dynmemberonly = 'no', $togglehint = '0') {

I'd inserted the new bit of code after $use_queue_context='0' - is this right?  Or should it be at the end?

function queues_add($account,$name,$password,$prefix,$goto,$agentannounce_id,$members,$joinannounce_id,$maxwait,$alertinfo='',$cwignore='0',$qregex='',$queuewait='0', $use_queue_context='0', $optionalurl=' ', $dynmembers = '', $dynmemberonly = 'no', $togglehint = '0') {

Neil

barryf

  • Jr. Member
  • **
  • Posts: 62
  • Karma: 4
    • View Profile
Re: Subqueues - Setting URL on a Queue() in FreePBX - Patch
« Reply #9 on: October 12, 2011, 17:04:19 »
Give it a go and see!

As I said, I am still on 2.6 so have not seen the new version's files, nor looked at porting the changes across.

-Barry

nellyb

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
    • View Profile
    • Email
Re: Subqueues - Setting URL on a Queue() in FreePBX - Patch
« Reply #10 on: October 12, 2011, 17:22:20 »
Oh I'm going and seeing! :-)

Same again - it populates the GUI and MySQL database fine but doesn't write it to the conf file.

I hate to continue being a pain, but do you have a copy of the functions.inc.php and page.queues.php from your 2.6 system you sould send to me?

Neil

barryf

  • Jr. Member
  • **
  • Posts: 62
  • Karma: 4
    • View Profile
Re: Subqueues - Setting URL on a Queue() in FreePBX - Patch
« Reply #11 on: October 12, 2011, 17:56:03 »
Oh I'm going and seeing! :-)

Same again - it populates the GUI and MySQL database fine but doesn't write it to the conf file.

I hate to continue being a pain, but do you have a copy of the functions.inc.php and page.queues.php from your 2.6 system you sould send to me?

Neil

So, in the database, you have a field called optionalurl ,and this field is populated?

I can't see where to attach a file here, so I put the files at http://barry.flanagan.ie/dl/optionalurl.zip

I also included the file modules/framework/htdocs/admin/extensions.class.php as this is the only other file which mentions optionalurl, although I did not change it on my installation.

Hope this helps.

What version are you using, 2.9?

-Barry