diff --git a/src/PAGI/ChannelVariables/IChannelVariables.php b/src/PAGI/ChannelVariables/IChannelVariables.php index e143686..9390d2c 100644 --- a/src/PAGI/ChannelVariables/IChannelVariables.php +++ b/src/PAGI/ChannelVariables/IChannelVariables.php @@ -291,4 +291,18 @@ public function getDirectoryKey(); * @return string */ public function getDirectoryRun(); + + /** + * Returns agi_network_script. + * + * @return string + */ + public function getNetworkScript(); + + /** + * Returns agi_network. + * + * @return string + */ + public function getNetwork(); } diff --git a/src/PAGI/ChannelVariables/Impl/ChannelVariablesFacade.php b/src/PAGI/ChannelVariables/Impl/ChannelVariablesFacade.php index 0984aac..f456790 100644 --- a/src/PAGI/ChannelVariables/Impl/ChannelVariablesFacade.php +++ b/src/PAGI/ChannelVariables/Impl/ChannelVariablesFacade.php @@ -394,4 +394,22 @@ public function __construct(array $variables, array $arguments) $this->variables = $variables; $this->arguments = $arguments; } + + /** + * (non-PHPdoc) + * @see PAGI\ChannelVariables.IChannelVariables::getNetworkScript() + */ + public function getNetworkScript() + { + return $this->getAGIVariable('network_script'); + } + + /** + * (non-PHPdoc) + * @see PAGI\ChannelVariables.IChannelVariables::getNetwork() + */ + public function getNetwork() + { + return $this->getAGIVariable('network'); + } } diff --git a/test/channelvars/Test_ChannelVariables.php b/test/channelvars/Test_ChannelVariables.php index 79ed1f6..e83c769 100644 --- a/test/channelvars/Test_ChannelVariables.php +++ b/test/channelvars/Test_ChannelVariables.php @@ -104,6 +104,8 @@ public function can_get_agi_variables() $vars->getArguments() ); $this->assertFalse($vars->getArgument(4)); + $this->assertEquals($vars->getNetwork(), 'yes'); + $this->assertEquals($vars->getNetworkScript(), 'ScriptName'); $refObject = new \ReflectionObject($vars); $refMethod = $refObject->getMethod('getAGIVariable'); $refMethod->setAccessible(true); diff --git a/test/client/Test_Client.php b/test/client/Test_Client.php index 5bacb1a..ce702ff 100644 --- a/test/client/Test_Client.php +++ b/test/client/Test_Client.php @@ -69,6 +69,8 @@ 'agi_enhanced:0.0', 'agi_accountcode:123', 'agi_threadid:1105672528', + 'agi_network:yes', + 'agi_network_script:ScriptName', '' );