diff options
| author | Tim Redfern <tim@gray.(none)> | 2012-11-13 15:07:39 +0000 |
|---|---|---|
| committer | Tim Redfern <tim@gray.(none)> | 2012-11-13 15:07:39 +0000 |
| commit | f3b7df8e1a44be946bbc0cf4c2b89e2920d6d7ee (patch) | |
| tree | 547d77f1366c5beb0637b9359eb37da66bc7cd58 /vfg/src/Asterisk.h | |
| parent | 27b7b4c5ce0102c6089cd0b6cc58096b0c5ccf36 (diff) | |
initial asterisk hookup
Diffstat (limited to 'vfg/src/Asterisk.h')
| -rwxr-xr-x | vfg/src/Asterisk.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/vfg/src/Asterisk.h b/vfg/src/Asterisk.h new file mode 100755 index 0000000..b3c5fd5 --- /dev/null +++ b/vfg/src/Asterisk.h @@ -0,0 +1,62 @@ +#ifndef ASTERISK_H
+#define ASTERISK_H
+
+#include "ofMain.h"
+#include "ofxNetwork.h"
+
+#define IDLE 0
+#define WAITING 1
+#define STARTING 2
+#define PLAYING 3
+
+// http://stackoverflow.com/questions/1735781/non-blocking-pipe-using-popen
+
+/*
+
+Commands for game to control PBX
+
+Game ready
+
+ssh 10.10.10.1 'sudo /usr/sbin/asterisk -rx "devstate change Custom:GAME NOT_INUSE"'
+
+change daily access 4 digit code
+
+ssh 10.10.10.1 'sudo /usr/sbin/asterisk -rx "database put GAME passcode 1234"'
+
+
+
+Set status code for current game
+
+ssh 10.10.10.1 'sudo /usr/sbin/asterisk -rx "database put GAME statuscode 1234"'
+
+Gameover Hangup Call
+
+ssh 10.10.10.1 'sudo /usr/sbin/asterisk -rx "hangup request Local/9999@default-00000039;2"
+
+Local/9999@default-00000039;2 is a channel identifier and will be send to game when AGI script connects to game controller. The channel ID is unique for each call
+
+
+can we have a message that someone has joined the queue?
+can we have a message if someone hangs up?
+*/
+
+class Asterisk
+{
+ public:
+ Asterisk();
+ virtual ~Asterisk();
+ void startGame();
+ int update();
+ void cmd(string s);
+
+ int state;
+
+ protected:
+ private:
+ int startTime;
+ FILE *file;
+ int filenum;
+ ofxUDPManager udpConnection;
+};
+
+#endif // ASTERISK_H
|
