Jump to: navigation, search

Configuring Asterisk

The Genesys Voicemail Adapter (GVMA) utility is provided by Genesys to propagate the Voicemail configuration from the Configuration Layer to the Asterisk configuration files. GVMA performs the following steps:

  1. GVMA starts.
  2. GVMA connects to Configuration Server using the SOAP protocol.
  3. GVMA makes a backup copy of the Asterisk configuration.
  4. GVMA loads the Voicemail configuration from the following configuration objects:
    • DNs
    • Agent Logins
    • Agent Groups
  5. GVMA updates Asterisk configuration files with the information retrieved from the Configuration Layer during Step 4.
  6. GVMA instructs Asterisk to reload configuration files.
  7. GVMA exits.

GVMA can be run manually or scheduled for periodic execution using the OS scheduling tools, such as cron on Linux systems.

The following table provides an overview of the main steps to integrate SIP Server with Asterisk to support the Voicemail solution.

Configuring Asterisk

Objective

Related Procedures and Actions

1. Define all required parameters in the GVMA configuration file.

See the following sections:

2.Run the GVMA utility on the Asterisk host to configure Asterisk.

Run the GVMA utility by executing the gvma_asterisk76.pl script.

Prerequisites

Back Up the Asterisk Configuration

The GVMA utility modifies the following Asterisk configuration files: extensions.conf, sip.conf, and voicemail.conf. To save the original Asterisk configuration, create backup copies of all Asterisk configuration files before using the GVMA utility.

Perl Interpreter

You must install the Perl interpreter on the Asterisk host to run the GVMA utility, which is written as a perl script. Install these additional perl packages that are required to run GVMA:

  • SOAP-Lite
  • Net-Telnet

Enable the Asterisk Manager Interface

Enable the Asterisk Manager Interface (AMI) by setting the following parameters in the manager.conf Asterisk configuration file:

[general]

enabled = yes

port = 5038

bindaddr = 0.0.0.0

Enable the GVMA Utility to Change the Asterisk Configuration

Enable the GVMA utility to change the Asterisk configuration by adding the following section in the manager.conf Asterisk configuration file:

[gvma]

secret = genesys1

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

GVMA Location

The GVMA utility is located in the tools folder of the SIP Server installation utility. Files in the tools directory include:

  • gvma_asterisk76.cfg--The GVMA utility for 7.6 SIP Server.
  • gvma_asterisk76.pl--The GVMA utility configuration file for 7.6 SIP Server.
  • gvma_asterisk.cfg--The GVMA utility for 7.5 SIP Server.
  • gvma_asterisk.pl--The GVMA utility configuration file for 7.5 SIP Server.

Depending on the mwi-mode option value set in the SIP Server Application object, you choose which configuration file and script to run. If the mwi-mode option is set to SUBSCRIBE, use the following files:

  • gvma_asterisk76.cfg
  • gvma_asterisk76.pl

If the mwi-mode option is set to REGISTER, use the following files:

  • gvma_asterisk.cfg
  • gvma_asterisk.pl

The REGISTER value of the mwi-mode option is for backward compatibility with 7.5 releases of SIP Server.

Configure the GVMA Configuration File

Configure the following sections in the GVMA configuration file before using the utility:

  • cfgserver
  • gvma_settings

Section cfgserver

Parameters in the cfgserver section define how GVMA connects to Configuration Manager and what information GVMA reads from it.

Note that option port refers to the SOAP port of Configuration Server and not to the port where Configuration Manager is connected. The Configuration Server SOAP port is specified in the Configuration Server configuration file as a port option in the [soap] section.

[cfgserver]

host=<config server hostname or IP>

port=<config server SOAP port>

username = <config server username>

password = <config server password>

The second part of the cfgserver section provides several examples about how to define a query to allow for the GVMA utility to collect information about DNs, Agent Logins, and Agent Groups from the Configuration Layer. One query should be chosen for each of these three object types. The following placeholders in the selected queries should be replaced with the information from the Configuration Layer:

  • <Switch DBID>
  • <tenant DBID>
  • <tenant name>
  • <Switch Name>

#Query examples using DBIDs:
#dnquery = CfgDN[(@ownerDBID=<Switch DBID>) and (@type=1)]
#agentquery = CfgAgentLogin[@ownerDBID=<Switch DBID>]
#agentgroupquery = CfgAgentGroup[@tenantDBID=<tenant DBID>]

#Query examples using switch and tenant names:
dnquery = CfgTenant[@name='<tenant Name>']/switches/CfgSwitch[@name='<swith name>']/DNs/CfgDN[@type='1']
agentquery = CfgSwitch[@name='<Switch name>']/agentLogins/CfgAgentLogin
agentgroupquery = CfgTenant[@name='<tenant name>']/agentGroups/CfgAgentGroup

Section gvma_settings

The first group of parameters in the gvma_settings section specifies the location of Asterisk configuration files and what files you have to change:

  • asterisk_cfg_path=/etc/asterisk
  • asterisk_cfg_file_sip=sip.conf
  • asterisk_cfg_file_vm=voicemail.conf
  • asterisk_cfg_file_exten=extensions.conf

The following parameters define the comments, which GVMA puts as a boundaries around the parts it inserts into the Asterisk configuration files.

  • asterisk_cfg_gvma_begin=;$—-GVMA-BEGIN-GVMA—-$
  • asterisk_cfg_gvma_end=;$—-GVMA-END-GVMA—-$

GVMA creates backup copies of the configuration files to be modified in the location defined by the backup_path parameter:

  • backup_path=./gvma_backup

GVMA uses the Asterisk Manager Interface port to connect to Asterisk:

  • asterisk_cm_port=5038

