Question

I am using plivo and have calls answered by welcome.php as my welcome url.

When a call is answered, I pass it to conf_handler.php and enter it into a conference:

    $conf_attr = array(
        'callbackUrl' => $host.'conf_handler.php',
        'callbackMethod' => "POST",
        );

    $r->addConference($conf_name,$conf_attr);

    echo($r->toXML());

How can I store both the callUUID and call_duration (once hang up) as a variables within conf_handler.php? Are they posted to the page with the callbackMethod? Or do I need to somehow use GET to look them up (how would I do this?) http://plivo.com/docs/api/call/#call_detail

Was it helpful?

Solution

you can do both ways.

1) From hangup_url (within your welcome.php). When a call is answered, Plivo sends a POST request with a set of parameters including the two. So you can parse the request from there. (Check out the "Request Parameters" section at http://plivo.com/docs/xml/request/)

2) From callbackUrl (within your conf_handler.php'). Once you set up theconf_handler.phpin thecallbackUrl`, Plivo will send a set of parameters as described at http://plivo.com/docs/xml/dial/#dialcallbackUrl

After that, you just need to parse the POST request and store as variables. (perhaps you could refer to http://www.tutorialspoint.com/php/php_get_post.htm)

Let me know if anything isn't clear. And I work at Plivo.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top