- Timestamp:
- 05/29/09 14:01:54 (3 years ago)
- Files:
-
- contributed_modules/modules/isymphony/isymphony-php-library/isymphony.php (modified) (5 diffs)
- contributed_modules/modules/isymphony/isymphony-php-library/library/classes.php (modified) (10 diffs)
- contributed_modules/modules/isymphony/isymphony-php-library/library/helper.php (modified) (2 diffs)
- contributed_modules/modules/isymphony/isymphony-php-library/library/navigation.php (modified) (7 diffs)
- contributed_modules/modules/isymphony/isymphony-php-library/library/property_arrays.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
contributed_modules/modules/isymphony/isymphony-php-library/isymphony.php
r6438 r7772 4 4 *Author : Michael Yara 5 5 *Created : June 15, 2008 6 *Last Updated : August 22, 20087 *History : 0. 26 *Last Updated : May 27, 2009 7 *History : 0.4 8 8 *Purpose : Contains all functions used to interact with the iSymphony configuration. 9 9 *Copyright : 2008 HEHE Enterprises, LLC … … 28 28 $ISERROR = ""; 29 29 30 //Tracker variables for improved running time 31 $IN_LOCATION = false; 32 $IN_TENNAT = false; 33 30 34 //Connection methods------------------------------------------------------------------------------- 31 35 /*############################################### … … 43 47 if(($SOCKET = socket_create(AF_INET, SOCK_STREAM, 0)) && (socket_connect($SOCKET, $HOST, $PORT))) { 44 48 45 //Check version to modify property arrays if necessary 46 //Modify for 2.1 47 if((($versionResult = getiSymphonyServerVersion()) !== false) && (strstr($versionResult, "2.1") !== false)) { 48 isymphony_modify_property_arrays_2_1(); 49 //Check version and revision number to modify property arrays if necessary 50 if((($versionResult = getiSymphonyServerVersion()) !== false) && (($revisionResult = getiSymphonyServerRevision()) !== false)) { 51 52 //Modify for 2.1 53 if((strstr($versionResult, "2.1") !== false)) { 54 55 //Modify for rev 1493 and above 56 if($revisionResult >= 1493) { 57 isymphony_modify_property_arrays_2_1_1493(); 58 59 //Modify for rev 1489 through 1493 60 } else if($revisionResult >= 1489) { 61 isymphony_modify_property_arrays_2_1_1489(); 62 63 //Modify for post rev 1489 64 } else { 65 isymphony_modify_property_arrays_2_1(); 66 } 67 } 49 68 } 50 51 69 return true; 52 70 } else { … … 63 81 function iSymphonyDisconnect() { 64 82 65 global $SOCKET; 83 global $SOCKET, $IN_LOCATION, $IN_TENNAT; 84 85 $IN_LOCATION = false; 86 $IN_TENNAT = false; 66 87 67 88 if(($SOCKET !== null) && ($SOCKET)) { … … 1934 1955 1935 1956 /*############################################### 1957 * Gets the server revision 1958 * Takes: nothing 1959 * Returns: server revision if successful or false if error occurred 1960 */ 1961 function getiSymphonyServerRevision() { 1962 1963 if(($serverVersion = getiSymphonyServerVersion()) === false) { 1964 return false; 1965 } 1966 1967 //Parse our server revision number from server version 1968 $serverRevison = ereg_replace("[^0-9]+", '', substr($serverVersion, strpos($serverVersion, "rev"))); 1969 1970 //If revision number is not numeric something went wrong in the parsing. If so return false. 1971 if(!is_numeric($serverRevison)) { 1972 $ISERROR = "Error: Parsed server version was non numeric."; 1973 return false; 1974 } 1975 1976 return $serverRevison; 1977 } 1978 1979 /*############################################### 1936 1980 * Shutdown the iSymphony server 1937 1981 * Takes: nothing contributed_modules/modules/isymphony/isymphony-php-library/library/classes.php
r6438 r7772 4 4 *Author : Michael Yara 5 5 *Created : June 15, 2008 6 *Last Updated : August 22, 20087 *History : 0. 46 *Last Updated : May 27, 2009 7 *History : 0.5 8 8 *Purpose : Contains declarations of all property classes. 9 9 *Copyright : 2008 HEHE Enterprises, LLC … … 63 63 * asterisk_password: Asterisk manager password(STRING) 64 64 * originate_timeout: Amount of time an originator will be rung on an origination event in milliseconds(INTEGER) 65 * reload_on_dial_plan_reload: Flag used to reload this location when the dial plan reloads(BOOLEAN[true or false]) 65 66 * jabber_host: Jabber host name(STRING) 67 * jabber_domain: Jabber domain name(STRING) 68 * jabber_resource: Jabber resource name(STRING) 66 69 * jabber_port: Jabber port(INTEGER) 67 70 * device_user_mode: (BOOLEAN[true or false]) … … 87 90 var $asterisk_login = ""; 88 91 var $asterisk_password = ""; 89 var $ originate_timeout= "";92 var $reload_on_dial_plan_reload = ""; 90 93 var $jabber_host = ""; 94 var $jabber_domain = ""; 95 var $jabber_resource = ""; 91 96 var $jabber_port = ""; 92 97 var $device_user_mode = ""; … … 167 172 * record_file_extension: File extensions used for recorded calls(STRING) 168 173 * mix_mode: Flag used to mix incoming and outgoing recorded call channels(BOOLEAN[true or false]) 174 * page_status_enabled: Flag used to enable page status(BOOLEAN[true or false]) 175 * page_context: Page context used to suppress paging status(STRING) 169 176 * 170 177 * Methods: … … 192 199 var $record_file_extension = ""; 193 200 var $mix_mode = ""; 201 var $page_status_enabled = ""; 202 var $page_context = ""; 194 203 195 204 //Methods … … 268 277 * voice_mail: Voice mail box number of this extension(STRING) 269 278 * agent: Agent number associated with this extension(STRING) 279 * auto_answer: Flag used to indicate if origination call back should be auto answered. 270 280 * 271 281 * Methods: … … 293 303 var $voice_mail = ""; 294 304 var $agent = ""; 305 var $auto_answer = ""; 295 306 296 307 //Methods … … 326 337 327 338 global $extensionPropertyArray; 328 339 329 340 //Move to tenant mode 330 341 if(!moveToTenant($location, $tenant)) { … … 364 375 * name: Username for profile(STRING) 365 376 * password: Password for profile(STRING) 377 * jabber_host: Jabber host name(STRING) 378 * jabber_domain: Jabber domain name(STRING) 379 * jabber_resource: Jabber resource name(STRING) 380 * jabber_port: Jabber port(INTEGER) 366 381 * jabber_user_name: Jabber username(STRING) 367 382 * jabber_password: Jabber password(STRING) … … 386 401 var $name = ""; 387 402 var $password = ""; 403 var $jabber_host = ""; 404 var $jabber_domain = ""; 405 var $jabber_resource = ""; 406 var $jabber_port = ""; 388 407 var $jabber_user_name = ""; 389 408 var $jabber_password = ""; contributed_modules/modules/isymphony/isymphony-php-library/library/helper.php
r5878 r7772 4 4 *Author : Michael Yara 5 5 *Created : June 15, 2008 6 *Last Updated : J une 18, 20087 *History : 0. 1Beta6 *Last Updated : January 27, 2009 7 *History : 0.2 Beta 8 8 *Purpose : Contains utility functions used by the library. 9 9 *Copyright : 2008 HEHE Enterprises, LLC … … 154 154 } 155 155 156 /*############################################### 157 * Removes an element from an array by value 158 * Takes: an array and the element to be removed 159 * Returns: and new re-orderd array without the removed element 160 */ 161 function remove_element($arr, $val){ 162 foreach ($arr as $key => $value){ 163 if ($arr[$key] == $val){ 164 unset($arr[$key]); 165 } 166 } 167 return $arr = array_values($arr); 168 } 156 169 157 170 ?> contributed_modules/modules/isymphony/isymphony-php-library/library/navigation.php
r5878 r7772 4 4 *Author : Michael Yara 5 5 *Created : June 15, 2008 6 *Last Updated : June 18, 20087 *History : 0. 1Beta6 *Last Updated : May 7, 2009 7 *History : 0.2 Beta 8 8 *Purpose : Contains functions used to navigate through different modes of the CLI. 9 9 *Copyright : 2008 HEHE Enterprises, LLC 10 10 */ 11 11 12 12 13 /*############################################### … … 27 28 */ 28 29 function moveToLocation($location) { 29 30 //Move to server 31 if(!moveToServer()) { 32 return false; 33 } 30 global $IN_LOCATION; 34 31 35 32 //Move to location 36 return checkAndSetErrorNone("location $location"); 33 $moved = checkAndSetErrorNone("location $location"); 34 $IN_LOCATION = $moved; 35 return $moved; 37 36 } 38 37 … … 43 42 */ 44 43 function moveToTenant($location, $tenant) { 44 global $IN_LOCATION, $IN_TENANT; 45 45 46 46 //Move to location 47 if(!moveToLocation($location)) { 48 return false; 49 } 50 51 //Move to tenant 52 return checkAndSetErrorNone("tenant $tenant"); 47 if(!$IN_LOCATION) { 48 if(!moveToLocation($location)) { 49 return false; 50 } 51 } 52 53 //Move to tenant 54 $moved = checkAndSetErrorNone("tenant $tenant"); 55 $IN_TENANT = $moved; 56 return $moved; 53 57 } 54 58 … … 59 63 */ 60 64 function moveToExtension($location, $tenant, $extension) { 61 62 //Move to tenant 63 if(!moveToTenant($location, $tenant)) { 64 return false; 65 global $IN_TENANT; 66 67 //Move to tenant 68 if(!$IN_TENANT) { 69 if(!moveToTenant($location, $tenant)) { 70 return false; 71 } 65 72 } 66 73 … … 75 82 */ 76 83 function moveToProfile($location, $tenant, $profile) { 77 78 //Move to tenant 79 if(!moveToTenant($location, $tenant)) { 80 return false; 84 global $IN_TENANT; 85 86 //Move to tenant 87 if(!$IN_TENANT) { 88 if(!moveToTenant($location, $tenant)) { 89 return false; 90 } 81 91 } 82 92 … … 91 101 */ 92 102 function moveToQueue($location, $tenant, $queue) { 93 94 //Move to tenant 95 if(!moveToTenant($location, $tenant)) { 96 return false; 103 global $IN_TENANT; 104 105 //Move to tenant 106 if(!$IN_TENANT) { 107 if(!moveToTenant($location, $tenant)) { 108 return false; 109 } 97 110 } 98 111 … … 107 120 */ 108 121 function moveToConferenceRoom($location, $tenant, $room) { 109 110 //Move to tenant 111 if(!moveToTenant($location, $tenant)) { 112 return false; 122 global $IN_TENANT; 123 124 //Move to tenant 125 if(!$IN_TENANT) { 126 if(!moveToTenant($location, $tenant)) { 127 return false; 128 } 113 129 } 114 130 contributed_modules/modules/isymphony/isymphony-php-library/library/property_arrays.php
r6438 r7772 4 4 *Author : Michael Yara 5 5 *Created : June 15, 2008 6 *Last Updated : August 22, 20087 *History : 0. 36 *Last Updated : May 27, 2009 7 *History : 0.5 8 8 *Purpose : Contains arrays witch describe all configuration object property names along with functions to modify 9 9 * the arrays for specific versions of the server. … … 26 26 $conferenceRoomPermissionPropertyArray = array("steal_call","transfer_to","originate_to","mute_users","kick_users"); 27 27 28 //Property array modification functions-------------------------------------------------------------------------------------------------------------- 29 function isymphony_modify_property_arrays_2_1() { 30 global $locationPropertyArray, $extensionPropertyArray, $tenantPropertyArray; 31 32 //New modifications 33 array_push($locationPropertyArray, "device_user_mode"); 34 35 array_push($tenantPropertyArray, "page_status_enabled"); 36 array_push($tenantPropertyArray, "page_context"); 37 38 $extensionPropertyArray = remove_element($extensionPropertyArray, "agent"); 39 } 28 40 29 function isymphony_modify_property_arrays_2_1() { 30 global $locationPropertyArray; 31 array_push($locationPropertyArray, "device_user_mode"); 41 function isymphony_modify_property_arrays_2_1_1489() { 42 global $locationPropertyArray, $extensionPropertyArray, $tenantPropertyArray, $profilePropertyArray; 43 44 //Apply 2.1 modifications 45 isymphony_modify_property_arrays_2_1(); 46 47 //New modifications 48 array_push($locationPropertyArray, "reload_on_dial_plan_reload"); 49 array_push($locationPropertyArray, "jabber_domain"); 50 array_push($locationPropertyArray, "jabber_resource"); 51 52 array_push($profilePropertyArray, "jabber_host"); 53 array_push($profilePropertyArray, "jabber_domain"); 54 array_push($profilePropertyArray, "jabber_resource"); 55 array_push($profilePropertyArray, "jabber_port"); 56 } 57 58 function isymphony_modify_property_arrays_2_1_1493() { 59 global $locationPropertyArray, $extensionPropertyArray, $tenantPropertyArray, $profilePropertyArray; 60 61 //Apply 2.1 1489 modifications 62 isymphony_modify_property_arrays_2_1_1489(); 63 64 //New modifications 65 array_push($extensionPropertyArray, "auto_answer"); 32 66 } 33 67 ?>
