File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -683,7 +683,7 @@ public function verbose($message, $level = 1)
683683 *
684684 * @link http://www.voip-info.org/wiki-wait+for+digit
685685 * @param integer $timeout in millisecons. Use -1 for the timeout value if you want the call to wait indefinitely.
686- * @return int Digit received
686+ * @return null|string Digit received
687687 * @throws Exception
688688 */
689689 public function waitForDigit ($ timeout = -1 )
@@ -700,6 +700,31 @@ public function waitForDigit($timeout = -1)
700700 return chr ($ result ['result ' ]);
701701 }
702702
703+ public function wait ($ sec )
704+ {
705+ return $ this ->exec ('wait ' , $ sec );
706+ }
707+
708+ /**
709+ * @param string $sound
710+ * @return null|string
711+ * @throws Exception
712+ */
713+ public function background ($ sound )
714+ {
715+ $ result = $ this ->exec ('background ' , $ sound );
716+
717+ if ($ result ['code ' ] != '200 ' ) {
718+ throw new Exception ('Error while executing BACKGROUND cmd ' );
719+ }
720+
721+ if ($ result ['result ' ] == '0 ' ) {
722+ return null ;
723+ }
724+
725+ return chr ($ result ['result ' ]);
726+ }
727+
703728 /**
704729 * Set absolute maximum time of call.
705730 *
You can’t perform that action at this time.
0 commit comments