Configuration


Configuring Buttons

Besides the server configuration, it is important to configure the buttons you want to display, either for the default or general context, or for any other panel context you define.

Button configuration is done on separate config files so they are easier to maintain and organize. In /usr/local/fop2/fop2.cfg you have to specify the buttonfile parameter, pointing to the file that will hold button definitions.

If you use FreePBX with automatic configuration, you do not need to configure buttons at all. They will be created for you, so you can skip this section. Since version 2.10 you can tweak button configurations using the FreePBX module, available for download from the Download page.

The button config file is, as all fop2 config files, simliar to the asterisk ones like /etc/asterisk/sip.conf. Here is a sample:

/usr/local/fop2/fop2.cfg
...
user=100:1234:all
user=101:1234:all
buttonfile=buttons.cfg


 

Extension Buttons

This kind of buttons will represent a phone or extension. It will display two lines for each button and some specific information, like presence, pause state, etc.

/usr/local/fop2/buttons.cfg
[SIP/600]
type=extension
extension=600
context=from-internal
label=John Doe
mailbox=600@default
extenvoicemail=*600@default
channel=IAX2/600

[SIP/601]
type=extension
extension=601
context=from-internal
label=Mary Jones
mailbox=601@default
extenvoicemail=*601@from-internal

As you can see, button configuration starts with the device or channel name between brackets, followed by parameters=values.

The parameters are:

type
This parameters gives the identity to the button. The panel page has sections for each type. The buttons will be drawn in the corresponding section depending on its type. The possible types are: extension, queue, trunk and conference.
extension
The extension number to ring that phone. It will also be displayed as the 1st item in the button label.
context
The asterisk context where this extension is defined. Calls will be placed inside that context when transferring to, or originating a call.
label
The name to display in the web for that button. It will be drawn just after the extension number in the button label.
mailbox
The number and context for the voicemail mailbox as defined in asterisk's voicemail.conf. Expects the format exten@context
extenvoicemail
The extension and context to transfer calls directly to voicemail, with the format exten@context
channel
This parameter is optional. You can overflow channels into any extension, so if FOP2 detects activity with any of the channels in the list, it will count as activity for that extension/button. For example, if you have a local SIP channel for your extension, and an IAX extension when you are on the road, you can specify the 2nd IAX channel in the button. Calls made with any of the channels, iax or sip, will be displayed on the same button.
group (2.10)
You can set a group to any name you want. All extension buttons with the same group will be drawn on their own group section on the display. This only works for extensions. The group on a button definition is not related to a group defined in fop2.cfg for restricting user views. It is a visual way to organize or split extensions on their own panes.
queuechannel (2.10)
This channel/device will be used when adding/removing a member from a queue. If omitted FOP2 will use the channel defined between brackets. You can use this if you want to use Local/XXX@from-queue/n or if you want to use Agents (can be used together with use_agentlogin in fop2.cfg to use Agentlogin instead of AddQueueMember). Since version 2.20 you can pass a full list of options for the queue member, for example:
queuechannel=Local/620@from-queue/n|Penalty=1|MemberName=Nicolas|StateInterface=SIP/620
originatechannel (2.10)
This channel/device will be used when originating calls from this device. For example, if you want your calls to be autoanswered and you are using FreePBX default *80 prefix for that, you can set this parameter to: Local/*80{EXTEN}@from-internal.
queuecontext (2.10)
Context to match for queue members that use the Local/{EXTEN}@{CONTEXT}/n way. Since FreePBX 2.6, the context changed from "from-internal" to "from-queue". If using automatic configuration, the script will find out what to use by itself. If you do not use FreePBX and have a special context for adding queue members, you have to set that context name here.
privacy (2.10)
Lets you set privacy types for the buttons. Allowed types are:
  • clid: restricts callerid or dialed number display
  • monitor: prevents the device from being spied or monitored.
  • all: prevents both clid and monitor.
email (2.10)
You can set an email address per button. If set, you can then click on the presence icon for that button and be presented with the option to send an email to that extension.
external (2.20)
You can set an external number to transfer calls to using the "Transfer to External" button in the toolbar. The format is number[@context]. If no context is set, it will use the default context for that button.
spyoptions (2.20)
To specify individual options to pass to chanspy to modify its behaviour, like for passing group restrictions (option g).

 

Queue Buttons

Similar to extension buttons, queue buttons use the same parameters with the difference that not only the type should be set to queue but also the name between brackets must be prefixed with "QUEUE/"

/usr/local/fop2/buttons.cfg
[QUEUE/101]
type=queue
label=Sales
extension=101
context=from-internal

[QUEUE/102]
type=queue
label=Support
extension=102
context=from-internal

Queue buttons do not accept mailbox or extenvoicemail parameters, as they only apply to extension buttons.


 

Conference Buttons

As well as the queue buttons, conference buttons not only need to be defined as type conference, but also the name between brackets must have the "CONFERENCE/" prefix.

/usr/local/fop2/buttons.cfg
[CONFERENCE/1000]
type=conference
label=Main Conference
extension=1000
context=from-internal


 

Trunk Buttons

For trunks there are very little parameters to set. A trunk cannot be dialed, for that reason you do not need to specify extension nor context. Only the type "trunk" must be specified, together with the button label.

If you want to group channels in one button, you can overflow the channels listing one by one as the example below (you can add one by one or enumerate them using &):

/usr/local/fop2/buttons.cfg
[DAHDI/1]
type=trunk
label=DAHDI 1-4
channel=DAHDI/2
channel=DAHDI/3
channel=DAHDI/4&DAHDI/5&DAHDI/6


 

Park Button

The trunk button is fairly straightforward to setup: you must be sure to set the extension to your parking extension number, and if you do not use parking name spaces (Asterisk 1.6 and 1.8), use the "default" name for it, for example:

/usr/local/fop2/buttons.cfg
[PARK/default]
label=Park
type=park
extension=700
context=parkedcalls