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