Reputation: 8608
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
Upvotes: 0
Views: 2116
Reputation: 306
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 the
conf_handler.phpin the
callbackUrl`, 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.
Upvotes: 1