Skip to content

Commit

Permalink
updated adding title to input method when skipping helpline routng as…
Browse files Browse the repository at this point in the history
… well as updated readme
  • Loading branch information
pjaudiomv committed Feb 26, 2018
1 parent 29160f9 commit 310038a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ You can also tie this into an existing extension based system, say for example G

When configuring the TwiML app instead of pointing to `index.php` point to `input-method.php?Digits=2`.

If you still want the title to display also point to `input-method.php?Digits=2&PlayTitle=1`.

## Including province prior to lookup

It may be that your yap instance needs to search multiple states. By default yap will be biased towards the local number state (unless it's tollfree). To enable province lookup set the `$province_lookup`, variable to `true` in the `config.php` file.
Expand Down
8 changes: 8 additions & 0 deletions input-method.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";

$searchType = $_REQUEST['Digits'];
$playTitle = isset($_REQUEST['PlayTitle']) ? $_REQUEST['PlayTitle'] : 0;

if ($searchType == "1") {
$searchDescription = "someone to talk to";
Expand All @@ -14,6 +15,13 @@
?>
<Response>
<Gather numDigits="1" timeout="10" action="input-method-result.php?SearchType=<?php echo $searchType ?>" method="GET">

<?php
if ($playTitle == "1") {
echo "<Say voice=\"" . $voice . "\" language=\"" . $language . "\">" . $GLOBALS['title'] . "</Say>";
}
?>

<Say voice="<?php echo $voice; ?>" language="<?php echo $language; ?>">Press 1 to search for <?php echo $searchDescription ?> by city or county name.</Say>
<Say voice="<?php echo $voice; ?>" language="<?php echo $language; ?>">Press 2 to search for <?php echo $searchDescription ?> by zip code.</Say>
</Gather>
Expand Down

0 comments on commit 310038a

Please sign in to comment.