summaryrefslogtreecommitdiff
path: root/vfg/src/Asterisk.h
diff options
context:
space:
mode:
Diffstat (limited to 'vfg/src/Asterisk.h')
-rwxr-xr-xvfg/src/Asterisk.h40
1 files changed, 7 insertions, 33 deletions
diff --git a/vfg/src/Asterisk.h b/vfg/src/Asterisk.h
index c9ce864..0640c4b 100755
--- a/vfg/src/Asterisk.h
+++ b/vfg/src/Asterisk.h
@@ -9,56 +9,30 @@
#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();
+ void setup(string passcode="1111");
virtual ~Asterisk();
void startGame();
void endGame(string score);
int update();
- void cmd(string s);
-
+ void requestStatus();
int state;
-
+ bool isPlaying;
+
+ int queued;
protected:
+ void cmd(string s);
private:
int startTime;
FILE *file;
int filenum;
ofxUDPManager udpConnection;
string playerCode;
+
};
#endif // ASTERISK_H