Remove PAGI quickstart example for security check
Showing
3 changed files
with
0 additions
and
92 deletions
This diff is collapsed.
Click to expand it.
| 1 | #!/bin/bash | ||
| 2 | ################################################################################ | ||
| 3 | # Sample application to run from your dialplan. | ||
| 4 | ################################################################################ | ||
| 5 | # Get our base directory (the one where this script is located) | ||
| 6 | me=$(dirname ${0}) | ||
| 7 | root=${me}/../../.. | ||
| 8 | export root=`cd ${root}; pwd` | ||
| 9 | |||
| 10 | # This is the application that will be run. | ||
| 11 | export PAGIApplication=MyPAGIApplication | ||
| 12 | |||
| 13 | # Make sure this is in the include path. | ||
| 14 | export PAGIBootstrap=MyPAGIApplication.php | ||
| 15 | |||
| 16 | # PHP to run and options | ||
| 17 | php=/usr/php/bin/php | ||
| 18 | phpoptions="-c ${root}/resources/php.ini -d include_path=${root}/docs/examples/quickstart" | ||
| 19 | |||
| 20 | # Standard.. the idea is to have a common launcher. | ||
| 21 | launcher=${root}/src/mg/PAGI/Application/PAGILauncher.php | ||
| 22 | |||
| 23 | # Go! | ||
| 24 | ${php} ${phpoptions} ${launcher} | ||
| 25 |
| 1 | <?php | ||
| 2 | /** | ||
| 3 | * Spooling calls exmaples. | ||
| 4 | * | ||
| 5 | * PHP Version 5.3 | ||
| 6 | * | ||
| 7 | * Copyright 2011 Marcelo Gornstein <[email protected]> | ||
| 8 | * | ||
| 9 | * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| 10 | * you may not use this file except in compliance with the License. | ||
| 11 | * You may obtain a copy of the License at | ||
| 12 | * | ||
| 13 | * http://www.apache.org/licenses/LICENSE-2.0 | ||
| 14 | * | ||
| 15 | * Unless required by applicable law or agreed to in writing, software | ||
| 16 | * distributed under the License is distributed on an "AS IS" BASIS, | ||
| 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| 18 | * See the License for the specific language governing permissions and | ||
| 19 | * limitations under the License. | ||
| 20 | * | ||
| 21 | */ | ||
| 22 | use PAGI\CallSpool\CallFile; | ||
| 23 | use PAGI\CallSpool\Impl\CallSpoolImpl; | ||
| 24 | use PAGI\DialDescriptor\SIPDialDescriptor; | ||
| 25 | use PAGI\DialDescriptor\DAHDIDialDescriptor; | ||
| 26 | |||
| 27 | $dialDescriptor = new DAHDIDialDescriptor('1949890333', 1); | ||
| 28 | $callFile = new CallFile($dialDescriptor); | ||
| 29 | $callFile->setContext('campaign'); | ||
| 30 | $callFile->setExtension('failed'); | ||
| 31 | $callFile->setVariable('foo', 'bar'); | ||
| 32 | $callFile->setPriority('1'); | ||
| 33 | $callFile->setMaxRetries('0'); | ||
| 34 | $callFile->setWaitTime(10); | ||
| 35 | $callFile->setCallerId('some<123123>'); | ||
| 36 | |||
| 37 | echo "Call file generated (DAHDI dial descriptor):\n"; | ||
| 38 | echo $callFile->serialize(); | ||
| 39 | echo "\n\n"; | ||
| 40 | |||
| 41 | $dialDescriptor = new SIPDialDescriptor('24', 'example.com'); | ||
| 42 | |||
| 43 | $callFile = new CallFile($dialDescriptor); | ||
| 44 | $callFile->setContext('default'); | ||
| 45 | $callFile->setExtension('777'); | ||
| 46 | $callFile->setVariable('foo', 'bar'); | ||
| 47 | $callFile->setPriority('1'); | ||
| 48 | $callFile->setMaxRetries('0'); | ||
| 49 | $callFile->setWaitTime(10); | ||
| 50 | $callFile->setCallerId('some<123123>'); | ||
| 51 | |||
| 52 | echo "Call file generated (SIP dial descriptor):\n"; | ||
| 53 | echo $callFile->serialize(); | ||
| 54 | echo "\n\n\n"; | ||
| 55 | |||
| 56 | echo "Spooling generated SIP call\n"; | ||
| 57 | $spool = CallSpoolImpl::getInstance( | ||
| 58 | array( | ||
| 59 | 'tmpDir' => '/tmp', | ||
| 60 | 'spoolDir' => '/tmp/spoolExample' | ||
| 61 | ) | ||
| 62 | ); | ||
| 63 | |||
| 64 | $spool->spool($callFile); | ||
| 65 | |||
| 66 | echo "Spooling generated SIP call to run in 30 seconds\n"; | ||
| 67 | $spool->spool($callFile, time() + 30); |
-
Please register or sign in to post a comment