| Documentation | ||
|
Requirements
Install
Download the latest version (look at the top-right corner on your screen). Untar the source: (tar zxvf filename-you-downloaded.tgz), cd into the directory and read all the files with uppercase names (README, FAQ, etc). Copy the files in the flash subdirectory to a suitable place on your web
server. If your web root is /var/www/html, you can create a subdirectory
'panel' (mkdir /var/www/html/panel) and copy the files there (cp flash/* /var/www/html/panel).
There are several possible indexes with distinct features on them, try them and use the one you like more, they are commented. You can modify the file help-XX.html with the content you like. You can also have a background.jpg file, the resolution is 996 x 600. Configuration
In order to run, you have to configure some aspects of Asterisk and the panel itself to suit your needs/environment. The bundled configuration files are examples only, they won't match your Asterisk setup. So please take the time to read the docs and examples and familiarize yourself with the configuration. Flash Operator Panel consists of two parts, a server and a client. The server connects to the Asterisk Manager port and acts as a proxy between the flash client and Asterisk. The flash client connects to FOP proxy server (op_server.pl) and speaks its own protocol to reflect status changes and send control commands to asterisk. Op_server.pl speaks to asterisk trough default port TCP/5038. Flash clients connect to op_server.pl though default port TCP/4445. Both ports can be changed in their respective configuration files. Understanding the architecture will help you troubleshoot connectivity problems later on. The config file for the panel server is op_server.cfg where you define basic and fundamental aspects of your setup, as login credentials, security codes, extensions and contexts, directories, etc. The config file for the flash client is op_style.cfg where you define mostly visual aspect of the flash side, like button sizes, icon positions, font family and size, etc.
Make sure you have a user with privileges for the asterisk manager. Just edit /etc/asterisk/manager.conf and add one if you have not done it yet. ; ; Asterisk Call Management support ; [general] enabled = yes port = 5038 bindaddr = 127.0.0.1 [myuser] secret = mysecret deny=0.0.0.0/0.0.0.0 permit=127.0.0.1/255.255.255.0 read = system,call,log,verbose,command,agent,user write = system,call,log,verbose,command,agent,user You should set up ACLs right in manager.conf to restrict access to it. Then reload asterisk and be sure to open port 5038 in your firewall if you need it to. If op_server.pl will run on the same machine, then it is best to connect via localhost. If you set ACL to only allows access to localhost (127.0.0.1), then be sure to use that same IP address in your op_server.cfg file. You can also set up read and write permissions for the manager.. in order to have a full working operator panel, set the read and write permissions as the example above.
Edit op_server.cfg and change the appropriate parameters for your setup.
manager_host is the hostname or ip address of your Asterisk box.
manager_user is the user defined in manager.conf (following this example configuration, it should be myuser) manager_secret is the secret or password defined for the above user in manager.conf event_mask allows you to specify what type of event you want to receive. Possible values are "on", "off", "system", "call", "log" You can monitor multiple asterisk servers: just repeat the sequence manager_host, manager_user, manager_secret and event_mask as many times as servers you want to monitor, without interleaving any other parameter in between. The first to appear will be considered number one, and so on. Then you can specify to what server a button belongs with the Server parameter in the button definition, inside op_buttons.cfg astmanproxy_host astmanproxy_port You can connect to astmanproxy instead of the asterisk manager port by specifying these parameters. astmanproxy_server Then you have to specify the ip addresses of every asterisk manager listed in astmanproxy config in the same order, each in its own astmanproxy_server line. listen_addr (optional) specify the ip address you want op_server.pl to bind to. If you leave this commented, it will try to bind to all ip addresses. listen_port is the port the server will use to accept incomming connections from flash clients. Flash and the server talk to each other using TCP to this port. Default: 4445 web_hostname (optional) must be the same hostname you use to access the web server. Eg: if you access the web server using 'http://www.myserver.com' then web_hostname must be 'www.myserver.com'. If you use an IP address instead of a name, you should write that IP. Don't include 'http://' at the begining. Flash clients will only work if the web_hostname is the same as the url your browser is pointing to, you can use it as an extra security measure. If you want to access the flash client from different addresses (like a local net and an external ip address, you will need to comment this field out). security_code is the password you will use to authorize incomming commands from flash (transfers, hangups, origination, etc). If you want to perform any action from flash, you will have to enter this code in the proper box within flash. Just write it there and then perform the action (there is no submit button in the flash applet). flash_dir must be the exact location of the directory where the html and swf files are placed. Following this examples, it should point to /var/www/html/panel poll_interval is the frequency in seconds the server will poll asterisk for sip and iax2 status. Default: 240. Newer asterisk versions should be fine without polling too much, as the manager generates register/unregister/lagged events by itself. If you have several sip or iax peers, consider setting the polling to a large value (Ex: 7200) because the server uses lots of resources to parse the results, and the events are sent anyways by Asterisk. poll_voicemail if you check voicemail from a web interface, the manager won't notify when a voicemail was deleted. You can enable this option and the voicemail will be checked every poll_interval seconds. auth_md5 set this to one if you want to authenticate to asterisk manager using MD5 hashing. There is no reason to turn it off. kill_zombies if enabled (1) the server will try to hangup zombie channels if they happen. This option should not be used, it is disabled by default (0). debug it sets the debug level of the server. The log is writen to stdout. Its a bitmap parameter. Bit 1: shows events comming from Asterisk Bit 2: shows commands sent to Asterisk Bit 4: shows commands comming from Flash Bit 8: shows commands sent to Flash Bits 16,32,64: debug for the server Default is 0 (no debug). If you want to see the events comming from Asterisk and the commands sent to it, set it to 3 (1+2). If you want to enable full debug, set it to 255. You can override this setting from the command line with -X queue_hide If set, queue position buttons won't be displayed if they are unused (so you only see the actual number of people waiting on the queue). See button types for more info. clid_format a pattern to format the caller id number. Every 'x' will be replaced by a number. Default: (xxx) xxx-xxxx clid_privacy if set to 1, the panel won't show the callerid or the dialed number on the buttons. show_ip if set to 1, the panel will show the ip address for sip and iax peers. reverse_transfer In its default configuration, when you drag & drop buttons for performing transfers, the point of view is from the PBX, not the user. So, if you are talking using SIP/myphone and drag the button for that channel, you will transfer that leg (yourself), not the one of the person you are talking to. If you want to transfer the other leg (that is, like the phone perspective instead of asterisk perspective), set this option to one. transfer_timeout (optional) If set, you will have an aditional element in the toolbar with a dropdown list of values. If you select one of them, the next time you perform a transfer within the panel, that call will end after the timeout is reached. The format for the value is: "timeout_in_seconds,label|timeout_in_seconds,label". If the timeout is set to zero, then the transferred call will not be limited in time. Example: transfer_timeout="0,No timeout|300,5 minutes|600,10 minutes"enable_restart if set to 1, the reload button on the flash client (that in its original form just reloads the flash client) will instead perform an asterisk restart. If you want asterisk to actually restart, be sure to run it with safe_asterisk or some other mechanism that will relaunch asterisk when it ends. It is an actual RESTART, not a RELOAD rename_label_wildcard if you have REGEXP buttons width a wildcard, you can set this option to 1, and the label for that button will change to the actual name of the channel that is using that slot. A channel with a wildcard is any channel that contains an asterisk '*' inside. (Not all regexps contain wildcards) rename_label_agentlogin if set to 1, it will change the label of the button to the agent number for that button when using asterisk AgentLogin application. rename_label_callbacklogin if set to 1, it will change the label of the button to the agent number for that button when using asterisk's AgentCallbacklogin. If you login through an extension that is defined in the Extension and Context parameters for that button, then its label will change to Agent/XXXX on login. If you do not have a button who's Extension and Context matches, then it won't work. rename_to_agent_name if set to 1 the renaming above will be performed with the name defined in agents.conf instead of Agent/XXXXX. rename_queue_member if you add channels as members of a queue by means of AddQueueMember, without using agents.conf, then this option is for you. change_led_agent if set to 1, the led for the button that represents a logged in agent will change to the color defined in op_style.cfg as ledcolor_agent (default yellow). This way you can see at a glance if the agent is logged in or not. barge_muted if set to 1 and you drag an unused button to any leg of an active call, the three will be thrown into a meetme room, and the dragged channel will be set to muted automatically, so both original parties won't hear to the 3rd party. You can then mute or unmute any of the meetme participants by single clicking on the little arrow icon on each button. barge_rooms are the meetme room number to use for barge-in functionality. conference_context is the context where you have defined all of your meetme rooms, used for barge in. Default: conferences For barge in to work, you have to add some extensions in their own context inside your dialplan. Edit /etc/asterisk/extensions.conf and add something like this (the extension number must match the meetme room number): [conferences] exten => 900,1,MeetMe(900) exten => 901,1,MeetMe(901) exten => 902,1,MeetMe(902)And in /etc/asterisk/meetme.conf you need something like this: [rooms] conf => 900 conf => 901 conf => 902 You can define different security_codes conference_context, barge_rooms, flash_dir and web_hostname in a different context. Just start a new context definition between brackets and put the new values below that line. In this way you can have different web pages to serve different contexts for hosted pbx. voicemail_extension is the extension and context in your extensions.conf to reach the voicemailmain application. For example, if you have defined the 1234 extension in context 'features' to reach voicemailmain, set this parameter to '1234@features'. Then, when you double click on the MWI icon on a button, it will dial to voicemail directly. Configuring buttons
Edit op_buttons.cfg to suit your needs. The syntax is similar to asterisk configuration files. You have to configure the buttons you want displayed on the panel here. Any channel name not defined here will not be shown. [ZAP/4] Position=1 Label="11 Reception" Extension=11 Context=local Icon=1 Mailbox=11@localvm URL=mypage.php Target=myframe ;No_Rectangle=true The channel name is writen between brackets. Depending on the channel name and Position header you will select the type of button. The sintax for SIP channels is SIP/username. For ZAP is ZAP/channelnumber. For IAX2 is IAX2/username. Other channels follow similar rules. As I don't have the hardware, I couldn't test with other channel types. You can set the debug to 1 and look for the channel names comming from Asterisk to match yours. There are also special button types for particular situations and applications, like meetme buttons, park button, queue buttons, regexp buttons, etc.
Position is the button number. Buttons are drawn from top to bottom and from left to right. The total number of buttons depends on the size of the buttons and the padding (you can change those values in op_style.cfg). You can put an exact value, a comma separated list, a range, or the special 'n' (next) value. If a button has more than one position defined, it will be treated specially: if it's for a regular channel, it will become a trunk button, if it's for a special button it will change the behaviour/type. See button types for details:
Panel_Context Starting from version .10, you can have panel 'contexts'. This means only one server running, and several flash clients with different buttons layouts connected to this unique server. If you omit this parameter, the 'default' context will be asumed. To specify the context to load in flash, you have to modify the page that loads the swf file. Just add '?context=mycontext' after every appearance of 'operator_panel.swf'. URL if set, the button label will become an hyperlink that links to this URL when clicked. Target to set the hyperlinks target. If omited, it will use the current window. You can use the standard html targets, like _parent, _new, etc. No_Rectangle if set to true, the rectangle will not be drawn, only the other elements (label, icon, caller id, timer, etc). You can use your custom background image to draw your own buttons. Label is the button label. You have to enclose it with quotes if you plan on using spaces.
International Characters Extension is the extension number. It must be defined in your dialplan to reach that channel. If there is no extension for that button (eg: its an external line) you must set it to -1, this way, the server will discard attempts on transfers to that channel. Context: if the extension is not reachable from the default context in your dialplan, you should also specify its context. If you have extension number 100 inside the 'from-sip' context, then you should write 100 for the extension and from-sip for the context. Icon is the icon. There are six icons available:
Mailbox is the voicemail mailbox to monitor. If you have voicemail accounts for the extension, you have to specify the voicemail user and context. If you leave this field empty, the server will not check the mailbox for that extension. Button TypesMeetme (summary)To make a button for a conference, the channel name should be just the conference number. That button will show the total number of people inside that conference room. If you have a conference number 900, the channel name would be, you guessed it: 900. Example:[900] Position=1 Label="Meetme Room 900" Extension=900 Context=conferences Icon=6 Meetme (participants)Just specify more than one position for a meetme button and they will show meetme participants indiviually as they join or leave the conference. You then can mute/unmute each one by single clicking on the led.[900] Position=2-5 Label="Meetme User" Extension=-1 Icon=6 Queue (summary)To make a button for a queue, the channel name should be the queue name prefixed by 'QUEUE/'. The button will show the total number of people waiting on the queue, and the maximum current wait time. For example, if you have a queue named 'sales', the button config should look something like:[QUEUE/sales] Position=2 Label="Sales Queue" Extension=3 Context=queues Icon=5 Queue (positions)You can reserve several buttons for queue positions. Each position will be used by the users waiting on that queue. Say you have 3 people waiting on queue 'support' then the first three slots will be taken, one for each person, in the positions they are on that queue (slot 1 for position 1, slot 2 for position 2 and so on). Queue position buttons show the Callerid Name and Callerid Number of the person, as well as the waiting time for each. To define queue position buttons, the channel name is the same as queue summary, but you have to use more than one position for that button (as many as you like). For example:[QUEUE/support] Position=3-10 Label="Support Queue" Extension=-1 Icon=5 Queue Agents (experimental)This kind of button can be used to show agents that are members of a particular queue, by means of agentlogin, agentcallbacklogin, addqueuemember or statically configured, without worrying about the method you use. For now this feature is resource intensive and there are problems when you use Local channels because there is no way to know to what actual channel a Local channel points to. If you are adventourus, try it. Example (will use 7 slots for agents for the queue 'sales'):[QUEUEAGENT/sales] Position=3-10 Label="Sales Queue" Extension=-1 Icon=3 AgentsFor monitoring a particular agent by number. It works most of the time. Example:[AGENT/1002] Position=12 Label="Agent 1002" Extension=1002 Context=Agents Icon=3 Park slotsYou can use buttons to display park slots. The button is lit when a call is parked on that slot and it will show a countdown with the park timeout instead of a regular timer. Example config:[PARK/701] Position=12 Label="701 Park" Extension=701 Icon=0 Callerid ButtonsThere are times that you need to monitor a channel based on its callerid (Maybe because you use SER and the channel name is not meaningfull, or because you are interfacing asterisk with a traditional pbx trhough Zap channels that are not related to particular extensions, etc). For such cases, you can try to monitor by using CLID buttons. There are some shortcommings to these kind of buttons, but they are mostly functional. Example:[CLID/5555555] Position=13 Label="5555 John" Extension=5555555 Context=from-internal Icon=2 Regexp ButtonsThere are times that you need to monitor several channels or dynamically generated channel names. Regular expressions can come handy. To use a regular expression to match a channel name, you need to prefix it with an underscore. This kind of buttons cannot be used to originate a call because you don't know for certain the channel that will be originating the call. The regular expression is always case insensitive. There are some reserved character that cannot be used: & and =. Example:[_SIP/.*] ; regexp to match all sip channels Position=1,2,3 Label="All Sip channels" Extension=-1 Channel ButtonsThe standard button type. Just use TECHNOLOGY/channel_name. Some TECH types require special naming conventions as shown in the examples below. If one button use just one position, it will pile up all lines activity on that button (there are some phones capables of having more than one call handled at a time). If you use more than one position they will be treated as trunk buttons (explained below). Examples:[ZAP/4] Position=1 Label="11 Reception" Extension=11 Context=local Icon=1 Mailbox=11@localvm [SIP/12] Position=2 Label="12 Mary" Extension=12 Context=local Icon=1 Mailbox=12@localvm [IAX2/david] Position=3 Label="13 David" Extension=13 Context=local Icon=2 Mailbox=13@localvm [CAPI[contr1/NNNNNNNNN]] ; where NNNN is the ISDN number. Position=4 Label="External CAPI" Extension=-1 Context=in-extern Icon=4 Trunk ButtonsWhen specifying more than one position for a button, that button will be considered a trunk. A normal button will display all instances of the same channel name in that sole button. In a trunking button, each instance will be displayed in the next available button for that trunk. If you have a DID from an IAX or SIP provider, and you receive more than one call from that user, you must define that button as a trunk with as many 'instances' as you like. This way you can transfer individual calls from the same provider. For example:[IAX2/iaxtel] Position=10-12 Label="Iaxtel" Extension=-1 Icon=3 [SIP/myprovider] Position=20-30 Label="SIP TRUNK" Extension=-1 Icon=4 Changing the layout
Edit op_style.cfg to change the visual layout. You can change the button size and colors, icon placement and size, etc. DO NOT modify the variable names, just the value after the equal sign and DO NOT use spaces. With proper adjusting, you can have more than a 100 buttons on the screen. The variable names are self explanatory. For example, if you want to reduce the height of the buttons, just set btn_height to a lower value. You can change this file with the op_panel.pl running. After changing a value, you must tell the server to refresh the configuration by sending a HUP signal (killall -HUP op_server.pl). After that, you need to reload the flash display, by clicking the reload button or just reloading the page. You can change the toolbar layout by changing the number after the variables show_???. Each one represents a possible element in the toolbar.
A value of 0 disables the element. A number represents the order in the
toolbar it will be displayed, number one being the leftmost part of the
toolbar. In the example configuration, all the toolbar elements are
displayed in correlative order. Eg: if you do not want to display a DEBUG
button, set the 'show_btn_debug' to 0. You can translate the text of the
toolbar in the corresponding variables.
If you want to set the caller id text from the flash applet when transferring a call, you will have to modify your dialplan, or standard extension macro, to something similar to this:
[macro-stdexten]
# Example standard extension macro for setting the
# callerid if the info was supplied from the operator
# panel. The panel sets a database entry for the
# channel name with the caller id text.
#
# If the variable does not exist in the database
# (if was not set by the operator panel) the line
# 1 jumps to priority n+101, to perform a normal
# dial without setting the CallerIDName
exten => s,1,DBget(temp=clid/${ARG1})
exten => s,2,SetCIDName(${temp})
exten => s,3,DBdel(clid/${ARG1})
exten => s,4,Dial(${ARG1},30,TrH)
exten => s,5,Voicemail(u${MACRO_EXTEN})
exten => s,6,Hangup
; gets here if dbget fails (there was no 'clid info' provided)
exten => s,102,goto(s,4)
; busy from dial
exten => s,105,Voicemail(b${MACRO_EXTEN})
exten => s,106,Hangup
If you don't want to mess with the caller id, be sure to set the show_clid_info to 0 in op_style.cfg and skip this step. You can also use the UserEvent asterisk application from your dialplan to trigger some special actions or behaviours. PopUps: you can fire a screen popup from the dialplan. The button parameter is optional, it will restrict the popup to flash clients loaded with mybutton or restrict set to that button number. Example:
exten => 1,1,UserEvent(FOP_Popup|URL: p.php?e=${EXTEN}^Target: top^Button: 1)
Change led color: you can change the led color too (but the state will not be saved between reloads): exten => 1,1,UserEvent(FOP_ledcolor|Color: 0x0000FF^State: 0) The color can be any hex value. The State is:
Starting the server
./op_server.pl The server does not detach from the console. If you want it to run in the background daemonized, append '-d' in the command line. If the debug level is other than 0, the output will be logged on stdout. To find out if the server works well, set the debug level to 1, the output should look like this: <- Asterisk Call Manager/1.0 <- Response: Success <- Message: Authentication accepted <-You can run the server from your rc.local script to have it running on startup. There are also example init scripts in the init directory if you prefer to use your distro init system. Be sure to start op_server.pl after asterisk. If you restart asterisk, the op_server will try to reconnect 60 times with 10 seconds intervals (10 minutes). If it fails to connect after these many attemps, it will shutdown. Using the Panel
When a channel is busy, or there is someone in a conference or queue, the oval will be red. If it is available or there is nobody on the queue or conference, it will be green. A flashing oval indicates ringing. If all the ovals are flashing, its because the flash applet lost connection from the op_server. When your mouse is over a button, and there is activity going on for that button, you can see the details on the status bar. Before performing actions, you have to enter the Security Code in the box. If the code does not match, your actions will be ignored. After typing the code, you can: Please note! If you want to transfer an available channel to an already connected call, you have to configure your dialplan correctly and have the context properly defined, if you don't do that you will experience hanged channels and asterisk lockups. Thats because when you redirect a call within the asterisk manager with an incorrect context, asterisk does not handle the error gracefully. CRM Integration
You can have a web page with all the customer details before answering the phone. This feature was introduced in version 0.11 of the Panel. To set it up, you have to specify some variables in the html page that loads the flash operator panel:
When a call comes in for the button monitored (mybutton), it will open a browser window pointing to url in the target. It will use method get to send the variable clid to that url, so you can perform your search for the customer record. You have to add the variables when loading the .swf file. Open the index.html supplied and look for all the instances of operator_panel.swf and append the variables like: operator_panel.swf?mybutton=4&url=customer.php&target=bottom You can use an invisible frame (0 width and no borders) to load the .swf file and not clobber the screen with the panel itself if you want. To have a different button monitored, user logins, etc, you can use the method of your choice: php,modperl,asp, etc, to modify the frame that loads the swf file and set the variables accordingly. If you do not specify a mybutton variable, or if the url is empty, the CRM feature will be disabled. An example customer.php should be like:
<?
if(isset($_GET['clid'])) {
echo "The caller id is ".$_GET['clid'];
}
?>
Agents and queues
The agent features in op_server.cfg are: |