Allow multiple users on same alias

Discussions about new features or changes in existing features

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

Allow multiple users on same alias

Postby karlb » Wed Sep 27, 2023 1:28 pm

By default, if two people attempt to login with the same phone alias, it can result in the same phone login.

For a couple years, I have been adding some code to vicidial.php which will allow all my users to login with the same phone alias. The alias I personally setup for this includes all the webrtc phones in the entire cluster. This eliminates the need to keep track of a phone/user list and allows only a user login while maintaining load balancing (by changing to user first login and setting the phone alias as all the users phone). This also eliminated users accidently typing in the wrong phone login. Another benefit was that it greatly reduced the number of phones we had to create. It used to be one phone per user per server. Now it is only the max phones per server allowed, regardless of number of users.

I understand that this would not benefit all, as many people rely on specific phone settings for a user (Like CID, etc.). However, I feel like it could benefit many by simplifying the login process. The added code does not prevent any traditional login. In fact, you can have a mixed environment if needed. It simply takes the $phones_auto array and removes any phones in that array which are found in the vicidial_live_agents table.

Since I've been adding this piece of code successfully for awhile now, I am offering it for review and the possibility to add it to main. Thoughts? Thank you for any input.

This can be found on line 3592 in the current SVN 3758:
Code: Select all
$phones_auto = explode(',',$phone_login);

Change to:
Code: Select all
//$phones_auto = explode(',',$phone_login); // Original code commented out

//Start live extension search - Added - Karl Babcock
$phones_auto2 = explode(',',$phone_login);
$stmt="select replace(extension,'SIP/','') as live_extensions from vicidial_live_agents;";
$rslt=mysql_to_mysqli($stmt, $link);
$live_extensions = array();
while($live_extensions2=mysqli_fetch_row($rslt))
   {
   $live_extensions[] = $live_extensions2['0'];
   }
$phones_auto = array_diff($phones_auto2, $live_extensions);
$phones_auto = array_values($phones_auto);
//End live extension search
karlb
 
Posts: 34
Joined: Fri Dec 28, 2012 1:03 pm
Location: Chicago, IL

Re: Allow multiple users on same alias

Postby mflorell » Wed Sep 27, 2023 1:34 pm

If you would to contribute this to the project, please post your code to the Issue Tracker.

Thanks!
mflorell
Site Admin
 
Posts: 18339
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: Allow multiple users on same alias

Postby karlb » Wed Sep 27, 2023 1:40 pm

Done. Thank you
karlb
 
Posts: 34
Joined: Fri Dec 28, 2012 1:03 pm
Location: Chicago, IL

Re: Allow multiple users on same alias

Postby carpenox » Wed Sep 27, 2023 6:36 pm

Great contribution, awesome work
Alma Linux 9.3 | SVN Version: 3822 | DB Schema Version: 1711 | Asterisk 18.18.1
www.dialer.one -:- 1-833-DIALER-1 -:- https://linktr.ee/CyburDial -:- WhatsApp: +19549477572 -:- Skype: live:carpenox_3 | Discord: https://discord.gg/DVktk6smbh
carpenox
 
Posts: 2250
Joined: Wed Apr 08, 2020 2:02 am
Location: St Petersburg, FL


Return to Features

Who is online

Users browsing this forum: No registered users and 119 guests