Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Versión en Español disponible

Utile h+ is a middleware that aims to integrate IP-PBX platforms with Property Management Systems (PMS). This guide describes the configurations needed on the PBXact server for the integration to be established.

...

That is why, the SAMBA Server need to be installed:

Code Block
yum install samba

Once installed, place the following minimum settings in its configuration file ( /etc/samba/smb.conf ):

Code Block
[global]
server string = PBXact Server-CHAR %h
obey pam restrictions = Yes
 
follow symlinks = yes
wide links = yes
unix extensions = no
 
security = user
map to guest = Bad User
 
passdb backend = tdbsam
 
pam password change = Yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
unix password sync = Yes
log file = /var/log/samba/log.%m
max log size = 1000
dns proxy = No
panic action = /usr/share/samba/panic-action %d
load printers = no
 
[ASTCHAR]
comment = PBXact communications directory - CHAR
path = /opt/CHAR/
force user = asterisk
printable = no
read only = No
create mask = 0777
directory mask = 0777
guest ok = Yes
locking = No
volume = ASTCHAR

Once the SAMBA configuration has been set, it is necessary to create the following directory structure inside the  /opt/CHAR path:

...

/opt/CHAR/codigos.txt → Employees codes so that they can get validated when calling to register the room as clean and also for registering in the log files which employee cleaned the room

Code Block
mkdir /opt/CHAR
mkdir /opt/CHAR/checking
mkdir /opt/CHAR/tarificacion
 
------ (example) ------
echo 72638 >> /opt/CHAR/codigos.txt
------ (example) ------
 
ln -s /var/spool/asterisk/outgoing /opt/CHAR/despertador
ln -s /var/log/asterisk/cdr-csv /opt/CHAR/tarificacion 

NOTE: remember to assign the correct owner and give appropriate permissions, just execute the following:

Code Block
chmod -R 777 /opt/CHAR
chmod -R 777 /var/log/asterisk
chown -R asterisk.asterisk /opt/CHAR

You will also have to copy the default agi:

