Checkdir opens multiple popups for the same event

  1. 4 years ago

    Re: ticket #194 - Checkdir opens multiple popups

    We use checkdir to open a custom popup to find the caller id in our own database for external incoming calls. It works great except that it sometimes opens multiple popup windows. Some people have received 3 popups for the same phone call.

    My suspicion is that it is because more than 1 person is logging into the same extension. We have some users whose phones are not in our main ring group so their phone does not ring for outside calls. But they want to see the popups for who is calling. So as many as 4 people might login to the login for the main reception phone. Only people logged into that reception phone login are getting multiple popups.

    I have modified checkdir.php, but not other code. I added all ALLVAR variables to the url and all popups are caused by the RINGING event. I added a return 0; line to block further notifications.

    Still some users get 3 popups from the RINGING event.

    Thanks for your help

  2. I believe your suspicion is correct. If you have 3 browsers logged into the same extension, all 3 browsers will get 3 popups when the phone rings. I can't think of a workaround for seeing popups, but they can see who's calling or in queue without a popup by making a FOP2 login without an extension but allowing them to see what caller IDs are waiting in the queue.

    A little PHP page with fast refresh and some tweaks in checkdir would allow you to essentially echo all the popup info from every call to a web page non-agents could monitor.

  3. Thanks for the reply.

    We have not seen a popup for every browser logged in. Some users (logged in to reception) get a single popup while others get 3 for the same call. It might have something to do with the order of login or the order of receiving the event - the person seeing this most often tends to leave his browser open continuously including overnight while all others shutdown every night, so he would generally be the earliest login.

    I'll look into your suggestion about a separate fop login. If I could create single user logins just for monitoring and somehow tie it to the main ring group (so checkdir receives those events) that might solve it without the separate php page doing polling.

    Any tips?

  4. I don't know of any way, without some php mods, to see actual popups without being logged into the queue, but the default information from the popup is in the queue widget, and there is a wealth of info in the full wallboard. You don't have to be logged into a queue to either of those. Just make a user/group/template that is allowed to see them.

  5. Hi Jerry,

    Thanks for the reply. For now we had a phone at an admin desk rarely used, so I put that phone in the main ring group and I'm having the person seeing this most often login to FOP using that extension. No one else is aware of that extension, so it should never get multiple logins and we'll see what happens.

    Today that user did report getting 3 popups when logged into a different extension, so I have not totally confirmed that the duplicate popups are caused by multiple logins to same extension.

    Clarifying something in your last response, my purpose was not to "see actual popups without being logged into the queue". My idea was to setup a virtual extension that WAS in the main queue/ring group, but had no phone connected, hoping that would generate the RINGING event without having to setup a physical phone on that extension. But my first try at this did not work, apparently because no RINGING event was generated for the virtual extension with no phone.

    Another idea is to use an old LinkSys SIP to analog phone device with two ports on a desk, assign it two extensions and put the two extensions into the main queue/ring group. Then 2 more users can use those extensions as a login for the sole purpose to see popups.

    But all that is only worth it if the multiple popups are caused by multiple logins to the same extension, so we'll see what happens with my problem user using a new, more hidden login.

    Phil

  6. Unfortunately, my user got 2 popups using a logon/extension that no one else uses, so something else is going on here (perhaps in addition to multiple logins to same extension).

    Here is the key section with my modifications to checkdir.php. I stripped comments and am only showing the ringing section. The url for duplicate popups indicates all popups are caused by the ringing event. count_digits is my simple function (not shown).

    if($ALLVAR['poptype']=="ringing") {

    $exten = $ALLVAR['exten'];

    $clidname = base64_decode($ALLVAR['clidname']);
    $clidnum = base64_decode($ALLVAR['clidnum']);

    while (substr($clidnum,0,1)=='0')
    $clidnum=substr($clidnum,1); // strip leading 0's
    $clidlen=count_digits($clidnum);
    if ($clidlen>=7)
    {
    if (substr($clidname,0,1)==">")
    $clidname=substr($clidname,1); // strip leading > indicating call came from queue

    $url="http://192.168.254.7/lookup_precheck.php";
    $del="?";
    foreach ($ALLVAR AS $var => $val)
    {
    if ($var=="clidname")
    $url.=$del."clidname=".$clidname;
    elseif ($var=="clidnum")
    $url.=$del."clid=".$clidnum;
    else
    $url.=$del.$var."=".$val;
    $del="&";
    }
    $url.="&remote_addr=".$_SERVER['REMOTE_ADDR'];

    header("Content-type: text/javascript");
    return 0; // Block normal notifications when we open our own popup
    }

    Anyone see anything odd here?

    Thanks

  7. Edited 4 years ago by sln123

    More info... This user is connecting over VPN. I am using the lookup_precheck.php page from the url to log all notifications including the full query string for debugging and possibly as a way to detect and filter duplicates. Here are all log rows for this user with customer phones Xed out using letter strings to still show duplicates:

    +------------+-------+----------+---------------------+------------------------------------------------------------------------------------------+ | clid | exten | uniqueid | ts | qstr | +------------+-------+----------+---------------------+------------------------------------------------------------------------------------------+ | AAAAAAAAAA | 226 | 0 | 2019-08-13 07:43:16 | poptype=ringing&clid=AAAAAAAAAA&clidname=&exten=226&remote_addr=192.168.254.116 | | AAAAAAAAAA | 226 | 0 | 2019-08-13 07:43:16 | poptype=ringing&clid=AAAAAAAAAA&clidname=&exten=226&remote_addr=192.168.254.116 | | BBBBBBBBBB | 226 | 0 | 2019-08-13 08:01:43 | poptype=ringing&clid=BBBBBBBBBB&clidname=&exten=226&remote_addr=192.168.254.116 | | BBBBBBBBBB | 226 | 0 | 2019-08-13 08:01:43 | poptype=ringing&clid=BBBBBBBBBB&clidname=&exten=226&remote_addr=192.168.254.116 | | CCCCCCCCCC | 226 | 0 | 2019-08-13 09:29:11 | poptype=ringing&clid=CCCCCCCCCC&clidname=105&exten=226&remote_addr=192.168.254.116 | | CCCCCCCCCC | 226 | 0 | 2019-08-13 09:29:11 | poptype=ringing&clid=CCCCCCCCCC&clidname=105&exten=226&remote_addr=192.168.254.116 | | DDDDDDDDDD | 226 | 0 | 2019-08-13 09:57:05 | poptype=ringing&clid=DDDDDDDDDD&clidname=&exten=226&remote_addr=192.168.254.116 | | DDDDDDDDDD | 226 | 0 | 2019-08-13 09:57:05 | poptype=ringing&clid=DDDDDDDDDD&clidname=&exten=226&remote_addr=192.168.254.116 | | EEEEEEEEEE | 226 | 0 | 2019-08-13 10:07:41 | poptype=ringing&clid=EEEEEEEEEE&clidname=&exten=226&remote_addr=192.168.254.116 | | EEEEEEEEEE | 226 | 0 | 2019-08-13 10:07:41 | poptype=ringing&clid=EEEEEEEEEE&clidname=&exten=226&remote_addr=192.168.254.116 | | FFFFFFFFFF | 226 | 0 | 2019-08-13 10:17:40 | poptype=ringing&clid=FFFFFFFFFF&clidname=&exten=226&remote_addr=192.168.254.116 | | FFFFFFFFFF | 226 | 0 | 2019-08-13 10:17:40 | poptype=ringing&clid=FFFFFFFFFF&clidname=&exten=226&remote_addr=192.168.254.116 | | GGGGGGGGGG | 226 | 0 | 2019-08-13 10:20:07 | poptype=ringing&clid=GGGGGGGGGG&clidname=XXXXXXXXX&exten=226&remote_addr=192.168.254.116 | | GGGGGGGGGG | 226 | 0 | 2019-08-13 10:20:07 | poptype=ringing&clid=GGGGGGGGGG&clidname=XXXXXXXXX&exten=226&remote_addr=192.168.254.116 | | HHHHHHHHHH | 226 | 0 | 2019-08-13 10:29:34 | poptype=ringing&clid=HHHHHHHHHH&clidname=&exten=226&remote_addr=192.168.254.116 | | HHHHHHHHHH | 226 | 0 | 2019-08-13 10:29:34 | poptype=ringing&clid=HHHHHHHHHH&clidname=&exten=226&remote_addr=192.168.254.116 | | IIIIIIIIII | 226 | 0 | 2019-08-13 11:08:12 | poptype=ringing&clid=IIIIIIIIII&clidname=&exten=226&remote_addr=192.168.254.116 | | IIIIIIIIII | 226 | 0 | 2019-08-13 11:08:12 | poptype=ringing&clid=IIIIIIIIII&clidname=&exten=226&remote_addr=192.168.254.116 | +------------+-------+----------+---------------------+------------------------------------------------------------------------------------------+

    This log shows 18 popups for 9 phone calls, so consistent duplicate popups. Also note all were from the same IP address (browser) so not multiple logins.

  8. Oh and FOP2 version 2.31.22, Asterisk version 11.22.0, FreePBX version 2.11.0.43, CentOS 6.8.

    We use Ring Group rather than Queue because of a known bug in this Asterisk version queue handling that caused Asterisk to crash, so at some point we plan to update Asterisk and use Queues again.

  9. No takers, so does anyone have any tips where to look in logs or Asterisk to debug this myself?

or Sign Up to reply!