0

3rd party passes the details to the URL. It makes get request to the URL with details as url-encoded HTTP query parameters.

following is the URL sample : http://_______.com/customer_missed_call.php?CallSid=e9536ef16460727558c0db17349021b0&From=09513325525&To=08039511763&Direction=incoming&DialCallDuration=0&StartTime=2016-02-10+14%3A56%3A17&EndTime=0000-00-00+00%3A00%3A00&CallType=callattempt&DialWhomNumber=&Created=Wed%2C+10+Feb+2016+14%3A56%3A17&flow_id=67475&tenant_id=24683&CallFrom=09513325525&CallTo=8039511763&ForwardedFrom=&CurrentTime=2016-02-10+14%3A56%3A17

I want to collect the values of 'CallSid' and 'From' from this url.

I tried following codes

<?php echo $_GET; ?>

and

<?php echo utf8_decode(urldecode($_GET)); ?>

and

$URL = $_SERVER['REQUEST_URI'];
  $parsedURL=parse_url($URL);
  $URLQ=$parsedURL['CallSid'];
  echo $parsedURL;

but did not got values for any one of the above code. Please try to give effective solution for the above problem. Thanks in advance.

1
  • I think your URL is corrupted shouldn't it start with http://_______.com/customer_missed_call.php?CallSid=... ? Commented Feb 10, 2016 at 9:52

3 Answers 3

1

They are missing an ? after the .php

It should be like this:

http://_______.com/customer_missed_call.php?CallSid=e9536ef16460727558c0db17349021b0&From=09513325525&To=08039511763&Direction=incoming&DialCallDuration=0&StartTime=2016-02-10+14%3A56%3A17&EndTime=0000-00-00+00%3A00%3A00&CallType=callattempt&DialWhomNumber=&Created=Wed%2C+10+Feb+2016+14%3A56%3A17&flow_id=67475&tenant_id=24683&CallFrom=09513325525&CallTo=8039511763&ForwardedFrom=&CurrentTime=2016-02-10+14%3A56%3A17
Sign up to request clarification or add additional context in comments.

1 Comment

question mark is there. i forgot to add it in code. but problem remains same
1

The "?"-delimiter is missing in the URL

Edit: Please provide how you call the URL (the code for the request).

$_GET['CallSid']; should do the trick normally

1 Comment

the ? is there. But still unable to get the values?
0

One of the things that is likely causing an issue is that parse_url returns an array with predefined keys. The key for the query is 'query' ($parsedURL['query'];)

However using the $_GET method is much more easy to read and is easier than getting the query string and manually parsing it. To access values in it, you also need to specify a key, not just call the array itself. e.g.:

$callSID = $_GET['CallSid'];
$from = $_GET['From'];

Hope that helps

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.