source-Send_to_URL.php
| 1 | <?php
|
|---|---|
| 2 | //this file is designed to be used as an include that is part of a loop.
|
| 3 | //If a valid match is found, it should give $caller_id a value
|
| 4 | //available variables for use are: $thenumber
|
| 5 | //retreive website contents using get_url_contents($url);
|
| 6 | |
| 7 | //configuration / display parameters
|
| 8 | //The description cannot contain "a" tags, but can contain limited HTML. Some HTML (like the a tags) will break the UI.
|
| 9 | $source_desc = "This source will send the number and the Caller ID to an URL for external processing.<br>The URL you enter will be sent, with the following appended to it:<br>?thenumber=<i>the CID number</i>&CLID=<i>the CID Name</i><br>This datasource should be one of the last data sources on your list, as it does not provide any data of its own, and can only send what information has been collected before it is run.";
|
| 10 | $source_param = array();
|
| 11 | $source_param['URL_address']['desc'] = 'Specify the URL to call after a CLID was found.'; |
| 12 | $source_param['URL_address']['type'] = 'text'; |
| 13 | $source_param['URL_address']['default'] = ''; |
| 14 | |
| 15 | |
| 16 | if($usage_mode == 'post processing') |
| 17 | {
|
| 18 | if (($run_param['URL_address'] !='') && ($first_caller_id != '')) |
| 19 | {
|
| 20 | $url=$run_param['URL_address'].'?thenumber='.$thenumber.'&CLID='.$first_caller_id; |
| 21 | if($debug)
|
| 22 | {
|
| 23 | print 'Send to URL: '.$url.'<br><br>'; |
| 24 | } |
| 25 | $value = get_url_contents($url); |
| 26 | } |
| 27 | } |
| 28 | ?> |