Code Block
cp /var/lib/asterisk/agi-bin/* /opt/CHAR/checking/

Restart the SAMBA service to apply the changes made before on its configuration file:

Code Block
service smb restart

Enable it to autorun every time the server boot, as well:

Code Block
systemctl enable smb

The following minimum contexts can be defined within the asterisk file: /etc/asterisk/extensions_custom.conf where we specify certain configuration parameters for the room extensions:

...

As indicated, the last two lines (context and setvar) are the ones allowing the integration of PBXact with utile h+ . For these lines to be properly added to the room extensions, the /etc/asterisk/pjsip.endpoint_custom_post.conf  (or /etc/asterisk/sip_custom_post.conf  if the hotel room extensions rather use the CHAN_SIP channel driver) file should be edited as follows (example):

Code Block
[101](+)
context=habitaciones
set_var=HABITACION=101
 
[102](+)
context=habitaciones
set_var=HABITACION=102
 
.
.
.

NOTE: for CHAN_SIP extensions, the correct nomenclature is setvar (and not set_var which is for PJSIP extensions)

...

The [habitaciones] context, point in asterisk's dialplan from where the room extensions will start at for each placed call, should be as follows (place these lines in the /etc/asterisk/extensions_custom.conf file):

Code Block
[habitaciones]
exten=>_X.,1,NoOP(-- Llamada desde la habitacion ${HABITACION})
exten=>_X.,n,Set(CDR(userfield)=${HABITACION})
exten=>_X.,n,AGI(/opt/CHAR/checking/checkinout${HABITACION}.php)
exten=>_X.,n,Goto(${CONTEXTO},${EXTEN},1)
 
exten=>_*.,1,NoOP(-- Llamada desde la habitacion ${HABITACION})
exten=>_*.,n,Set(CDR(userfield)=${HABITACION})
exten=>_*.,n,AGI(/opt/CHAR/checking/checkinout${HABITACION}.php)
exten=>_*.,n,Goto(${CONTEXTO},${EXTEN},1)

Once configured, room extensions will be able to call hotel services or any number, depending on the result of the executed AGI script executed, as it will set a call with the context [hab-ocupada] or with the context [hab-libre], which may be configured as follows:

...

/etc/asterisk/extensions_custom.conf file):

Code Block
[hab-libre]
include=>roomservice
exten=>i,1,NoOP(-- Llamada no permitida --)
exten=>i,n,Playback(invalid)
exten=>i,n,Hangup()

  • [hab-ocupada] → It should allow to make any call, configured as follows  (place these lines in the 

/etc/asterisk/extensions_custom.conf file):

Code Block
[hab-ocupada]
include=>servicios
include=>extensiones
;include=>nacionales
;include=>moviles
include=>internacionales
;include=>especiales
exten=>i,1,NoOP(-- Llamada no permitida --)
exten=>i,n,Playback(invalid)
exten=>i,n,Hangup()

To be able to dial to other rooms and to place external calls, the contexts [extensiones] and [internacionales] have to be added to the /etc/asterisk/extensions_custom.conf file as well respectively:

Code Block
[extensiones]
exten => _ZXX,1,NoOP(-- Llamada a otra habitación ---)
same => n,Dial(PJSIP/${EXTEN})
same => n,Hangup

NOTE 1: ZXX  will allow for the dialing of any extension from 100 to 999 (see DIAL PATTERN INFO), if the hotel room extensions follow rather a different pattern (perhaps four digits numbers), this has to be adjusted accordingly.
NOTE 2: PJSIP/${EXTEN} may need to be changed to SIP/${EXTEN} if the hotel room extensions were rather created using the CHAN_SIP channel driver.

Code Block
[internacionales]
exten => _X.,1,NoOP(-- Contexto extensiones --- Llamada Internacional ---)
same => n,Goto(from-internal,${EXTEN},1)
same => n,Hangup

NOTE: AGIs are generated by utile h+ directly.

...

To access the service, it is necessary to add a code in the service context, as follows (place these lines in the /etc/asterisk/extensions_custom.conf file):

Code Block
[servicios]
exten=>*01,1,NoOP(-- Servicio de Habitaciones --)
exten=>*01,n,Goto(roomservice,s,1)

With this configuration, we will be able to access the roomservice context, where the service calls will be configured. To configure this, at least 1 audio file is recommended to be generated (see System Recordings Module User Guide):

  • room-cleaning-service.gsm → “Room Cleaning Service. Press 0 if the room is clean, or press 1 if it is not clean”.

...

The file “/opt/CHAR/codigos.txt” will be used to validate the code entered by the employee and be able to log it for the PMS (date, time, employee cleaning which room). The following context can be used (place these lines in the /etc/asterisk/extensions_custom.conf file): 

Code Block
[roomservice]
exten=>s,1,NoOP(servicio de habitacion)
exten=>s,n,Answer()
exten=>s,n,Playback(room-service)
exten=>s,n,Authenticate(/opt/CHAR/codigos.txt,a)
exten=>s,n(opcion),Read(ESTADO,custom/room-cleaning-service,1,,2,15)
exten=>s,n,GotoIF($[ ${ESTADO} == 0 || ${ESTADO} == 1 ]?registro)
exten=>s,n,Goto(opcion)
exten=>s,n(registro),System(echo "RS ${STRFTIME(,,%d/%m/%Y %H:%M)} ${HABITACION} ${ESTADO} ${CDR(accountcode)}" >> /opt/CHAR/roomservice.log)
exten=>s,n,Playback(thanks-for-using)
exten=>s,n,Playback(room-service)
exten=>s,n,Hangup()

NOTE: the format for each one of the lines that will get stored in the log to be transferred to the PMS (roomservice.log) is the following:

...

The following context can be used (place these lines in the /etc/asterisk/extensions_custom.conf file):

Code Block
[minibar]
exten=>s,1,NoOP(--Servicio de Minibar--)
exten=>s,n,Answer()
exten=>s,n,Playback(custom/minibar)
exten=>s,n(intro),READ(CANTIDAD,custom/intro_cantidad,1,,1,15)
exten=>s,n,GotoIF($[ "${CANTIDAD}" == "" ]?intro)
exten=>s,n,READ(ARTICULO,custom/intro_articulo,1,,1,15)
exten=>s,n,GotoIF($[ "${ARTICULO}" == "" ]?intro)
exten=>s,n,Playback(custom/cantidad)
exten=>s,n,SayNumber(${CANTIDAD})
exten=>s,n,Playback(custom/articulo)
exten=>s,n,SayNumber(${ARTICULO})
exten=>s,n(confirmar),READ(OPCION,custom/menuarticulo,1,,1,15)
exten=>s,n,GotoIF($[ ${OPCION} == 1]?1,1)
exten=>s,n,GotoIF($[ ${OPCION} == 2]?2,1)
exten=>s,n,GotoIF($[ ${OPCION} == 3]?3,1)
exten=>s,n,GotoIF($[ "${OPCION}" == "*" ]?*,1)
exten=>s,n,Goto(confirmar)
exten=>1,1,NoOP(--Confirmar y seguir--)
exten=>1,n,System(echo "MB ${STRFTIME(,,%d/%m/%Y %H:%M)} ${HABITACION} ${CANTIDAD} ${ARTICULO} ${CDR(accountcode)}" >> /opt/CHAR/roomservice.log)
exten=>1,n,Goto(s,intro)
exten=>2,1,NoOP(--Anular la entrada--)
exten=>2,n,Goto(s,intro)
exten=>3,1,NoOP(--Confirmar y salir--)
exten=>3,n,System(echo "MB ${STRFTIME(,,%d/%m/%Y %H:%M)} ${HABITACION} ${CANTIDAD} ${ARTICULO} ${CDR(accountcode)}" >> /opt/CHAR/roomservice.log)
exten=>3,n,Playback(thanks-for-using)
exten=>3,n,Playback(custom/minibar)
exten=>3,n,Hangup()
exten=>*,1,NoOP(--Acceder a la lista de articulos--)
exten=>*,n,Read(VOLVER,custom/listacodigos,1,,1,15)
exten=>*,n,Goto(s,intro)

Alarm Clock Service (Wake-up calls)

...

The context for the wake up service is the “despertador” context and it can be as follows (place these lines in the /etc/asterisk/extensions_custom.conf file):

Code Block
[despertador]
exten=>s,1,NoOP(--Servicio de Despertador--)
exten=>s,n,Answer()
exten=>s,n,Playback(wakeup-call)
exten=>s,n,Playback(current-time-is)
exten=>s,n,SayUnixTime(,,IMp)
exten=>s,n,Wait(1)
exten=>s,n,Playback(thanks-for-using)
exten=>s,n,Playback(wakeup-call)
exten=>s,n,Hangup()

NOTE: it may be necessary to modify the template file for generating the wake-up calls according to the SIP channel driver the hotel room extensions were created with (CHAN_SIP or PJSIP). This is done by editing the reminder_template.call file inside the Windows computer running the utile h+ software, specifically located at: C:\CHARWIN\asterisk\hlink\reminder_template.call  Simply change in the first line from PJSIP to SIP if the hotel room extensions use the CHAN_SIP channel driver and not the PJSIP driver:

...

Add the following lines at the end of the /etc/asterisk/extensions_custom.conf file

Code Block
[from-internal-custom]
include => extensiones

Billing

Every external call placed from a room extension is accounted and transferred accordingly to utile h+ which in turn sends the information to the PMS. For this integration, the following has to be included in the /etc/asterisk/cdr.conf file:

Code Block
[csv]
usegmtime=yes
loguniqueid=yes
loguserfield=yes
accountlogs=yes

The final step is to make sure the Asterisk changes get applied, just execute:

Code Block
fwconsole restart

APPENDIX A

Optional bash Scripts for batch automations

...

For automatically populating the /etc/asterisk/pjsip.endpoint_custom_post.conf  (or /etc/asterisk/sip_custom_post.conf  if the hotel room extensions rather use the CHAN_SIP channel driver and not PJSIP) file, the optional bash script 

View file
namepopulate_custom_post_file_for_utileh.sh
 could be used:

Simply run it from any Linux PC or Server (it could be run from the PBXact itself) as follows:

...

The first time a Room's status is set as either Checked-In or Checked-Out via utile h+ (or via the PMS itself), utile h+ generates a corresponding checkinout###.php file and places it inside the PBX under /opt/CHAR/checking/ as mentioned before; if considered, the optional bash script 

View file
namegenerate_chekinout_files_for_utileh.sh
together along with the 
View file
namecheckinout_BASE_FILE.php
 could be used to automatically generate those checkinout###.php files for every Room at once:

...

To automatically delete every voicemail file of all the Rooms that have changed to checked-out status, the optional bash script 

View file
namedelete_vm_files.sh
could be used:

  1. Place the script on the PBX, under: /opt/

  2. Make it executable:
    chmod +x /opt/delete_vm_files.sh

  3. Edit the crontab (crontab -e) and add the cronjob line that will make the script run periodically. Examples:
    a) If wanting for the script to run every day at 13h30: 30 13 * * * /usr/bin/sh /opt/delete_vm_files.sh
    b) If wanting for the script to run every 10 minutes: */10 * * * * /usr/bin/sh /opt/delete_vm_files.sh

Warning

The script will also delete any possible customized voicemail greetings files reproduced to callers before they can leave a voicemail message, if such customized voicemail greetings files are to be used in the Hotel, rather use the bash script

View file
namedelete_vm_files_except_custom_greetings.sh
instead.

Note that if no customized voicemail greetings files exist, the PBX will simply just reproduce to callers, before they can leave a voicemail message, the voicemail announcement that comes already predetermined with the system.

...

(root 644) /etc/samba/ : 

View file
namesmb.conf

(asterisk 777) /opt/CHAR/ : 
View file
namecodigos.txt

(asterisk 664) /etc/asterisk/ :  
View file
namepjsip.endpoint_custom_post.conf
  or  /etc/asterisk/ : 
View file
namesip_custom_post.conf

(asterisk 664) /etc/asterisk/ : 
View file
nameextensions_custom.conf

(asterisk 664) /etc/asterisk/ : 
View file
namecdr.conf

Sangoma Professional Services are able to provide PBXact configuration support and it is limited to the PBXact configuration.  utile h+ is without any warranty from Sangoma as this is a third party integration. End users are responsible for obtaining their own utile h+ support.