Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class TestController extends \yii\base\Controller
- {
- const ROUTE = parent::ROUTE.'/test';
- public $defaultAction = 'welcome';
- /**
- * @throws \yii\base\InvalidArgumentException
- * @throws \Twilio\Exceptions\TwimlException
- */
- public function actionWelcome()
- {
- $response = new Twiml();
- $response->say('Hello. Calling SIP now.', ['voice' => 'alice']);
- $dial = $response->dial();
- $dial->sip(self::SIP, ['username' => 'testuser', 'password' => '*******']);
- echo $response;
- }
- public function actionSip() {
- $response = new Twiml();
- $response->say('Hi. Welcome to your SIP connection.', ['voice' => 'alice']);
- $response->hangup();
- echo $response;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement