From: hickert Date: Fri, 4 May 2012 16:02:05 +0000 (+0000) Subject: Added option to select asterisk extensions delimiter X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6ab8aa3d6452663e50a256d7c891967eae720941;p=gosa.git Added option to select asterisk extensions delimiter git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6@21146 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc b/gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc index 703fba380..b4f4dede0 100644 --- a/gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc +++ b/gosa-plugins/gofon/gofon/phoneaccount/class_phoneAccount.inc @@ -7,6 +7,8 @@ class phoneAccount extends plugin var $plDescription= "This does something"; var $plIcon = "plugins/gofon/images/phoneAccount.png"; + var $delimiter = "|"; + /* Attributes */ var $telephoneNumber = array(); var $goFonHardware = "automatic"; @@ -57,6 +59,8 @@ class phoneAccount extends plugin { plugin::plugin ($config, $dn, $parent); + $this->delimiter = $config->get_cfg_value("asteriskParameterDelimiter","|"); + /* Assemble phone numbers */ if (isset($this->attrs['telephoneNumber'])){ for ($i= 0; $i<$this->attrs['telephoneNumber']['count']; $i++){ @@ -926,9 +930,9 @@ class phoneAccount extends plugin // Get selected Macro Parameter and create parameter entry if(isset($this->macroarray[$this->macro])){ foreach($this->macroarray[$this->macro] as $key => $val ){ - $s_parameter .= $val['choosen']."|"; + $s_parameter .= $val['choosen'].$this->delimiter; } - $s_parameter = preg_replace("/\|$/","",$s_parameter); + $s_parameter = rtrim($s_parameter, $this->delimiter); } $i = 0; @@ -938,7 +942,7 @@ class phoneAccount extends plugin $EXT[$i]['exten'] = $this->uid; $EXT[$i]['priority']= 1; $EXT[$i]['app'] = "Goto"; - $EXT[$i]['appdata'] = $newnums[$i_new_key]."|1"; + $EXT[$i]['appdata'] = $newnums[$i_new_key].$this->delimiter."1"; $i ++; } @@ -964,10 +968,10 @@ class phoneAccount extends plugin $macroname = preg_replace("/,.*$/","",$this->macro); $macroname = preg_replace("/^.*=/","",$macroname); $s_app = "Macro";$macroname; - $s_par = $macroname."|".$s_parameter; + $s_par = $macroname.$this->delimiter.$s_parameter; }else{ $s_app = "Dial"; - $s_par = 'SIP/'.$this->uid."|20|r"; + $s_par = 'SIP/'.$this->uid.$this->delimiter."20".$this->delimiter."r"; } $EXT[$i]['context'] = 'GOsa';