Queue Channel StateInterface incorrect

Hi,

I'm using the latest version of everything

Fop 2.27 / FopAdmin 1.0 / FreePBX 2.11.0.38

Using the latest versions I'm having a problem with creation of the Queue Channel field. In FopAdmin/functions-freepbx.php the following code is setting the stateInterface to be USER/extension.

188 if ($conf == "deviceanduser") {
189 $fields="extension,concat('USER/',extension) AS dial, if(voicemail='novm','',concat(extension,'@',voicemail)) AS mailbox,name,IF(voicemail<>'novm',concat('$vmprefix',extension),'') AS extenvoicemail";

That causes the queue members to be invalid since it doesn't actually exist as a state interface. Changing "concat('USER/',extension) AS dial" to just "dial" fixes the problem.

I am using deviceanduser mode. If USER/ should be a stateinterface on FreePBX I may have to look into that instead. This system has been upgraded through many versions of FreePBX and may have missed something during one.

There's also a problem where it's duplicating the queue fields but I haven't tracked that one down yet. An example entry in the database(After I corrected the USER/) is below. Most fields are just duplicated but Penalty is 0 and 60. It should just be 60.

Local/8052@from-queue/n|Penalty=0|MemberName=????|StateInterface=SIP/8052&Local/8052@from-queue/n|Penalty=60|MemberName=????|StateInterface=SIP/8052|Queue=8900

Dave

Comments

  • Hi Dave,

    Do you know what does FreePBX do with state interface in device & user mode ? There is no known state interface for a user, as it might log from any device. Because the queuechannel directive is static in FOP2 (like the queue member definition in queues.conf), it is not possible to know for sure the device to use (at it will vary depending on the device or deviceS a user is logged into).

    So, do you know what does FreePBX do with that field when adding members? Having USER/xxxx as a state interface is not a valid asterisk configuration (the USER abstraction is exclusive for FOP2, so that is clearly a bug in fop2manager, but the fix would be to leave the state interface empty as of now, as it is done with custom or virtual extensions).

    Regarding the duplication, if you look closely, they are not duplicated, you have a global setting for queue membrers, and you might have individual queue settings with different parameters. In your example, queue 8900 has a 60 penalty, and the other value is the global one for all the other queues.

    For fixing the USER/xxx state interface, look at functions-freepbx.php , on line 539 and change this:
    if(substr($device,0,6)=="VIRTUA" || substr($device,0,6)=="CUSTOM") {
    

    to this:
    if(substr($device,0,6)=="VIRTUA" || substr($device,0,6)=="CUSTOM" || substr($device,0,5)=="USER") {
    
  • Ah! I now see the & in the field list. That explains everything!

    As for the StateInterface the only things that are usable in FreePBX are devices that I'm aware of. I changed line 189 since in my setup it works to match the device to the user by default. If a user logs into a different device you'll have to grab the stateinterface for that user when you see the login event in AMI. Does the fop2_server do that currently? If so I can revert my change and take yours which will set the stateinterface to nothing and let the fop2_server assign the stateinterface at runtime.
  • Changing the queuechannel setting based on ami events is not done by default, but a plugin could be written to intercept the events for when a user logs in and change the queuechannel in the fop2 configuration on the fly. Do you know if the FreePBX .agi that fires the user event is fixed on newer releases? (it's been broken for ages, since asterisk 1.8 came out).

    In user&device mode in FreePBX an extension can log from sip phone A and sip phone B, and when that extension is rang, both A and B will be dialed, but we cannot have more than one device for the state interface. What state interface is good in that case? If a plugin is written, only the last login event would modify the state interface in the queue configuration.
  • Hi,

    This seems to be the proper way to monitor a queue member attached to multiple devices.

    https://issues.asterisk.org/jira/browse/ASTERISK-14178

    I change the QueueChannel to the following

    Local/8008@from-queue/n|Penalty=0|MemberName=Dave C|HINT:8008@ext-local

    and it appears to work as intended. My agent is still valid and I can answer calls.

    I have done VERY limited testing. I have to setup a few extensions and test queues and I haven't had very much free time lately. If I can manage to test it more thoroughly I'll report back.

    Dave
  • Hi

    Almost forgot. You also have to set the following to true in FreePBX advanced settings.

    Asterisk Queues Patch 15168 Installed

    Athought I'm not sure if that is required if FreePBX detects a version of Asterisk which should have the patch included. This may just be for people who have custom built asterisk with the patch.

    Dave
  • Thanks Dave for your feedback! It is very much appreciated. If the HINT is standard in FreePBX then I will update the manager to use that syntax for user&device mode. Please let me know how your testing goes.

    Best regards,
  • Not trying to resurrect a very old thread, but is there a way to force FOP2 to use state_interface hint:XXX@ext-local when adding members to queues? right now on fpbx v14 with a pjsip extension, it's adding as state_interface PJSIP/XXX

Sign In or Register to comment.