_entries = array(); $this->_softkeys = array(); $this->_icons = array(); $this->_title = ''; $this->_destroyOnExit=''; $this->_refreshTimeout=0; $this->_refreshURL=''; $this->_beep=''; $this->_lockin=''; $this->_lockin_uri=''; $this->_timeout=0; $this->_allowAnswer=''; $this->_allowDrop=''; $this->_allowXfer=''; $this->_allowConf=''; } function setEncodingUTF8() { $this->_encoding = 'UTF-8'; } function setBackgroundColor($color) { $this->_background_color = $color; } function setTitle($title,$color='') { $this->_title = $title; $this->_title_color = $color; } function setTopTitle($title,$color='',$icon='') { $this->_toptitle = $title; $this->_toptitle_color = $color; $this->_toptitle_icon = $icon; } function setTitleWrap() { $this->_title_wrap = 'yes'; } function setRefresh($timeout,$URL) { $this->_refreshTimeout = $timeout; $this->_refreshURL = $URL; } function setBeep() { $this->_beep='yes'; } function setDestroyOnExit() { $this->_destroyOnExit='yes'; } function setCancelAction($cancelAction) { $this->_cancelAction=$cancelAction; } function setLockIn($uri='') { $this->_lockin='yes'; $this->_lockin_uri=$uri; } function setLockInCall() { $this->_lockin='call'; } function setCallProtection($notif=False) { if($notif==True) { $this->_callprotection='notif'; } else { $this->_callprotection='yes'; } } function setTimeout($timeout) { $this->_timeout=$timeout; } function setAllowAnswer() { $this->_allowAnswer='yes'; } function setAllowDrop() { $this->_allowDrop='yes'; } function setAllowXfer() { $this->_allowXfer='yes'; } function setAllowConf() { $this->_allowConf='yes'; } function output($flush=False) { header("Content-Type: text/xml; charset=".$this->_encoding); if (($this->_refreshTimeout!=0) and ($this->_refreshURL!='')) header("Refresh: ".$this->_refreshTimeout."; url=".$this->_refreshURL); $output="_encoding."\"?>\n"; $output.=$this->render(); header('Content-Length: '.strlen($output)); echo($output); if($flush) { ob_flush(); flush(); } } function generate() { return($this->render()); } function addSoftkey($index, $label, $uri, $icon=NULL, $color='') { if(!Aastra_is_icons_supported()) $icon=NULL; if(($index>=1) and ($index<=Aastra_number_softkeys_supported())) $this->_softkeys[$index] = new AastraIPPhoneSoftkeyEntry($index, $this->escape($label), $this->escape($uri), $icon, $color); $this->_softkeys[$index] = new AastraIPPhoneSoftkeyEntry($index, $this->escape($label), $this->escape($uri), $icon, $color); } function addIcon($index, $icon) { # if(Aastra_is_icons_supported()) $this->_icons[$index] = new AastraIPPhoneIconEntry($index, $icon); $this->_icons[$index] = new AastraIPPhoneIconEntry($index, $icon); } function escape($string) { return(str_replace( array('&', '<', '>', '"', "'"), array('&', '<', '>', '"', '''), $string )); } function convert_high_ascii($s) { $HighASCII = array( "!\xc0!" => 'A', # A` "!\xe0!" => 'a', # a` "!\xc1!" => 'A', # A' "!\xe1!" => 'a', # a' "!\xc2!" => 'A', # A^ "!\xe2!" => 'a', # a^ "!\xc4!" => 'Ae', # A: "!\xe4!" => 'ae', # a: "!\xc3!" => 'A', # A~ "!\xe3!" => 'a', # a~ "!\xc8!" => 'E', # E` "!\xe8!" => 'e', # e` "!\xc9!" => 'E', # E' "!\xe9!" => 'e', # e' "!\xca!" => 'E', # E^ "!\xea!" => 'e', # e^ "!\xcb!" => 'Ee', # E: "!\xeb!" => 'ee', # e: "!\xcc!" => 'I', # I` "!\xec!" => 'i', # i` "!\xcd!" => 'I', # I' "!\xed!" => 'i', # i' "!\xce!" => 'I', # I^ "!\xee!" => 'i', # i^ "!\xcf!" => 'Ie', # I: "!\xef!" => 'ie', # i: "!\xd2!" => 'O', # O` "!\xf2!" => 'o', # o` "!\xd3!" => 'O', # O' "!\xf3!" => 'o', # o' "!\xd4!" => 'O', # O^ "!\xf4!" => 'o', # o^ "!\xd6!" => 'Oe', # O: "!\xf6!" => 'oe', # o: "!\xd5!" => 'O', # O~ "!\xf5!" => 'o', # o~ "!\xd8!" => 'Oe', # O/ "!\xf8!" => 'oe', # o/ "!\xd9!" => 'U', # U` "!\xf9!" => 'u', # u` "!\xda!" => 'U', # U' "!\xfa!" => 'u', # u' "!\xdb!" => 'U', # U^ "!\xfb!" => 'u', # u^ "!\xdc!" => 'Ue', # U: "!\xfc!" => 'ue', # u: "!\xc7!" => 'C', # ,C "!\xe7!" => 'c', # ,c "!\xd1!" => 'N', # N~ "!\xf1!" => 'n', # n~ "!\xdf!" => 'ss' ); $find = array_keys($HighASCII); $replace = array_values($HighASCII); $s = preg_replace($find,$replace,$s); return $s; } } ?>