Preparing PBXact for its integration with utile h+ (PBX-PMS middleware)
VersiĆ³n en EspaƱol disponible
Ā
- 1 Services that will get implemented
- 2 Previous Considerations in the PBXact server
- 3 Integration Scheme
- 4 Directories Structure
- 5 Checked-in / Checked-out Status
- 6 Room Cleaned Status
- 7 Minibar Service
- 8 Alarm Clock Service (Wake-up calls)
- 9 Allow calls from administrative extensions (Reception and others) to rooms
- 10 Billing
- 11 APPENDIX A
- 12 First-time generation of the checkinout###.php files
- 13 APPENDIX B
Ā
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.
Ā
Services that will get implemented
Features supported in PBXact:
Class of service (calls permissions whetherĀ checked-in or checked-out)
Room Status (room cleaned status ; for hotel cleaning employees to register in the PMS that the room has been cleaned)
Minibar (minibar IVR for easy ordering)
Alarm management (wake-up calls)
Billing (billing for external calls dialed)
Ā
Previous Considerations in the PBXact server
SAMBA file sharing softwareĀ must be installed for being able to exchange information between utile h+ and PBXact.
Within the configuration of the extensions in PBXact, the variable HABITACION must be defined, with the room number.
Trunks for placing external calls must have the parameter "Outbound CallerID" properly set with the DID of that trunk, complying with what the Carrier expects.Ā You may have to set it with the format:
"Hotel Name" <#######>
(where: ####### is the Hotel's DID)Each and every hotel room extension must be created with a single same SIP channel driver, either PJSIP (default for utile h+ integration) orĀ CHAN_SIP, for all the rooms.
Ā
We'll be configuring points 1 & 2 next.
Ā
Integration Scheme
Ā
Ā
Directories Structure
For the information exchange between PBXact and utile h+ , a directory will be used within the PBXact system, for example, /opt/CHAR . This directory has to be visible from within the Windows computer where utile h+ is installed.
Ā
That is why, the SAMBA Server need to be installed:
yum install samba |
Ā
Once installed, place the following minimum settings in its configuration file (Ā /etc/samba/smb.conf ):
[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:
Ā
Directory
/opt/CHAR/checking ā Directory where the AGI files of eachĀ roomĀ will be found
Directory
/opt/CHAR/despertador ā Symbolic link to /var/spool/asterisk/outgoing for theĀ Alarm Service
Directory
/opt/CHAR/tarificacionĀ ā Symbolic link to /var/log/asterisk/cdr-csv
File
/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
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:
Ā
You will also have to copy the default agi:
Ā
Restart the SAMBA service to apply the changes made before on its configuration file:
Ā
Enable it to autorun every time the server boot, as well:
Ā
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:
[habitaciones] ā Outgoing Context for room extensions.
[hab-libre] ā Outgoing Context when the room is empty.
[hab-ocupada] ā Outgoing Context when theĀ room is occupied.
[servicios] ā Context where the hotel servicesĀ are located.
[extensiones] ā Outgoing Context for internal calls from room to room.
[internacionales] ā Outgoing Context for external calls outside the hotel (so that they get billed).
[roomservice]Ā ā Outgoing Context for cleaning service status (so that the cleaning person can register once the room has been cleaned).
[minibar] ā Outgoing Context for calls to minibar service.
[despertador] ā Incoming Context for the wake-up calls.
Ā
We'll configure them next, within the following sections:
Ā
Checked-in / Checked-out Status
This service is used when a room is occupied (Checked-In) or empty (Checked-Out).
So, it is necessary to control the type of outbound calls to be allowed in each of these states. To do it, in the directory /opt/CHAR/checking the utile h+ application will modify the AGI Script that will select the Context where it should look for the number to call.
All room extensions must belong to the "habitaciones" context and have defined a variable with the Room Number (HABITACION), as follows:
[101]
type=friend
secret=clave
defaultuser=101
canreinvite=no
nat=no
context=habitaciones
setvar=HABITACION=101
Ā
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):
NOTE: for CHAN_SIP extensions, the correct nomenclature is setvar (and not set_var which is for PJSIP extensions)
And so forth for all hotel room 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):
Ā
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:
Ā
[hab-libre] ā It should only allow to place hotel services calls and calls to other room extensions, configured as follows Ā (place these lines in theĀ
/etc/asterisk/extensions_custom.confĀ file):
Ā
[hab-ocupada] ā It should allow to make any call, configured as follows Ā (place these lines in theĀ
/etc/asterisk/extensions_custom.confĀ file):
Ā
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:
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.
Ā
Ā
NOTE: AGIs are generated by utile h+ directly.
Room Cleaned Status
This service will be used by the hotelās employee to indicate if the room is clean or dirty. To do so, utile h+ will read the information from the file ā/opt/CHAR/roomservice.logā.
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):
Ā
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):Ā
Ā
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:
Ā
Room Service Identifier (RS), Date and Hour of the input, Room Number, Room Status (0 - clean, 1 - dirty), Employee Code
Ā
Minibar Service
This service is used to indicate the minibar charges. To do it, utile h+ will read the information from the file /opt/CHAR/roomservice.log
To access to the service it is necessary to add a code in the [servicios] context, as followsĀ (place the bold lines in theĀ /etc/asterisk/extensions_custom.confĀ file under the previous lines already added to the [servicios] context):
[servicios]
exten=>*01,1,NoOP(-- Servicio de Habitaciones --)
exten=>*01,n,Goto(roomservice,s,1)
exten=>*02,1,NoOP(-- Servicio de MiniBAR --)
exten=>*02,n,Goto(minibar,s,1)
With this configuration we will be able to access to the minibar context where its service will be configured. It is recommended to generate at least 7 audio files for it:
Ā
minibar.gsm ā "Welcome to the Minibar service"
intro_cantidad.gsm ā "Introduce the quantity"
intro_articulo,gsm ā "Introduce the aritcle code"
cantidad.gsm ā "Quantity introducedā¦"
articulo.gsm ā "Article introducedā¦"
menuarticulo.gsm ā "Press 1 to confirm and continue, press 2 to cancel, press 3 to confirm and finish and * to access to the article list."
listacodigos ā "Whenever you want to stop hearing the article list, press a key. The article list is the following: ..."
Ā
The following context can be usedĀ (place these lines in theĀ /etc/asterisk/extensions_custom.confĀ file):
Ā
Alarm Clock Service (Wake-up calls)
This service is used when the guest ask to be woke up to a certain hour in the morming. It is based in the Call files of Asterisk that it will be generated by utile h+ and saved in the directory /opt/CHAR/despertador . That is not more than a symbolic link with /var/spool/asterisk/outgoing.
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):
Ā
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:
Ā
Channel: PJSIP/%EXTENSION%Ā āĀ Channel: SIP/%EXTENSION%
Ā
Ā
Allow calls from administrative extensions (Reception and others) to rooms
Add the following lines at the end of theĀ /etc/asterisk/extensions_custom.conf file
Ā
Ā
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:
Ā
The final step is to make sure the Asterisk changes get applied, just execute:
Ā
Ā
Ā
APPENDIX A
Optional bash Scripts for batchĀ automations
Ā
Populating the SIP custom_post.conf file
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Ā Ā could be used:
Ā
Simply run it from any LinuxĀ PC or Server (it could be run from the PBXact itself) as follows:
Ā
Make the script file executable:
chmod +xĀ populate_custom_post_file_for_utileh.shExecute it:
shĀ populate_custom_post_file_for_utileh.sh
Ā
The script will ask on screen (Linux console) for the total quantity of rooms and then for the actual number of the first room, based on this information it generates a file called "custom_post.conf" which then must be placed with the correct name (either pjsip.endpoint_custom_post.conf or sip_custom_post.conf), depending if using PJSIP or CHAN_SIP for the created Rooms extensions, and of course placed under the correct path ( /etc/asterisk/ ) with the correct owner and permissions (see APPENDIX B below).
Ā
Note: the script does not consider, for example, cases in which the rooms do not always reach 99 in every hundred (example: from room 120 skips to room 201, from 220 to 301, etc.); modifying it could achieve this behavior, or, perhaps faster/easier, simply consider those "empty spaces of rooms" when entering the total quantity of rooms during the script's execution, and then proceed to manually delete, in the generatedĀ resulting file, the lines for those rooms (extensions) that don't really exist.
Ā
Ā
First-time generation of the checkinout###.php files
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Ā together along with theĀ Ā could be used toĀ automatically generate those checkinout###.php files for every Room at once:
Ā
Place both files in the PBX, under: /opt/CHAR/checking/
Give execute permissions to theĀ script:
chmod +xĀ /opt/CHAR/checking/generate_chekinout_files_for_utileh.shChange the owner of both files to asterisk:
chown asterisk: /opt/CHAR/checking/checkinout_BASE_FILE.phpĀ /opt/CHAR/checking/generate_chekinout_files_for_utileh.shExecute theĀ scriptĀ as asterisk user:
sudo -u asterisk sh /opt/CHAR/checking/generate_chekinout_files_for_utileh.sh
Ā
The script will ask on screen (Linux console) for the total quantity of rooms and then for the actual number of the first room, based on this information it generates allĀ checkinout###.php files.
Ā
Note1: the script does not consider, for example, cases in which the rooms do not always reach 99 in every hundred (example: from room 120 skips to room 201, from 220 to 301, etc.); modifying it could achieve this behavior, or, perhaps faster/easier, simply consider those "empty spaces of rooms" when entering the total quantity of rooms during the script's execution, and then, if so desired, proceed to manually delete the files for those rooms (extensions) that don't really exist.
Ā
Note2: all generated files will have the context "hab-libre", to change this to "hab-ocupada" the corresponding room status change must be made in utile h+ (or the PMS).
Ā
Ā
Delete voicemail files after Room's status has changed to checked-out
To automatically delete every voicemail file of all the Rooms that have changed to checked-out status, the optional bash scriptĀ could be used:
Ā
Place the script on the PBX, under: /opt/
Make it executable:
chmod +x /opt/delete_vm_files.shEdit 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
Ā
Ā
Ā
APPENDIX B
Sample .conf files
Here are sample configuration (.conf) files from the integration described above, instead of adding/editing the files mentioned above right from within the PBXact server. You may consider downloading these following files and uploading them in the PBXact server under their correct paths (make sure to adjust the owner and permissions of these files accordingly after having manually uploaded them):
(root 644) /etc/samba/ :Ā
(asterisk 777) /opt/CHAR/ :Ā
(asterisk 664) /etc/asterisk/ : Ā orĀ Ā /etc/asterisk/ :Ā
(asterisk 664)Ā /etc/asterisk/ :Ā
(asterisk 664)Ā /etc/asterisk/ :Ā
Ā
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.