We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

How do I capture the caller's phone number into a php ?

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
ejohnson
Posts: 5
Joined: Mon Jun 28, 2004 2:40 pm
Location: San Diego
Contact:

How do I capture the caller's phone number into a php ?

Post by ejohnson »

How do I capture the caller's phone number into a php variable?

Is session.telephone.ani a vxml varaible or can it also be used like this: $session_telephone_ani as a php variable?

Thank you,

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

IVR- posts session.telephone.ani as session_telephone_ani

Post by support »

In order for php to get a variable the variable should be passed to it in a <submit>. Here is a basic IVR VoiceXML script that posts session.telephone.ani as session_telephone_ani:

Code: Select all

<?xml version="1.0"?>
<vxml version="2.0">
    <form>
        <block>
            <var name="session_telephone_ani" expr="session.telephone.dnis"/>
            <submit next="dynamicscript.php" method="post" namelist="session_telephone_ani"/>
        </block>
    </form>
</vxml>
The session_telephone_ani variable will now be available to any IVR server side scripting language (in this case dynamicscript.php) for processing.

Hope this helps!

The Plum Support team :)

Post Reply