Telephony service deployment and configuration guide

This documentation has been tested on a Dell PowerEdge 860 server with a Digium RDSI B410P card and a Junghanns QuadBRI.

Telephony service preparation

Compiling of the required software

Updating the machine.

 yum update
  • Disable selinux.
  • Reboot.
  • Install the required software for compiling asterisk.
yum install make gcc kernel-xen-devel gcc-c++ flex ncurses-devel which bc
    make && make install
  • Unpack zaptel, compile and install.
   make && make install
  • Compile the B410P support card in zaptel.
    make b410p && make install && make config
  • Unpack asterisk, compile and install.
     ./configure && make && make install && make samples
  • Boot script installation
    cp contrib/init.d/rc.redhat.asterisk /etc/init.d/asterisk
    chmod 755 /etc/init.d/asterisk
  • Edit the file /etc/init.d/asterisk and modify it for the asterisk user.
  • Uncomment the line:
AST_USER="asterisk" 
  • Configuramos los niveles de arranque
  • Configure the boot levels.
    chkconfig --add asterisk
  • Unpack asterisk-addons, compile and install:
    
 ./configure && make && make install && make samples
  • Create the asterisk users.
     useradd -r asterisk
  • Create the directories /var/lib/asterisk/sounds/tts, /var/lib/asterisk/sounds/custom and /var/run/asterisk
    mkdir -p /var/lib/asterisk/sounds/tts /var/lib/asterisk/sounds/custom /var/run/asterisk
  • Set the asterisk user as the owner of: /etc/asterisk, /var/lib/asterisk, /var/spool/asterisk, /var/log/asterisk, /var/run/asterisk:
    chown -R asterisk /etc/asterisk /var/lib/asterisk /var/spool/asterisk /var/log/asterisk /var/run/asterisk
  • Edit the /etc/asterisk/asterisk.conf file to add the run directory:
astrundir => /var/run/asterisk

RDSI card configuration using mISDN

  • The card is detected:
/etc/init.d/misdn-init scan
  • Create the configuration file /etc/init.d/misdn-init config
  • Configure the ports and the signaling (point to point or point to multi-point) in /etc/misdn-init.conf
  te_ptmp=1,2,3,4
  • Launch mISDN: /etc/init.d/misdn-init start
  • In the /etc/asterisk/misdn.conf configure the following entries:
  [general]
  ...
  language=es
  ...
  [default]
  nationalprefix=
  ...
  echocancel=yes
  ...
  [isdn]
  ; define your ports, e.g. 1,2 (depends on mISDN-driver loading order) 
  ports=1
  ; context where to go to when incoming Call on one of the above ports
  context=external
  callgroup=1
  msns=*
  • With this configuration the incoming calls go to the external context
  • Define the outgoing calls such as TRUNK, in the file /etc/asterisk/extensions.conf
  TRUNK => mISDN/g:isdn

TTS Festival configuration

Install the festival package. The festival package does not currently contain Spanish language speech sounds. Download festival-sounds-es from the ModularIT FTP site.

yumrepo.canarytek.com:/CTK/centos/4/i386/asterisk-1.2.x/RPMS/festival-sounds-es-1.4.2-1.ctk.1.i386.rpm

y lo instalamos.
And then install

  • Copy the festival.pl script from yumrepo.canarytek.com:/CTK/centos/4/i386/asterisk-1.2.x/ a /var/lib/asterisk/agi-bin
  • Add execute permission and set the owner to asterisk.
  • Install the perl-Asterisk-AGI package (obtainable from the same repository).

Note: When creating for CentOS5, at the moment you must install perl-5.8.0, if it isn't found. For now, you must copy it to a suitable install directory:

cp -av /usr/lib/perl5/site_perl/5.8.0/Asterisk* /usr/lib/perl5/site_perl/5.8.8
  • Execute the festival.pl script and ensure that it runs correctly.
  • Add the following lines to the file /usr/share/festival/init.scm if you wish to use Spanish language speech by default.
  ; Usar voces en español por defecto
  (set! voice_default voice_el_diphone)
  (voice_el_diphone)
  • To use the system include the following entries in the dialplan.
  exten => 1,1,AGI(festival.pl|spanish|'Esta es la cadena que queremos reproducir')

Spanish language voice

Thomson ST2030 telephone automatic assignment

  • Install ruby and the tftp-server on the central server:
yum install ruby tftp-server
  • Copy the thomson firmware directories to /tftpboot
  • Copy the automatic assignment scripts to /opt/Asterisk
  • Configure the telephones in /opt/Asterisk/telefonos.txt
  • Edit the phones.rb script to establish the configuration parameters (server sip, etc).
  • Execute the phones.rb script and generate the configuration files for each phone and two additional files:
    • sip_phones.conf: SIP configuration which has includes from /etc/asterisk/sip.conf with #include "/opt/Asterisk/sip_phones.conf"
    • dhcpd_phones.conf: Configuartion with DHCP which has includes from /etc/dhcpd.conf as include "/etc/dhcpd_phones.conf";

To force a reload of the configuration, add the following lines to the file /etc/asterisk/sip_notify.conf

  ; CTK: Force a read of the configuration
  [thomson-check-cfg]
  Event=>check-sync
  Content-Length=>0

To reset a phone from the Asterisk console execute: sip notify thomson-check-cfg EXTENSION

Line monitoring using the Thomson ST2030

Podemos usar las teclas programables del teléfono ST2030 para mostrar el estado de determinadas lineas. En primer lugar debemos asociar una extensión con el canal correspondiente mediante la prioridad hint
Using the programmable keys, the ST2030 is able to show the status of certain lines. First an extension has to be associated with the corresponding channel via the priority hint.

  exten => 100,hint,SIP/100

Asocia el canal SIP/100 a la extensión 100, de forma que cuando un dispositivo consulte el estado de la extensión 100, Asterisk sabe que el estado es el del canal SIP/100. En Asterisk 1.4 y posteriores debemos activar en el sip.conf la opción:
Associate the channel SIP/100 with the extension 100, so that when a device consults the state of extension 100, Asterisk knows the state of the channel SIP/100. In Asterisk 1.4 and later, activate the following option in the sip.conf

  limitonpeers = yes

And in the corresponding SIP channel, set the required call limit.

  call-limit = 2

Finally, add the programmable key section which is found within the automatic assignment configuration for the telephone:

  Current_Max_Multiline=2
  FeatureKeyExt01=S/<sip:100>
  FeatureKeyExt02=S/<sip:101>
  FeatureKeyExt03=S/<sip:102>
  FeatureKeyExt04=S/<sip:103>
  FeatureKeyExt05=S/<sip:104>
  FeatureKeyExt06=S/<sip:105>
  FeatureKeyExt07=S/<sip:106>
  FeatureKeyExt08=S/<sip:107>
  FeatureKeyExt09=S/<sip:108>
  FeatureKeyExt10=S/<sip:109>

Enter the extension to be monitored for each key. S/ means supervised line, specifying how the state of the extension can be sent. The Current_Max_Multiline entry indicates the maximum number of lines that the ST2030 can have. As each function key is associated with an internal line, a maximum of 2 lines are used (Keys F1 and F2) with the other 8 keys used to monitor other extensions. By default, _Current_Max_Multiline is set to 10 with no keys available for external extensions.

GSM Soundwin V100 gateway installation

The first step is to configure the network on the GSM gateway:

  • The gateway comes pre-configured with the static IP 192.168.1.1
  • Connect a computer directly to the WAN port and set to 192.168.1.0/24
  • Connect to 192.168.1.1 with a web browser(admin/admin).
  • Es recomendable configurarlo por DHCP con una IP estática:
  • It is recommended that you configure for DHCP with a static IP address:
    • Check the MAC address (This can be found on the label on the bottom of the appliacance).
    • Create the entry on the DHCP server.
  ## Adaptador GSM
  host gsm1 {
        hardware ethernet       00:0F:FD:48:03:70;
        fixed-address           192.168.1.39;
  }
  • Reboot DHCP.
  • Enter the Advanced Setup -> WAN Settings in the soundwin Web configuration.
  • Select DHCP and reboot the device.
  • It should start with the assigned IP address, connect using a web browser.
The next step is to ensure that the gateway is correctly connected to the GSM network.
  • Note: Insert the SIM card with the equipment turned off.
  • If the card has a PIN, it can be programmed using GSM Setup -> GSM Parameters
  • To ensure that the GSM network is properly connected, navigate to System Administration -> System Information
Once the gateway is on the network and connected to the GSM network, the outgoing calls must be configured for the gateway. The gateway has a small dialplan for determining where to route the outgoing calls. Configure it so that the numbers starting with 6 are routed by the gateway.
  • Go to Advanced Setup -> Dialing Plan
  • In the second table (Incoming Dialplan) create the following entry:
    6x,9,9,0,,GSM
  • Everything that begins with 6 and contains 9 digits is routed through the GSM line
    • Note: Some mobile numbers do not start with 6 and are added here.
  • By default the codec 723.1 is used for selecting aLaw. Go to Advanced Settings -> Telephone Advance and select codec aLaw (Europe).
