Skip to content

Instantly share code, notes, and snippets.

View mheadd's full-sized avatar

Mark Headd (He/Him) mheadd

View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<vxml xmlns="http://www.w3.org/2001/vxml" version="2.1">
<!--
This work is licensed under a Creative Commons License
To review this license, go to http://creativecommons.org/licenses/by-sa/3.0/us/
-->
<meta name="maintainer" content="mheadd@tele-works.com" />
<?php
include('my/local/directory/php-lib/init.php');
$text = "Hello world!";
$p = <p>{$text}</p>;
echo <html>
<head>
<?php
/*
* Contents of vxml.php
*/
abstract class :xhp:vxml-element extends :x:primitive {
protected
$tagName;
<?php
include('my/local/directory/php-lib/init.php');
function setMessageBlock($id, $logtext, $prompttext) {
$log = <log>*** {$logtext} ***</log>;
$prompt = <prompt>{$prompttext}</prompt>;
return <block name={$id}>{$log}{$prompt}</block>;
@mheadd
mheadd / 1_collect_phone.php
Created February 18, 2010 21:17
Helper Classes for using CloudVox API (with examples)
<?php
/*
* Render a simple dialog asking for a caller's phone number.
*/
// Include CloudVox JSON helper classes.
include('cloudvox-json-http-classes.php');
$speak = new Speak("Welcome to my demo application.");
<IfModule mod_rewrite.c>
Options +FollowSymlinks
Options +Indexes
RewriteEngine on
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1
</IfModule>
<?php
/**
*
* Copyright 2009 Mark J. Headd
* http://www.voiceingov.org
*
* A set of PHP classes for working with the Open311 API (http://open311.org/)
*
*/
{
"tropo": [
{
"say": {
"value": "Hello. Welcome to my demo application."
}
},
{
"ask": {
"attempts": 3,
<?php
// Include Limonade PHP Framework (http://www.limonade-php.net/).
require('path/to/limonade/lib/limonade.php');
// Include Tropo classes (http://github.com/mheadd/TropoPHP).
require('path/to/TropoClasses.php');
dispatch_post('/start', 'tropo_start');
function tropo_start() {
<?php
// This is what the ask method in the main Tropo class will look like.
...
public function ask($prompt, Array $options) {
$say = new say($prompt);
$choices = isset($options["choices"]) ? new choices($options["choices"]) : null;
$ask = new ask($options["attempts"], $options["bargein"], $choices, $options["minConfidence"], $options["name"], $options["required"],
$say, $options["timeout"]);