TUTORIAL PIAF Hospitality Management System

johnny2000

Member
Joined
Apr 7, 2008
Messages
52
Reaction score
0
change in from-internal-custom


exten => 1XX,1,Dial(SIP/${DIAL})

exten => _X.,1,Set(result=${CURL(http://MYPBX/hotel/checkuser.php?Ext=${CALLERID(num)})})
exten => _X.,2,NoOp(Results: ${result})
exten => _X.,3,GotoIf($["${result}" = "OK"]?OK)
exten => _X.,4,GotoIf($["${result}" = "KO"]?KO)
exten => _X.,5(OK),Goto(outbound-allroutes,${DIAL},1)
exten => _X.,6,Hangup()
exten => _X.,7(KO),DIAL(SIP/RECEPTION)
exten => _X.,8,Hangup()


I have PIAF green with FBX 2.11, I installed HMS, however I'm stuck on this line:

"exten => _X.,5(OK),Goto(outbound-allroutes,${DIAL},1)"

On the asterisk cli this is what I got:

"[2014-10-08 08:58:02] WARNING[21376][C-00000003]: pbx.c:6640 __ast_pbx_run: Channel 'SIP/102-00000003' sent to invalid extension but no invalid handler: context,exten,priority=outbound-allroutes,6001,1"

Anyone have installed it with PIAF green? Thank you.
 

pigsinspace

New Member
Joined
Jan 16, 2010
Messages
12
Reaction score
1
i was using pbxinflash but now use freepbx distro. both are great.

first make sure to replace MYPBX with the ip address of your server

2nd

i use
exten => _XXXX.,n(KO),Goto(ext-group,0,1) ; used for ring groups
i have a "0" ring group that calls all of the front desk phones.
try that.
here is what my code looks like. i have this running at 4 hotels. but to tell you the truth. no-one call long distance any more
;lets guests call 7 digit local numbers without being checked in
exten => _NXXXXXX,1,Goto(outbound-allroutes,${EXTEN},1)
exten => _NXXXXXX,n,Hangup()
;lets guests call toll free numbers without being checked in
exten => _1800NXXXXXX,1,Goto(outbound-allroutes,${EXTEN},1)
exten => _1800NXXXXXX,n,Hangup()
exten => _1888NXXXXXX,1,Goto(outbound-allroutes,${EXTEN},1)
exten => _1888NXXXXXX,n,Hangup()
exten => _1877NXXXXXX,1,Goto(outbound-allroutes,${EXTEN},1)
exten => _1877NXXXXXX,n,Hangup()
exten => _1866NXXXXXX,1,Goto(outbound-allroutes,${EXTEN},1)
exten => _1866NXXXXXX,n,Hangup()
exten => _XXXX.,1,Set(result=${CURL(http://127.0.0.1/hotel/checkuser.php?Ext=${CALLERID(num)})})
exten => _XXXX.,n,NoOp(Results: ${result})
exten => _XXXX.,n,GotoIf($["${result}" = "OK"]?OK)
exten => _XXXX.,n,GotoIf($["${result}" = "KO"]?KO)
exten => _XXXX.,n(OK),Goto(outbound-allroutes,${EXTEN},1)
exten => _XXXX.,n,Hangup()
;call front desk if not checked in
exten => _XXXX.,n(KO),Goto(ext-group,0,1) ; used for ring groups
;exten => _XXXX.,n(KO),Dial(SIP/600>) ; used for just one extension does not seem to work
;exten => _XXXX.,n(KO),Goto(ext-queues,607,1); used for Queue
exten => _XXXX.,n,Hangup()
but i did write code for 911 and maid status
once entered it sends an email to the front desk and calls the front desk. the staff loves these features
 

johnny2000

Member
Joined
Apr 7, 2008
Messages
52
Reaction score
0
it works, thanks a lot, yes it seems that the line that doesn't work is this "exten => _XXXX.,n(KO),Dial(SIP/600>) ;"
you mention about the 911 and maid status? how does it work? can you share it?
 

pigsinspace

New Member
Joined
Jan 16, 2010
Messages
12
Reaction score
1
here is the basic code. it goes right above the code in my last post


;lets guests call 911 without being checked in
exten => _911,1,Noop
exten => _911,n,System(mail -s "An EMERGENCY CALL from ${CALLERID(name)} placed at ${STRFTIME(${EPOCH},,%H:%M)}" [email protected] < /etc/asterisk/emergency.txt)
exten => _911,n,System(cp /etc/asterisk/emg-system/*.call /tmp/)
exten => _911,n,System(echo "\nSetVar: ROOM=${CALLERID(num)}\nCallerID: "911 CALL Room ${CALLERID(num)}" <911>" | tee -a /tmp/*.call)
exten => _911,n,System(mv /tmp/*.call /var/spool/asterisk/outgoing/)
exten => _911,n,Goto(outbound-allroutes,${EXTEN},1)
exten => _911,n,Hangup()


;lets guests call *71 without being checked in - Maid Present
exten => _*71,1,Noop
exten => _*71,n,System(mail -s "${CALLERID(name)} in progress at ${STRFTIME(${EPOCH},,%H:%M)}" [email protected] < /etc/asterisk/blank.txt)
exten => _*71,n,answer()
exten => _*71,n,Playback(/var/lib/asterisk/sounds/custom/in)
exten => _*71,n,Playback(/var/lib/asterisk/sounds/custom/room)
exten => _*71,n,Hangup()

;lets guests call *72 without being checked in -- Room Clean
exten => _*72,1,Noop
exten => _*72,n,System(mail -s "${CALLERID(name)} clean at ${STRFTIME(${EPOCH},,%H:%M)}" [email protected] < /etc/asterisk/blank.txt)
exten => _*72,n,System(cp /etc/asterisk/maid-status/*.call /tmp/)
exten => _*72,n,System(echo "\nSetVar: ROOM=${CALLERID(num)}\nCallerID: "${CALLERID(name)} Clean" <*72>" | tee -a /tmp/*.call)
exten => _*72,n,System(mv /tmp/*.call /var/spool/asterisk/outgoing/)
exten => _*72,n,Playback(/var/lib/asterisk/sounds/custom/room)
exten => _*72,n,Playback(/var/lib/asterisk/sounds/custom/clean)
exten => _*72,n,Hangup()



and at the bottom of the file put

[emg-call-file]
exten => 10,1,Answer()
exten => 10,n,Wait(1)
exten => 10,n,Playback(en/emergency)
exten => 10,n,Playback(en/call)
exten => 10,n,Playback(en/from)
exten => 10,n,Playback(en/ha/guest-room)
exten => 10,n,SayDigits(${ROOM})
exten => 10,n,Playback(custom/emg-message)
exten => 10,n,Playback(en/ha/guest-room)
exten => 10,n,SayDigits(${ROOM})
exten => 10,n,Wait(1)
exten => 10,n,Hangup()

[room-clean-file]
exten => 10,1,Answer()
exten => 10,n,Wait(1)
exten => 10,n,Playback(custom/room)
exten => 10,n,SayDigits(${ROOM})
exten => 10,n,Playback(custom/clean)
exten => 10,n,Wait(1)
exten => 10,n,Playback(custom/room)
exten => 10,n,SayDigits(${ROOM})
exten => 10,n,Playback(custom/clean)
exten => 10,n,Wait(1)
exten => 10,n,Hangup()

[check-out-file]
exten => 10,1,Answer()
exten => 10,n,Wait(1)
exten => 10,n,Playback(custom/room)
exten => 10,n,SayDigits(${ROOM})
exten => 10,n,Playback(custom/checked)
exten => 10,n,Playback(custom/out)
exten => 10,n,Wait(1)
exten => 10,n,Playback(custom/room)
exten => 10,n,SayDigits(${ROOM})
exten => 10,n,Playback(custom/checked)
exten => 10,n,Playback(custom/out)
exten => 10,n,Wait(1)
exten => 10,n,Hangup()


i also created a file named 600.call (extent ion 600 is our front desk phone. change to whatever you use)
at etc/asterisk/emg-system/
inside file
Channel: Local/600
MaxRetries: 5
RetryTime: 10
WaitTime: 45
Context: emg-call-file
Extension: 10

i also created another file named 600.call (extent ion 600 is our front desk phone. change to whatever you use)
at etc/asterisk/maid-status/
inside file
Channel: Local/600
MaxRetries: 0
RetryTime: 10
WaitTime: 9
Account:72
Context: room-clean-file
Extension: 10


i think you have to also find or create sound files to say "room", "clean" etc...

hope that made some sense. it basically uses the same method that wakeup calls uses to call the front desk to notifiy them of a cleaned room or 911 or guest checking out.

so each time the maid enters the room they dial *71. the front desk gets an email with a timestamp saying room xxx in progress
when they are done they dial *72 (aka RC for room clean). it sends another email but more importantly calls the front desk with caller ID stating room clean.

similar for 911.
 

johnny2000

Member
Joined
Apr 7, 2008
Messages
52
Reaction score
0
here is the basic code. it goes right above the code in my last post


;lets guests call 911 without being checked in
exten => _911,1,Noop
exten => _911,n,System(mail -s "An EMERGENCY CALL from ${CALLERID(name)} placed at ${STRFTIME(${EPOCH},,%H:%M)}" [email protected] < /etc/asterisk/emergency.txt)
exten => _911,n,System(cp /etc/asterisk/emg-system/*.call /tmp/)
exten => _911,n,System(echo "\nSetVar: ROOM=${CALLERID(num)}\nCallerID: "911 CALL Room ${CALLERID(num)}" <911>" | tee -a /tmp/*.call)
exten => _911,n,System(mv /tmp/*.call /var/spool/asterisk/outgoing/)
exten => _911,n,Goto(outbound-allroutes,${EXTEN},1)
exten => _911,n,Hangup()


;lets guests call *71 without being checked in - Maid Present
exten => _*71,1,Noop
exten => _*71,n,System(mail -s "${CALLERID(name)} in progress at ${STRFTIME(${EPOCH},,%H:%M)}" [email protected] < /etc/asterisk/blank.txt)
exten => _*71,n,answer()
exten => _*71,n,Playback(/var/lib/asterisk/sounds/custom/in)
exten => _*71,n,Playback(/var/lib/asterisk/sounds/custom/room)
exten => _*71,n,Hangup()

;lets guests call *72 without being checked in -- Room Clean
exten => _*72,1,Noop
exten => _*72,n,System(mail -s "${CALLERID(name)} clean at ${STRFTIME(${EPOCH},,%H:%M)}" [email protected] < /etc/asterisk/blank.txt)
exten => _*72,n,System(cp /etc/asterisk/maid-status/*.call /tmp/)
exten => _*72,n,System(echo "\nSetVar: ROOM=${CALLERID(num)}\nCallerID: "${CALLERID(name)} Clean" <*72>" | tee -a /tmp/*.call)
exten => _*72,n,System(mv /tmp/*.call /var/spool/asterisk/outgoing/)
exten => _*72,n,Playback(/var/lib/asterisk/sounds/custom/room)
exten => _*72,n,Playback(/var/lib/asterisk/sounds/custom/clean)
exten => _*72,n,Hangup()



and at the bottom of the file put

[emg-call-file]
exten => 10,1,Answer()
exten => 10,n,Wait(1)
exten => 10,n,Playback(en/emergency)
exten => 10,n,Playback(en/call)
exten => 10,n,Playback(en/from)
exten => 10,n,Playback(en/ha/guest-room)
exten => 10,n,SayDigits(${ROOM})
exten => 10,n,Playback(custom/emg-message)
exten => 10,n,Playback(en/ha/guest-room)
exten => 10,n,SayDigits(${ROOM})
exten => 10,n,Wait(1)
exten => 10,n,Hangup()

[room-clean-file]
exten => 10,1,Answer()
exten => 10,n,Wait(1)
exten => 10,n,Playback(custom/room)
exten => 10,n,SayDigits(${ROOM})
exten => 10,n,Playback(custom/clean)
exten => 10,n,Wait(1)
exten => 10,n,Playback(custom/room)
exten => 10,n,SayDigits(${ROOM})
exten => 10,n,Playback(custom/clean)
exten => 10,n,Wait(1)
exten => 10,n,Hangup()

[check-out-file]
exten => 10,1,Answer()
exten => 10,n,Wait(1)
exten => 10,n,Playback(custom/room)
exten => 10,n,SayDigits(${ROOM})
exten => 10,n,Playback(custom/checked)
exten => 10,n,Playback(custom/out)
exten => 10,n,Wait(1)
exten => 10,n,Playback(custom/room)
exten => 10,n,SayDigits(${ROOM})
exten => 10,n,Playback(custom/checked)
exten => 10,n,Playback(custom/out)
exten => 10,n,Wait(1)
exten => 10,n,Hangup()


i also created a file named 600.call (extent ion 600 is our front desk phone. change to whatever you use)
at etc/asterisk/emg-system/
inside file
Channel: Local/600
MaxRetries: 5
RetryTime: 10
WaitTime: 45
Context: emg-call-file
Extension: 10

i also created another file named 600.call (extent ion 600 is our front desk phone. change to whatever you use)
at etc/asterisk/maid-status/
inside file
Channel: Local/600
MaxRetries: 0
RetryTime: 10
WaitTime: 9
Account:72
Context: room-clean-file
Extension: 10


i think you have to also find or create sound files to say "room", "clean" etc...

hope that made some sense. it basically uses the same method that wakeup calls uses to call the front desk to notifiy them of a cleaned room or 911 or guest checking out.

so each time the maid enters the room they dial *71. the front desk gets an email with a timestamp saying room xxx in progress
when they are done they dial *72 (aka RC for room clean). it sends another email but more importantly calls the front desk with caller ID stating room clean.

similar for 911.

Thank you for sharing it, however did you figure out the billing section? It seems that it is not recording the calls. I did a test and even though there was a call, but when I check out, the billing total is zero.
 

pigsinspace

New Member
Joined
Jan 16, 2010
Messages
12
Reaction score
1

johnny2000

Member
Joined
Apr 7, 2008
Messages
52
Reaction score
0
I have rates set up, and the authentication for the database connection is the same as the PIAF config file. I even change the user to root and use the passw0rd ... password, and still I don't see any record of calls at all on the billing. Under the billing, what does the "type" column means? Do I need to enter anything in it?
 

pigsinspace

New Member
Joined
Jan 16, 2010
Messages
12
Reaction score
1
Hummm
i think the type field is just a name. can be anything. i have one call longDistance

make sure to read all of this blog. there were a few tricks. but maybe it just does not work with the latest version of pbxinaflash. hard to say. i think the only thing i had to do to get it work on the freepbx distro is change the usernames and passwords. my notes on that i think are on page 4 of this blog.

i am still guessing it can not log into one of the databases
 

johnny2000

Member
Joined
Apr 7, 2008
Messages
52
Reaction score
0
Hummm
i think the type field is just a name. can be anything. i have one call longDistance

make sure to read all of this blog. there were a few tricks. but maybe it just does not work with the latest version of pbxinaflash. hard to say. i think the only thing i had to do to get it work on the freepbx distro is change the usernames and passwords. my notes on that i think are on page 4 of this blog.

i am still guessing it can not log into one of the databases


Strange, out of 6 calls I made only one calls show on the bill. Does the billing round off the minutes? Is there a minimum number of minutes before it calculates against the rate? To make sure that the connection with the 3 databases are correct, one by one I changed the password to an unknown password, and I get a database error, so it means that the databases are connected properly when I put back the correct passwords for the databases since I am not getting any errors at all. Do you know which tables does it need to read the data from asterisk and asteriskcdrb? And which php file does the accessing of the tables in the asterisk and asteriskcdrb databases? Thank you.
 

unsichtbarre

Member
Joined
May 17, 2009
Messages
140
Reaction score
5
I have installed the PIAF Hospitality Management System on an Ubuntu 14.04-based deployment of Incredible PBX (non-PIAF). So far, so good. Everything seems to work perfectly, but not much testing yet.

Does anyone know of any gotcha's or problems with this deployment?

THX,

-J
 

cyberco

New Member
Joined
Aug 30, 2010
Messages
10
Reaction score
5
Kyle the original is still on github. our version is available on request
 

cyberco

New Member
Joined
Aug 30, 2010
Messages
10
Reaction score
5
Whats the diff?

have a look at page i posted earlier and you will see the differences.

Also the original seems dead have tried to contact original Dev but no reply, our version include room clean, billing , printing wake upcalls showing if set by room or reception. access levels using freepbx user management
 

kyle95wm

Phone Genius Owner
Joined
Apr 16, 2016
Messages
520
Reaction score
90
I can't see why this can't be published for download. Why all the secrecy?
 

chris_c_

Active Member
Joined
Aug 19, 2010
Messages
509
Reaction score
67
Hi. If anyone is interested still in this software I have been udating it a bit and adding features such as bill printing and sales tax

short description is at http://www.cyber-cottage.eu/?p=1714

Ian
@johnny2000 @cyberco @kyle95wm
Go to the original repo page https://github.com/claudiopizzillo/PIAF-HMS
Click Fork
Edit the file you changed. Paste in your changed file and save.
Click New Pull request and make it against the original repo, PIAF-HMS/master.

This way, all benefit from your cool updates! And no more clutter on chat forum with unwieldy pages of code.
 

Members online

No members online now.

Forum statistics

Threads
25,810
Messages
167,755
Members
19,240
Latest member
nikko
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top