The final step is to configure the SIP connection between Asterisk and the gateway:
  • Create the SIP user on the gateway
  • Go to Advanced Setup -> VOIP Basic
  • For both links (gsm and fxs, although on the second it is not used) create the user gsm/gsm
  • Establecemos el SIP Server y Realm y activamos autenticación.
  • Setup the SIP Server and Realm, and then activate authentication.
  • Save the configuration and reboot to ensure that the settings are retained.
  • Create the SIP peer in Asterisk (/etc/asterisk/sip.conf)
  [gsm]
    type=peer
    host=192.168.1.39
    context=external
    secret=gsm
    callerid=gsm
    language=es
    dtmfmode=rfc2833
    restrictid=no
    disallow=all
    qualify=yes
    allow=ulaw
    allow=alaw
    progressinband=yes 
  • A partir de este momento ya podemos enrutar llamadas a través de la pasarela mediante:
  • At this point, calls can now be routed through the gateway:
  exten => _6XXXXXXXX,n,Dial(SIP/gsm/${EXTEN})
  • Para las llamadas entrantes, configuramos la opción Hotline Settings. Para cada puerto podemos poner un numero, de forma que cuando se recibe una llamada por ese puerto, se marca dicho numero en el canal VoIP. Si el canal esta en el contexto correcto la llamada se procesara como una llamada entrante por cualquier otra línea
  • For the incoming calls, configure the Hotline Settings option. For each port we can associate a number, so that when a call is received on that port the corresponding number is dialed in the VoIP channel. If the channel is in the correct context, the call can be processed like an incoming call for any other line.
  • The options for the SIP proxy and data validation must be configured

CallerID detection with the GSM Soundwin V100

  • Go to _GSM Setup -> GSM Parameter_s
  • Activate the CLI Detection y CLI Presentation option

Hang-up detection with the GSM Soundwin V100

There are sometimes problems detecting call hang-ups with the V100. The following problem scenario has been found with Movistar lines. Note: If there are problems activate the progressinband=yes option in the SIP gateway configuration.
  • Outgoing call:
    • Establish call
      • Hang-up the receiver: OK
      • Hang-up the call: It is not detected. The line stays active until it is hung-up
  • Before establishing the call
    • Receiver rejects the call: Notifies the caller when it hangs, then the line is hung-up
      • Hang-up the call: OK
    • Voicemail is activated in the receiver: the line is released when the voicemail hangs up the call
  • Incoming call
    • Establish call
      • Hang-up the receiver: OK
      • Hang-up the call: OK
  • Before establishing the call
    • Hang-up the receiver: No se puede rechazar
    • Hang-up the caller: OK

eGroupWare agenda link installation

If there is an eGroupWare server, an AGI script can be installed so that when a call is received the eGW global agenda is consulted to obtain the CALLERID of the contact. This is a form of global caller identification service.
  • Install the perl-DBD modules:
 yum install perl-DBI perl-DBD-Pg
On the eGW machine:
  • Activate the option listen_addresses = '' * in /var/lib/pgsql/data/postgresql.conf
  • Ensure network access is allowed from the machines on the network. Add the following to the file /var/lib/pgsql/data/pg_hba.conf and reboot postgresql:
  # Permit access from the net with Asterisk
  host egroupware egroupware 192.168.1.0/24 password
  • Install the egwsetcid.agi and egwsetcid.pl scripts in /var/lib/asterisk/agi-bin
  • Check it is functioning using: ./egwsetcid.pl a_number_present_on_the_agenda
  • If everything is functioning correctly, activate the Asterisk identification using:
  exten => s,1,AGI(egwsetcid.agi|${CALLERID(num)})

Fax detection in mISDN channels

To detect Fax calls in generic channels (mISDN, SIP, IAX, etc) the nvfaxdetect application is used.
  • Copy the file app_nv_faxdetect.c which resides in asterisk-version/apps (The file is on the ModularIT FTP site).
  • Add this to the Makefile:
  APP += app_nv_faxdtect
  • Recompile and install Asterisk
  make && make install
  • To detect fax calls in the dialplan
  exten => s,n,Answer
  exten => s,n,Playtones(ring)
  exten => s,n,NVFaxDetect(4,dt)
  • A ring tone is produced so that the user is unaware whilst fax detection is attempted over a 4 second period.
  • If a fax call is detected it is passed to the fax extension.

Telephone service deployment

Preparation of the dom0 in order to export the PCI slot to the Asterisk VM

For the virtual machine to have access to the telephony card, the PCI slot connected to the virtual machine must be exported on the dom0:
  • Locate the PCI slot with the telephony card.
  lspci
  • The card is assumed to be in slot 03:02.0
  • Add the PC ID to the slots variable in the file /etc/sysconfig/pciback
  # List of PCI slots to assign to pciback
  # Find them with lspci
  SLOTS="0000:03:02.0" 
  • Execute:
  /etc/init.d/pciback start
  /etc/init.d/pciback status
  • Deberiamos ver el slot PCI gestionado por pciback
  • The PCI slot should be managed by pciback
  • Edit the virtual machine configuration file (e.g. /etc/xen/auto/asterisk) and export the PCI slot, adding the option:
  # Get with lspci
  pci = ['03:02.0']
  • Boot the Asterisk machine

Virtual machine preparation

  • Check to ensure the card can be seen:
  lspci
  • Check that misdn detects the card:
  /etc/init.d/misdn-init scan
  • Start misdn
  /etc/init.d/misdn-init start
  • If an error occurs and the modules cannot be found, the kernel has to be recompiled. Go to /usr/src/zaptel-1.4.*
  make b410p
  • And re-run:
misdn-init start