From bd621591aae6047d28067b445c06f9344cf4582e Mon Sep 17 00:00:00 2001 From: azammitdcarf Date: Tue, 9 Dec 2008 22:43:44 +0000 Subject: [PATCH] functions.voip.php connect() method uses defaults from config.default.php instead of hard coded strings --- config.default.php | 5 +++++ functions/functions.voip.php | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/config.default.php b/config.default.php index 3a9aeba1..7afae19f 100644 --- a/config.default.php +++ b/config.default.php @@ -79,6 +79,11 @@ if (!defined('VOIP_ADMIN_USER')) define('VOIP_ADMIN_USER','admin'); */ if (!defined('VOIP_ADMIN_PASS')) define('VOIP_ADMIN_PASS','amp111'); +/** + * The Asterisk server port for the monitor interface + */ +if (!defined('VOIP_PORT')) define('VOIP_PORT','5038'); + /** * The meet me room id for the VOIP Server */ diff --git a/functions/functions.voip.php b/functions/functions.voip.php index 014e4eaa..eca73135 100644 --- a/functions/functions.voip.php +++ b/functions/functions.voip.php @@ -265,9 +265,9 @@ class voip { * * @return bool True if connected successfully, else false */ - function connect($ip,$user="admin",$pass="amp111",$events = false) + function connect($ip=VOIP_SERVER,$user=VOIP_ADMIN_USER,$pass=VOIP_ADMIN_PASS,$events = false) { - $this->socket = fsockopen($ip,"5038",$errno,$errstr,1); + $this->socket = fsockopen($ip,VOIP_PORT,$errno,$errstr,1); if (!$this->socket) { print "$errno: $errstr";