I recently wrote a mashup that uses reverse lookup information from Whitepages.com. The mashup uses two Survos from Ifbyphone. The first one simply passes the caller ID to the PHP code below. The second Survo reads back the message we construct below. You can hear the mashup in action (for a limited time) at 866.390.9675. Here is the code:
<?php
// CAPTURE THE BUSINESS PHONE NUMBER SENT FROM IFBYPHONE $phone = $_REQUEST['phone'];
//Add spaces to the phone number so TTS speaks it as single digits
$message = "The number you are calling from is $formattedphonenum . . "; $type = $obj->listings[0]->phonenumbers[0]->type; if (is_null($type)){ $message .= "I cannot determine whether you are calling from a landline or a mobile phone. "; } else{ $message .= "I think you are calling from a " . $type . " phone. "; } $displayname = $obj->listings[0]->displayname; if (is_null($displayname)){ $message .= "Also, I could not find a name associated with this number"; } else { $message .= "I see that the name associated with this number is " . $obj->listings[0]->displayname; } $xml_return = "<action> <app>survo</app> <parameters> <id>$valid_business_survo</id> <user_parameters> <message>$message</message> </user_parameters> </parameters> </action>"; echo $xml_return;
?>
-- Edited by KhyleK on Friday 10th of July 2009 11:46:26 AM