agent not enter phone extension

Discussions about new features or changes in existing features

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

agent not enter phone extension

Postby iulianm » Thu Feb 03, 2011 3:54 pm

Hello

I think it will be simpler for the agent , when logs in to enter only his username and password and not also the sip extension. When he opens the vicidial web page, to be a script that verify what extension does the agent has in asterisk ( by ip address ) and that's it.

This can be easy done PHP ; When agent access the vicidial webpage we have the IP address and after that we send a event to asterisk like :

Code: Select all
   
 $extension=$a->Getsipextension($ip);
 echo($extension);


And after that the system will now the the agent Agent001 will have that extension assigned.

What do you think?



Code: Select all
 function GETsipextension($ip)
    {
        $p=$this->SIPpeers();
        for($i=0;$i<=count($p);$i++)
        {

            if(trim($p[$i][1])==trim($ip))
            {
                //return 100;
                $pos = strpos($p[$i][0],"/");
                if ($pos === false) {
                    return -1;
                }
                else
                {
                    return substr(strstr($p[$i][0],"/"),1);
                }
            }

        }
        return(-1);
    }


Code: Select all
    function SIPpeers()
    {
     // return $this->send_request('SIPpeers');
     $parameters = array('Command'=>"sip show peers");
     //get data and pars the string to get extension and IP
     $data_pars=$this->send_request('Command', $parameters);
     $data=$data_pars['data'];
     $result=split("\n",$data);
    // return($result);
     $j=0;
     $count=count($result);
     $a=array();
     for($i=2;$i<=$count-3;$i++)
     {
         $ext=substr($result[$i],0,26);
         $ext1=substr($result[$i],26,17);
         $a[$j][0]=$ext;
         $a[$j][1]=$ext1;
         $j++;
      }
     return($a);
    }
iulianm
 
Posts: 36
Joined: Thu Nov 25, 2010 6:26 am
Location: Romania

Postby mflorell » Thu Feb 03, 2011 9:20 pm

Please post all code contributions to the Issue Tracker.

This solution would not work for agents behind a NAT firewall, so it really isn't something we would include in the codebase.
mflorell
Site Admin
 
Posts: 18335
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Postby williamconley » Sat Feb 05, 2011 12:37 am

simpler to use the vicidial-group-included sample setup that allows the user to log in first, then use whatever method you like to grab the phone login/phone pass from the user record to auto-fill the phone info. as long as you can "define" all the user's phone identities and assign them in advance, it's not too much of a stretch. but it does violate the hot desk.

you may want to have a look at the URL when an agent has "logged out" and has the "click here to log back in" link. clicking on that link renders a URL that can be used to autofill EVERYTHING, so the user doesn't have to remember any of it. just a favorite/shortcut/bookmark. removing the user's password would even make it secure (would still have to know the pwd to get into the server).
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20018
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)


Return to Features

Who is online

Users browsing this forum: No registered users and 27 guests