On the Asterisk side, this port is defined in the manager.conf file.

Use the siptserver_host and siptserver_port parameters to specify the host and port, respectively, in the GVM subscription objects created in the sip.conf file.

  • siptserver_host=<SIP Server hostname or IP>
  • siptserver_port=<SIP Server Port>

Finally, the gvma_settings section has a group of parameters specifying how to access different types of voicemail boxes from the agent VOIP phones:

  • vm_dn_ext_prefix=37
  • vm_agt_ext_prefix=38
  • vm_grp_ext_prefix=39
  • vm_voicemail_main_ext=9500

GVMA Modifications to Asterisk Configuration Files

You can easily find all modifications the GVMA utility makes to the Asterisk configuration files by searching for the beginning and end key specified in the GVMA configuration file in the parameters asterisk_cfg_gvma_begin and asterisk_cfg_gvma_end.

File extensions.conf

GVMA creates a new context called [GVMA] in the Asterisk dialing plan. This context includes six wildcards. The following wildcard is created to provide access to the agent voicemail boxes from the agent VOIP phones:

exten => _37X.,1,Wait(1)

exten => _37X.,2,Set(GVM_DEST=${EXTEN:2})

exten => _37X.,3,GotoIf($["${CALLERID(num)}" = "${GVM_DEST}"]?4:6)

exten => _37X.,4,VoicemailMain(${GVM_DEST}@GVMA_DN)

exten => _37X.,5,Hangup

exten => _37X.,6,GotoIf($["${GVM_DEST}" = "9500"]?7:9)

exten => _37X.,7,VoicemailMain(@GVMA_DN)

exten => _37X.,8,Hangup

exten => _37X.,9,Voicemail(${GVM_DEST}@GVMA_DN,u)

exten => _37X.,10,Hangup

Three wildcards of this type are created to provide access to three different types of voicemail boxes: Extensions, Agent Logins, and Agent Groups. Prefixes used in these wildcards are taken from the following GVMA configuration file parameters:

  • vm_dn_ext_prefix
  • vm_agt_ext_prefix
  • vm_grp_ext_prefix

Another three wildcards that are created in the GVMA context are:

  • _gvm-X
  • _gvm-a-X
  • _gvm-g-X

These wildcards are not supposed to be dialed directly, but they are required for the MWI subscription to function properly.

Note: You must manually include a new GVMA context into the existing dialing plan context that is used to process agent calls on Asterisk. If there is no special context created for this purpose, you must include the GVMA context into the default dialing plan context. Include the following parameters: [default]include => GVMA

File sip.conf

The GVMA utility creates a block of new GVM SIP entities in the sip.conf file. Each SIP entity is associated with one voicemail box. SIP Server activates one MWI subscription for each GVM SIP entity.

;$—-GVMA-BEGIN-GVMA—-$

; Generated by Genesys VoiceMail Configuration Adapter for Asterisk.

; Content generated at Tue Jan 15 20:36:50 2008

[gvm-1111]

type=friend

host=192.168.0.200

port=5060

mailbox=1111@GVMA_DN

vmexten=1111

...

;$—-GVMA-END-GVMA—-$

The GVMA utility creates multiple gvm-* objects in the sip.conf configuration file. If Asterisk is also integrated with SIP Server to perform a business call routing, then the sip.conf file also contains an object representing a SIP Server. The host and port parameters specified for the SIP Server object are the same as the ones defined for the gvm-* entities in the sip.conf file. This configuration can cause a problem if the Asterisk dialing plan uses the host:port format in the Dial() function to send calls to SIP Server. For example:

SIP-SERVER_HOST = 10.10.10.1

SIP-SERVER_PORT = 5060

exten => 2400,1,Dial(SIP/${EXTEN}@${SIP-SERVER_HOST}:${SIP-SERVER_PORT},30,r)

Asterisk can select any gvm-* object to send calls, instead of the SIP Server object. In this case, a call is delivered to the correct destination but the call processing depends on the sip.conf object parameters, which are different for SIP Server and gvm-* objects.

To avoid this problem, Genesys recommends using the dial plan Dial() function with reference to the object name defined in the sip.conf file instead of using the host:port format. For example:

extensions.conf:

exten => 2400,1,Dial(SIP/${EXTEN}@genesys-sip-server,30,r)

sip.conf:

[genesys-sip-server]

host=10.10.10.1

port=10.10.10.1

File voicemail.conf

The GVMA utility creates three new Voicemail contexts in the voicemail.conf Asterisk configuration file: GVMA_DN, GVMA_AGENT and GVMA_AGENTGROUP. Those contexts contain voicemail boxes created for Extensions, Agent Logins, and Agent Groups, respectively. GVMA takes all parameters that are specified for the GVM voicemail boxes from the configuration of the corresponding the Configuration Layer objects.

;$—-GVMA-BEGIN-GVMA—-$

; Generated by Genesys VoiceMail Configuration Adapter for Asterisk.

; Content generated at Tue Jan 15 20:36:50 2008

; ######## Voicemail Boxes for the Extensions #######

[GVMA_DN]

1111 => 1111,1111,,

; ######## Voicemail Boxes for the Agents #######

[GVMA_AGENT]

2222 => 2222, 2222, 2222@192.168.0.200, 2222@192.168.0.200,operator=yes

; ######## Voicemail Boxes for the Agent Groups #######

[GVMA_AGENTGROUP]

3333 => 3333, 3333, 3333@192.168.0.200, 3333@192.168.0.200,operator=yes

;$—-GVMA-END-GVMA—-$

This page was last edited on October 19, 2015, at 21:37.
Comments or questions about this documentation? Contact us for support!