root/contributed_modules/modules/isymphony/isymphony-php-library/library/classes.php

Revision 7772, 56.8 kB (checked in by seanmh, 3 years ago)

1.0.0 Added backward compatibility support for 2.0 rev 1104.

Fixed bug in which a flawed context would prevent orphaned parked calls from ringing back to the parking extension if parked via the panel.
Made debug menu always visible.
Added server debug menu.
Debug logs now show on main module page.
Multiple debug options can now be set at once.
Added database column checks in installation script to handle module upgrades.
Added default FreePBX page context to configuration.
Added admin username and password fields to the main module page.
Added originate timeout field to main module page.
Added auto reload and enable page status checkboxes to main module page.
Added global Jabber connection configuration fields on main module page.
Added email and cell phone fields to extension page.
Added Jabber connection configuration override fields to extension page.
Added Jabber username and password fields to extension page.
Added auto answer checkbox to extension page.
Modified database debug tables to account for new tables and columns.

Line 
1 <?php
2 /*
3  *Name         : classes.php
4  *Author       : Michael Yara
5  *Created      : June 15, 2008
6  *Last Updated : May 27, 2009
7  *History      : 0.5
8  *Purpose      : Contains declarations of all property classes.
9  *Copyright    : 2008 HEHE Enterprises, LLC
10  */
11
12 /*###############################################
13  * Class that represents the server properties
14  * Attributes:
15  *    client_port: Port that server listens for client connections on.(INTEGER)
16  *    cli_port: Port that servers listens for CLI requests on.(INTEGER)
17  *    username: Admin username.(STRING)
18  *    password: Admin password.(STRING)
19  *
20  * Methods:
21  *    update: Commits changes made to the property configuration
22  *      Takes: nothing
23  *      Returns: true if successful false if not
24  */
25  class ISymphonyServer {
26  
27   //Property attributes
28   var $client_port = "";
29   var $cli_port = "";
30   var $username = "";
31   var $password = "";
32      
33   //Methods
34   function update() {
35    
36     global $serverPropertyArray;
37    
38     //Move to server mode
39     if(!moveToServer()) {
40       return false;
41     }
42    
43     //Modify properties
44     foreach($serverPropertyArray as $val) {
45       if(!checkAndSetErrorNone("$val {$this->$val}")) {
46         return false;
47       }
48     }
49    
50     //Commit changes
51     return checkAndSetErrorNone("commit");
52   }
53  }
54
55 /*###############################################
56  * Class that represents a locations's properties
57  * Attributes:
58  *    name: Location name(STRING)
59  *    admin_password: Admin password(STRING)
60  *    asterisk_host: Asterisk manager host name or IP(STRING)
61  *    asterisk_port: Asterisk manager port(INTEGER)
62  *    asterisk_login: Asterisk manager username(STRING)
63  *    asterisk_password: Asterisk manager password(STRING)
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])
66  *    jabber_host: Jabber host name(STRING)
67  *    jabber_domain: Jabber domain name(STRING)
68  *    jabber_resource: Jabber resource name(STRING)
69  *    jabber_port: Jabber port(INTEGER)
70  *    device_user_mode: (BOOLEAN[true or false])
71  *
72  * Methods:
73  *    update: Commits changes made to the property configuration
74  *      Takes: nothing
75  *      Returns: true if successful false if not
76  *    add: Adds the given location with specified configuration
77  *      Takes: nothing
78  *      Returns: true if successful false if not
79  */
80  class ISymphonyLocation {
81  
82   //Mode attributes
83   var $original_name = "";
84  
85   //Property attributes
86   var $name = "";
87   var $admin_password = "";
88   var $asterisk_host = "";
89   var $asterisk_port = "";
90   var $asterisk_login = "";
91   var $asterisk_password = "";
92   var $reload_on_dial_plan_reload = "";
93   var $jabber_host = "";
94   var $jabber_domain = "";
95   var $jabber_resource = "";
96   var $jabber_port = "";
97   var $device_user_mode = "";
98  
99   //Methods
100   function update() {
101    
102     global $locationPropertyArray;
103    
104     //Move to location mode
105     if(!moveToLocation($this->original_name)) {
106       return false;
107     }
108    
109     //Modify properties
110     foreach($locationPropertyArray as $val) {
111       if(!checkAndSetErrorNone("$val {$this->$val}")) {
112         return false;
113       }
114     }
115    
116     //Commit changes
117     if(checkAndSetErrorNone("commit")) {
118      
119       //Set mode properties if edit was successful so user can call subsequent commits
120       $this->original_name = $this->name;
121       return true;
122      
123     } else {
124       return false;
125     }
126   }
127  
128   function add() {
129    
130     global $locationPropertyArray;
131    
132     //Move to server mode
133     if(!moveToServer()) {
134       return false;
135     }
136    
137     //Initiate new command
138     if(!checkAndSetErrorNone("new location {$this->name}")) {
139       return false;
140     }
141    
142     //Modify properties
143     foreach($locationPropertyArray as $val) {
144       if(!checkAndSetErrorNone("$val {$this->$val}")) {
145         return false;
146       }
147     }
148    
149     //Commit addition
150     if(checkAndSetErrorNone("commit")) {
151      
152       //Set mode properties if addition was successful so user can call commit
153       $this->original_name = $this->name;
154       return true;
155      
156     } else {
157       return false;
158     }
159   }
160  }
161
162 /*###############################################
163  * Class that represents a tenants's properties
164  * Attributes:
165  *    name: Name of the tenant(STRING)
166  *    admin_password: Admin password(STRING)
167  *    originating_context: Context used for originating calls(STRING)
168  *    redirecting_context: Context used for redirecting calls(STRING)
169  *    music_on_hold_class: Music on hold class(STRING)
170  *    outside_line_number: Number used to dial outside numbers(STRING)
171  *    record_file_name: File name used for recorded calls. See code legend in administration interface for a list of input variables(STRING)
172  *    record_file_extension: File extensions used for recorded calls(STRING)
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)
176  *
177  * Methods:
178  *    update: Commits changes made to the property configuration
179  *      Takes: nothing
180  *      Returns: true if successful false if not
181  *    add: Adds the given tenant with specified configuration
182  *      Takes: the location you wish to add the tenant to
183  *      Returns: true if successful false if not
184  */
185  class ISymphonyTenant {
186  
187   //Mode attributes
188   var $mode_location = "";
189   var $original_name = "";
190  
191   //Property attributes
192   var $name = "";
193   var $admin_password = "";
194   var $originating_context = "";
195   var $redirecting_context = "";
196   var $music_on_hold_class = "";
197   var $outside_line_number = "";
198   var $record_file_name = "";
199   var $record_file_extension = "";
200   var $mix_mode = "";
201   var $page_status_enabled = "";
202   var $page_context = "";
203  
204   //Methods
205   function update() {
206    
207     global $tenantPropertyArray;
208    
209     //Move to tenant mode
210     if(!moveToTenant($this->mode_location, $this->original_name)) {
211       return false;
212     }
213    
214     //Modify properties
215     foreach($tenantPropertyArray as $val) {
216       if(!checkAndSetErrorNone("$val {$this->$val}")) {
217         return false;
218       }
219     }
220    
221     //Commit changes
222     if(checkAndSetErrorNone("commit")) {
223      
224       //Set mode properties if edit was successful so user can call subsequent commits
225       $this->original_name = $this->name;
226       return true;
227      
228     } else {
229       return false;
230     }
231   }
232  
233   function add($location) {
234    
235     global $tenantPropertyArray;
236    
237     //Move to location mode
238     if(!moveToLocation($location)) {
239       return false;
240     }
241    
242     //Initiate new command
243     if(!checkAndSetErrorNone("new tenant {$this->name}")) {
244       return false;
245     }
246    
247     //Modify properties
248     foreach($tenantPropertyArray as $val) {
249       if(!checkAndSetErrorNone("$val {$this->$val}")) {
250         return false;
251       }
252     }
253    
254     //Commit addition
255     if(checkAndSetErrorNone("commit")) {
256      
257       //Set mode properties if addition was successful so user can call commit
258       $this->original_name = $this->name;
259       $this->mode_location = $location;
260       return true;
261      
262     } else {
263       return false;
264     }
265   }
266  }
267  
268  /*###############################################
269   * Class that represents an extension's properties
270   * Attributes:
271   *   extension_val: Extension number(STRING)
272   *   name: Extension display name(STRING)
273   *   cell_phone: Cell phone number(STRING)
274   *   email: Email address(STRING)
275   *   peer: Peer associated with this extension(STRING)
276   *   alt_origination_method: Alternate method for originating calls if it differers from the peer(STRING)
277   *   voice_mail: Voice mail box number of this extension(STRING)
278   *   agent: Agent number associated with this extension(STRING)
279   *   auto_answer: Flag used to indicate if origination call back should be auto answered.
280   *
281   * Methods:
282   *   update: Commits changes made to the property configuration
283   *     Takes: nothing
284   *     Returns: true if successful false if not
285   *   add: Adds the given tenant with specified configuration
286   *     Takes: the location you wish to add the extension to, the tenant that you would like to add the extension to
287   *     Returns: true if successful false if not
288   */
289   class ISymphonyExtension {
290  
291   //Mode attributes
292   var $mode_location = "";
293   var $mode_tenant = "";
294   var $original_extension_val = "";
295  
296   //Property attributes
297   var $extension_val = "";
298   var $name = "";
299   var $cell_phone = "";
300   var $email = "";
301   var $peer = "";
302   var $alt_origination_method = "";
303   var $voice_mail = "";
304   var $agent = "";
305   var $auto_answer = "";
306  
307   //Methods
308   function update() {
309    
310     global $extensionPropertyArray;
311    
312     //Move to extension mode
313     if(!moveToExtension($this->mode_location, $this->mode_tenant, $this->original_extension_val)) {
314       return false;
315     }
316    
317     //Modify properties
318     foreach($extensionPropertyArray as $val) {
319       if(!checkAndSetErrorNone("$val {$this->$val}")) {
320         return false;
321       }
322     }
323    
324     //Commit changes
325     if(checkAndSetErrorNone("commit")) {
326      
327       //Set mode properties if edit was successful so user can call subsequent commits
328       $this->original_extension_val = $this->extension_val;
329       return true;
330      
331     } else {
332       return false;
333     }
334   }
335  
336   function add($location, $tenant) {
337    
338     global $extensionPropertyArray;
339        
340     //Move to tenant mode
341     if(!moveToTenant($location, $tenant)) {
342       return false;
343     }
344    
345     //Initiate new command
346     if(!checkAndSetErrorNone("new extension {$this->extension_val}")) {
347       return false;
348     }
349    
350     //Modify properties
351     foreach($extensionPropertyArray as $val) {
352       if(!checkAndSetErrorNone("$val {$this->$val}")) {
353         return false;
354       }
355     }
356    
357     //Commit addition
358     if(checkAndSetErrorNone("commit")) {
359      
360       //Set mode properties if addition was successful so user can call commit
361       $this->original_extension_val = $this->extension_val;
362       $this->mode_location = $location;
363       $this->mode_tenant = $tenant;
364       return true;
365      
366     } else {
367       return false;
368     }
369   }
370  }
371  
372   /*###############################################
373   * Class that represents a profile's properties
374   * Attributes:
375   *   name: Username for profile(STRING)
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)
381   *   jabber_user_name: Jabber username(STRING)
382   *   jabber_password: Jabber password(STRING)
383   *   can_view_everyone_directory: Flag that allows this profile to see the Everyone directory(BOOLEAN[true or false])
384   *
385   * Methods:
386   *   update: Commits changes made to the property configuration
387   *     Takes: nothing
388   *     Returns: true if successful false if not
389   *   add: Adds the given profile with specified configuration
390   *     Takes: the location you wish to add the profile to, the tenant that you would like to add the profile to
391   *     Returns: true if successful false if not
392   */
393   class ISymphonyProfile {
394  
395   //Mode attributes
396   var $mode_location = "";
397   var $mode_tenant = "";
398   var $original_name = "";
399  
400   //Property attributes
401   var $name = "";
402   var $password = "";
403   var $jabber_host = "";
404   var $jabber_domain = "";
405   var $jabber_resource = "";
406   var $jabber_port = ""; 
407   var $jabber_user_name = "";
408   var $jabber_password = "";
409   var $can_view_everyone_directory = "";
410  
411   //Methods
412   function update() {
413    
414     global $profilePropertyArray;
415    
416     //Move to profile mode
417     if(!moveToProfile($this->mode_location, $this->mode_tenant, $this->original_name)) {
418       return false;
419     }
420    
421     //Modify properties
422     foreach($profilePropertyArray as $val) {
423       if(!checkAndSetErrorNone("$val {$this->$val}")) {
424         return false;
425       }
426     }
427    
428     //Commit changes
429     if(checkAndSetErrorNone("commit")) {
430      
431       //Set mode properties if edit was successful so user can call subsequent commits
432       $this->original_name = $this->name;
433       return true;
434      
435     } else {
436       return false;
437     }
438   }
439  
440   function add($location, $tenant) {
441    
442     global $profilePropertyArray;
443    
444     //Move to tenant mode
445     if(!moveToTenant($location, $tenant)) {
446       return false;
447     }
448    
449     //Initiate new command
450     if(!checkAndSetErrorNone("new profile {$this->name}")) {
451       return false;
452     }
453    
454     //Modify properties
455     foreach($profilePropertyArray as $val) {
456       if(!checkAndSetErrorNone("$val {$this->$val}")) {
457         return false;
458       }
459     }
460    
461     //Commit addition
462     if(checkAndSetErrorNone("commit")) {
463      
464       //Set mode properties if addition was successful so user can call commit
465       $this->original_name = $this->name;
466       $this->mode_location = $location;
467       $this->mode_tenant = $tenant;
468       return true;
469      
470     } else {
471       return false;
472     }
473   }
474  }
475  
476  /*###############################################
477   * Class that represents a queue's properties
478   * Attributes:
479   *   name: Display name of queue(STRING)
480   *   queue_val: Name of queue as defined in queues.conf(STRING)
481   *   extension_val: Extension used to access queue(STRING)
482   *   context: Context used to access queue(STRING)
483   *
484   * Methods:
485   *   update: Commits changes made to the property configuration
486   *     Takes: nothing
487   *     Returns: true if successful false if not
488   *   add: Adds the given queue with specified configuration
489   *     Takes: the location you wish to add the queue to, the tenant that you would like to add the queue to
490   *     Returns: true if successful false if not
491   */
492   class ISymphonyQueue {
493  
494   //Mode attributes
495   var $mode_location = "";
496   var $mode_tenant = "";
497   var $original_name = "";
498  
499   //Property attributes
500   var $name = "";
501   var $queue_val = "";
502   var $extension_val = "";
503   var $context = "";
504  
505   //Methods
506   function update() {
507    
508     global $queuePropertyArray;
509    
510     //Move to queue mode
511     if(!moveToQueue($this->mode_location, $this->mode_tenant, $this->original_name)) {
512       return false;
513     }
514    
515     //Modify properties
516     foreach($queuePropertyArray as $val) {
517       if(!checkAndSetErrorNone("$val {$this->$val}")) {
518         return false;
519       }
520     }
521    
522     //Commit changes
523     if(checkAndSetErrorNone("commit")) {
524      
525       //Set mode properties if edit was successful so user can call subsequent commits
526       $this->original_name = $this->name;
527       return true;
528      
529     } else {
530       return false;
531     }
532   }
533  
534   function add($location, $tenant) {
535    
536     global $queuePropertyArray;
537    
538     //Move to tenant mode
539     if(!moveToTenant($location, $tenant)) {
540       return false;
541     }
542    
543     //Initiate new command
544     if(!checkAndSetErrorNone("new queue {$this->name}")) {
545       return false;
546     }
547    
548     //Modify properties
549     foreach($queuePropertyArray as $val) {
550       if(!checkAndSetErrorNone("$val {$this->$val}")) {
551         return false;
552       }
553     }
554    
555     //Commit addition
556     if(checkAndSetErrorNone("commit")) {
557      
558       //Set mode properties if addition was successful so user can call commit
559       $this->original_name = $this->name;
560       $this->mode_location = $location;
561       $this->mode_tenant = $tenant;
562       return true;
563      
564     } else {
565       return false;
566     }
567   }
568  }
569  
570  /*###############################################
571   * Class that represents a conference room's properties
572   * Attributes:
573   *   name: Display name of conference room(STRING)
574   *   predefined: Flag describing if this is a predefined or custom room(BOOLEAN[true or false])
575   *   room_number: Room number for predefined room as it appears in meetme.conf(STRING)
576   *   extension_val: Extension used to access predefined room(STRING)
577   *   context: Context used to access predefined room(STRING)
578   *   announce_user_count: Custom room option to turn on/off announcing user count to entering users(BOOLEAN[true or false])
579   *   music_on_hold_for_single_user: Custom room option to turn on/off music on hold when a single user is in a room(BOOLEAN[true or false])
580   *   exit_room_via_pound: Custom room option to turn on/off the ability for users to exit the room via the # key(BOOLEAN[true or false])
581   *   present_menu_via_star: Custom room option to turn on/off the ability for users to be presented a menu via the * key(BOOLEAN[true or false])
582   *   announce_user_join_leave: Custom room option to turn on/off the ability to announce the name of incoming users.
583   *   disable_join_leave_notification: Custom room option to turn on/off a chime notification of entering and exiting users.
584   *   record: Custom room option to turn on/off recording of a room.
585   *
586   * Methods:
587   *   update: Commits changes made to the property configuration
588   *     Takes: nothing
589   *     Returns: true if successful false if not
590   *   add: Adds the given conference room with specified configuration
591   *     Takes: the location you wish to add the conference room to, the tenant that you would like to add the conference room to
592   *     Returns: true if successful false if not
593   */
594   class ISymphonyConferenceRoom {
595  
596   //Mode attributes
597   var $mode_location = "";
598   var $mode_tenant = "";
599   var $original_name = "";
600  
601   //Property attributes
602   var $name = "";
603   var $predefined = "";
604   var $room_number = "";
605   var $extension_val = "";
606   var $context = "";
607   var $announce_user_count = "";
608   var $music_on_hold_for_single_user = "";
609   var $exit_room_via_pound = "";
610   var $present_menu_via_star = "";
611   var $announce_user_join_leave = "";
612   var $disable_join_leave_notification = "";
613   var $record = "";
614  
615   //Methods
616   function update() {
617    
618     global $conferenceRoomPropertyArray;
619    
620     //Move to conference room mode
621     if(!moveToConferenceRoom($this->mode_location, $this->mode_tenant, $this->original_name)) {
622       return false;
623     }
624    
625     //Modify properties
626     foreach($conferenceRoomPropertyArray as $val) {
627       if(!checkAndSetErrorNone("$val {$this->$val}")) {
628         return false;
629       }
630     }
631    
632     //Commit changes
633     if(checkAndSetErrorNone("commit")) {
634      
635       //Set mode properties if edit was successful so user can call subsequent commits
636       $this->original_name = $this->name;
637       return true;
638      
639     } else {
640       return false;
641     }
642   }
643  
644   function add($location, $tenant) {
645    
646     global $conferenceRoomPropertyArray;
647    
648     //Move to tenant mode
649     if(!moveToTenant($location, $tenant)) {
650       return false;
651     }
652    
653     //Initiate new command
654     if(!checkAndSetErrorNone("new meetme {$this->name}")) {
655       return false;
656     }
657    
658     //Modify properties
659     foreach($conferenceRoomPropertyArray as $val) {
660       if(!checkAndSetErrorNone("$val {$this->$val}")) {
661         return false;
662       }
663     }
664    
665     //Commit addition
666     if(checkAndSetErrorNone("commit")) {
667      
668       //Set mode properties if addition was successful so user can call commit
669       $this->original_name = $this->name;
670       $this->mode_location = $location;
671       $this->mode_tenant = $tenant;
672       return true;
673      
674     } else {
675       return false;
676     }
677   }
678  }
679
680  /*###############################################
681   * Class that represents a permission group's properties
682   * Attributes:
683   *   name: Name of permission group(STRING)
684   *
685   * Methods:
686   *   update: Commits changes made to the property configuration
687   *     Takes: nothing
688   *     Returns: true if successful false if not
689   *   add: Adds the given permission group with specified configuration
690   *     Takes: the location you wish to add the permission group to, the tenant that you would like to add the permission group to
691   *     Returns: true if successful false if not
692   */
693   class ISymphonyPermissionGroup {
694  
695   //Mode attributes
696   var $mode_location = "";
697   var $mode_tenant = "";
698   var $original_name = "";
699  
700   //Property attributes
701   var $name = "";
702  
703   //Methods
704   function update() {
705    
706     global $permissionGroupPropertyArray;
707    
708     //Move to permission group mode
709     if(!moveToPermissionGroup($this->mode_location, $this->mode_tenant, $this->original_name)) {
710       return false;
711     }
712    
713     //Modify properties
714     foreach($permissionGroupPropertyArray as $val) {
715       if(!checkAndSetErrorNone("$val {$this->$val}")) {
716         return false;
717       }
718     }
719    
720     //Commit changes
721     if(checkAndSetErrorNone("commit")) {
722      
723       //Set mode properties if edit was successful so user can call subsequent commits
724       $this->original_name = $this->name;
725       return true;
726      
727     } else {
728       return false;
729     }
730   }
731  
732   function add($location, $tenant) {
733    
734     global $permissionGroupPropertyArray;
735    
736     //Move to tenant mode
737     if(!moveToTenant($location, $tenant)) {
738       return false;
739     }
740    
741     //Initiate new command
742     if(!checkAndSetErrorNone("new permgroup {$this->name}")) {
743       return false;
744     }
745    
746     //Modify properties
747     foreach($permissionGroupPropertyArray as $val) {
748       if(!checkAndSetErrorNone("$val {$this->$val}")) {
749         return false;
750       }
751     }
752    
753     //Commit addition
754     if(checkAndSetErrorNone("commit")) {
755      
756       //Set mode properties if addition was successful so user can call commit
757       $this->original_name = $this->name;
758       $this->mode_location = $location;
759       $this->mode_tenant = $tenant;
760       return true;
761      
762     } else {
763       return false;
764     }
765   }
766  }   
767  
768  /*###############################################
769   * Class that represents a status's properties
770   * Attributes:
771   *   name: Name of status(STRING)
772   *   type: Type of status(TYPE[available,unavailable,out])
773   * Methods:
774   *   update: Commits changes made to the property configuration
775   *     Takes: nothing
776   *     Returns: true if successful false if not
777   *   add: Adds the given status with specified configuration
778   *     Takes: the location you wish to add the status to, the tenant that you would like to add the status to
779   *     Returns: true if successful false if not
780   */
781   class ISymphonyStatus {
782  
783   //Mode attributes
784   var $mode_location = "";
785   var $mode_tenant = "";
786   var $original_name = "";
787  
788   //Property attributes
789   var $name = "";
790   var $type = "";
791  
792   //Methods
793   function update() {
794    
795     global $statusPropertyArray;
796    
797     //Move to status mode
798     if(!moveToStatus($this->mode_location, $this->mode_tenant, $this->original_name)) {
799       return false;
800     }
801    
802     //Modify properties
803     foreach($statusPropertyArray as $val) {
804       if(!checkAndSetErrorNone("$val {$this->$val}")) {
805         return false;
806       }
807     }
808    
809     //Commit changes
810     if(checkAndSetErrorNone("commit")) {
811      
812       //Set mode properties if edit was successful so user can call subsequent commits
813       $this->original_name = $this->name;
814       return true;
815      
816     } else {
817       return false;
818     }
819   }
820  
821   function add($location, $tenant) {
822    
823     global $statusPropertyArray;
824    
825     //Move to tenant mode
826     if(!moveToTenant($location, $tenant)) {
827       return false;
828     }
829    
830     //Initiate new command
831     if(!checkAndSetErrorNone("new status {$this->name}")) {
832       return false;
833     }
834    
835     //Modify properties
836     foreach($statusPropertyArray as $val) {
837       if(!checkAndSetErrorNone("$val {$this->$val}")) {
838         return false;
839       }
840     }
841    
842     //Commit addition
843     if(checkAndSetErrorNone("commit")) {
844      
845       //Set mode properties if addition was successful so user can call commit
846       $this->original_name = $this->name;
847       $this->mode_location = $location;
848       $this->mode_tenant = $tenant;
849       return true;
850      
851     } else {
852       return false;
853     }
854   }
855  }
856  
857  /*###############################################
858   * Class that represents the default local permissions
859   * Attributes:
860   *   call_voice_mail: Allows users to call there own extension's voice mail(BOOLEAN[allow or deny])
861   *   hold_calls: Allows users to place their calls on hold(BOOLEAN[allow or deny])
862   *   transfer_call_to_voice_mail: Allows users to transfer call to their voice mail(BOOLEAN[allow or deny])
863   *   mute: Allows users to mute/unmute themselves when in a conference room or barged call(BOOLEAN[allow or deny])
864   *   record: Allows users to record their calls(BOOLEAN[allow or deny])
865   *   hangup: Allows users to hangup their calls via the panel(BOOLEAN[allow or deny])
866   *   set_user_status_note: Allows users to set their status notes and return time(BOOLEAN[allow or deny]) 
867   *   call_cell_phone: Allows users to call their cell phone(BOOLEAN[allow or deny])
868   *   add_extension_directory: Allows users to add extension directories(BOOLEAN[allow or deny]) 
869   *   set_user_status: Allows users to set their status(BOOLEAN[allow or deny])
870   *   transfer_call_to_cell_phone: Allows users to transfer calls to their cell phone(BOOLEAN[allow or deny])
871   *   agent_login: Allows users to login/logout of their agent via the panel(BOOLEAN[allow or deny])
872   *   add_temp_meetme_room: Allows users to create temporary conference rooms BOOLEAN[allow or deny]
873   *
874   * Methods:
875   *   update: Commits changes made to the property configuration
876   *     Takes: nothing
877   *     Returns: true if successful false if not
878   */
879   class ISymphonyDefaultLocalPermission {
880    
881   //Property attributes
882   var $call_voice_mail = "";
883   var $hold_calls = "";
884   var $transfer_call_to_voice_mail = "";
885   var $mute = "";
886   var $record = "";
887   var $hangup = "";
888   var $set_user_status_note = "";
889   var $call_cell_phone = "";
890   var $add_extension_directory = "";
891   var $set_user_status = "";
892   var $transfer_call_to_cell_phone = "";
893   var $agent_login = "";
894   var $add_temp_meetme_room = "";
895  
896   //Methods
897   function update() {
898    
899     global $localPermissionPropertyArray;
900    
901     //Move to default local permission mode
902     if(!moveToDefaultLocalPermission()) {
903       return false;
904     }
905        
906     //Modify properties
907     foreach($localPermissionPropertyArray as $val) {
908       if(!checkAndSetErrorNone("$val {$this->$val}")) {
909         return false;
910       }
911     }
912    
913     //Commit changes
914     if(checkAndSetErrorNone("commit")) {
915       return true;
916     } else {
917       return false;
918     }
919   }
920  }   
921  
922  /*###############################################
923   * Class that represents the default remote permissions
924   * Attributes:
925   *   call_voice_mail: Allows user to call remote extension voice mail(BOOLEAN[allow or deny])
926   *   transfer_to: Allows users to transfer calls to remote extensions(BOOLEAN[allow or deny])
927   *   transfer_call_to_voice_mail: Allows users to transfer calls to remote extension voice mail(BOOLEAN[allow or deny])
928   *   steal_call: Allows users to steal calls from remote extensions(BOOLEAN[allow or deny])
929   *   record: Allows users to record remote extension calls(BOOLEAN[allow or deny])
930   *   originate_to: Allows users to originate calls to remote extensions via the panel(BOOLEAN[allow or deny])
931   *   email: Allows users to email remote extensions(BOOLEAN[allow or deny]) 
932   *   call_cell_phone: Allows users to call remote extension cell phones(BOOLEAN[allow or deny])
933   *   barge: Allows users to barge in on remote extension calls(BOOLEAN[allow or deny])
934   *   transfer_call_to_cell_phone: Allows users to transfer calls to remote extension voice mail(BOOLEAN[allow or deny])
935   *   chat: Allows users to initiate chat sessions with remote extensions(BOOLEAN[allow or deny])
936   *   agent_login: Allows users to login/logout remote extension agents(BOOLEAN[allow or deny])
937   *   view_calls: Allows users to see remote extension call status(BOOLEAN[allow or deny]) 
938   *   view_caller_id: Allows users to see remote extension callerID(BOOLEAN[allow or deny])
939   *
940   * Methods:
941   *   update: Commits changes made to the property configuration
942   *     Takes: nothing
943   *     Returns: true if successful false if not
944   */
945   class ISymphonyDefaultRemotePermission {
946    
947   //Property attributes
948   var $call_voice_mail = "";
949   var $transfer_to = "";
950   var $transfer_call_to_voice_mail = "";
951   var $steal_call = "";
952   var $record = "";
953   var $originate_to = "";
954   var $email = "";
955   var $call_cell_phone = "";
956   var $barge = "";
957   var $transfer_call_to_cell_phone = "";
958   var $chat = "";
959   var $agent_login = ""; 
960   var $view_calls = "";
961   var $view_caller_id = "";
962  
963   //Methods
964   function update() {
965    
966     global $remotePermissionPropertyArray;
967    
968     //Move to default remote permission mode
969     if(!moveToDefaultRemotePermission()) {
970       return false;
971     }
972        
973     //Modify properties
974     foreach($remotePermissionPropertyArray as $val) {
975       if(!checkAndSetErrorNone("$val {$this->$val}")) {
976         return false;
977       }
978     }
979    
980     //Commit changes
981     if(checkAndSetErrorNone("commit")) {
982       return true;
983     } else {
984       return false;
985     }
986   }
987  } 
988  
989  /*###############################################
990   * Class that represents the default park permissions
991   * Attributes:
992   *   park_call: Allows users to park calls(BOOLEAN[allow or deny])
993   *   set_parked_call_note: Allows users to set parked call notes(BOOLEAN[allow or deny])
994   *   unpark_call: Allows users to take calls from the parking lot via the panel(BOOLEAN[allow or deny])
995   *
996   * Methods:
997   *   update: Commits changes made to the property configuration
998   *     Takes: nothing
999   *     Returns: true if successful false if not
1000   */
1001   class ISymphonyDefaultParkPermission {
1002    
1003   //Property attributes
1004   var $park_call = "";
1005   var $set_parked_call_note = "";
1006   var $unpark_call = "";
1007  
1008   //Methods
1009   function update() {
1010    
1011     global $parkPermissionPropertyArray;
1012    
1013     //Move to default park permission mode
1014     if(!moveToDefaultParkPermission()) {
1015       return false;
1016     }
1017        
1018     //Modify properties
1019     foreach($parkPermissionPropertyArray as $val) {
1020       if(!checkAndSetErrorNone("$val {$this->$val}")) {
1021         return false;
1022       }
1023     }
1024    
1025     //Commit changes
1026     if(checkAndSetErrorNone("commit")) {
1027       return true;
1028     } else {
1029       return false;
1030     }
1031   }
1032  }   
1033  
1034  /*###############################################
1035   * Class that represents the default queue permissions
1036   * Attributes:
1037   *   transfer_to: Allows users to transfer calls to a queue(BOOLEAN[allow or deny])
1038   *   steal_call: Allows users to steal calls from a queue(BOOLEAN[allow or deny])
1039   *
1040   * Methods:
1041   *   update: Commits changes made to the property configuration
1042   *     Takes: nothing
1043   *     Returns: true if successful false if not
1044   */
1045   class ISymphonyDefaultQueuePermission {
1046    
1047   //Property attributes
1048   var $transfer_to = "";
1049   var $steal_call = "";
1050
1051   //Methods
1052   function update() {
1053    
1054     global $queuePermissionPropertyArray;
1055    
1056     //Move to default queue permission mode
1057     if(!moveToDefaultQueuePermission()) {
1058       return false;
1059     }
1060        
1061     //Modify properties
1062     foreach($queuePermissionPropertyArray as $val) {
1063       if(!checkAndSetErrorNone("$val {$this->$val}")) {
1064         return false;
1065       }
1066     }
1067    
1068     //Commit changes
1069     if(checkAndSetErrorNone("commit")) {
1070       return true;
1071     } else {
1072       return false;
1073     }
1074   }
1075  } 
1076  
1077  /*###############################################
1078   * Class that represents the default conference room permissions
1079   * Attributes:
1080   *   steal_call: Allows users to steal calls from conference rooms(BOOLEAN[allow or deny])
1081   *   transfer_to: Allows users to transfer calls to conference rooms(BOOLEAN[allow or deny])
1082   *   originate_to: Allows users to originate calls to a conference room(BOOLEAN[allow or deny])
1083   *   mute_users: Allows users to mute conference room users(BOOLEAN[allow or deny])
1084   *   kick_users: Allows users to kick conference room users from the room(BOOLEAN[allow or deny])
1085   *
1086   * Methods:
1087   *   update: Commits changes made to the property configuration
1088   *     Takes: nothing
1089   *     Returns: true if successful false if not
1090   */ 
1091   class ISymphonyDefaultConferenceRoomPermission {
1092    
1093   //Property attributes
1094   var $steal_call = "";
1095   var $transfer_to = "";
1096   var $originate_to = "";
1097   var $mute_users = "";
1098   var $kick_users = "";
1099  
1100   //Methods
1101   function update() {
1102    
1103     global $conferenceRoomPermissionPropertyArray;
1104    
1105     //Move to default conference room permission mode
1106     if(!moveToDefaultConferenceRoomPermission()) {
1107       return false;
1108     }
1109        
1110     //Modify properties
1111     foreach($conferenceRoomPermissionPropertyArray as $val) {
1112       if(!checkAndSetErrorNone("$val {$this->$val}")) {
1113         return false;
1114       }
1115     }
1116    
1117     //Commit changes
1118     if(checkAndSetErrorNone("commit")) {
1119       return true;
1120     } else {
1121       return false;
1122     }
1123   }
1124  }   
1125  
1126  /*###############################################
1127   * Class that represents a group's local permissions
1128   * Attributes:
1129   *   call_voice_mail: Allows users to call there own extension's voice mail(BOOLEAN[allow or deny])
1130   *   hold_calls: Allows users to place their calls on hold(BOOLEAN[allow or deny])
1131   *   transfer_call_to_voice_mail: Allows users to transfer call to their voice mail(BOOLEAN[allow or deny])
1132   *   mute: Allows users to mute/unmute themselves when in a conference room or barged call(BOOLEAN[allow or deny])
1133   *   record: Allows users to record their calls(BOOLEAN[allow or deny])
1134   *   hangup: Allows users to hangup their calls via the panel(BOOLEAN[allow or deny])
1135   *   set_user_status_note: Allows users to set their status notes and return time(BOOLEAN[allow or deny]) 
1136   *   call_cell_phone: Allows users to call their cell phone(BOOLEAN[allow or deny])
1137   *   add_extension_directory: Allows users to add extension directories(BOOLEAN[allow or deny]) 
1138   *   set_user_status: Allows users to set their status(BOOLEAN[allow or deny])
1139   *   transfer_call_to_cell_phone: Allows users to transfer calls to their cell phone(BOOLEAN[allow or deny])
1140   *   agent_login: Allows users to login/logout of their agent via the panel(BOOLEAN[allow or deny])
1141   *   add_temp_meetme_room: Allows users to create temporary conference rooms BOOLEAN[allow or deny]
1142   *
1143   * Methods:
1144   *   update: Commits changes made to the property configuration
1145   *     Takes: nothing
1146   *     Returns: true if successful false if not
1147   */
1148   class ISymphonyGroupLocalPermission {
1149    
1150   //Mode attributes
1151   var $mode_location = "";
1152   var $mode_tenant = "";
1153   var $mode_group = "";
1154    
1155   //Property attributes
1156   var $call_voice_mail = "";
1157   var $hold_calls = "";
1158   var $transfer_call_to_voice_mail = "";
1159   var $mute = "";
1160   var $record = "";
1161   var $hangup = "";
1162   var $set_user_status_note = "";
1163   var $call_cell_phone = "";
1164   var $add_extension_directory = "";
1165   var $set_user_status = "";
1166   var $transfer_call_to_cell_phone = "";
1167   var $agent_login = "";
1168   var $add_temp_meetme_room = "";
1169  
1170   //Methods
1171   function update() {
1172    
1173     global $localPermissionPropertyArray;
1174    
1175     //Move to group local permission mode
1176     if(!moveToLocalGroupPermission($this->mode_location, $this->mode_tenant, $this->mode_group)) {
1177       return false;
1178     }
1179        
1180     //Modify properties
1181     foreach($localPermissionPropertyArray as $val) {
1182       if(!checkAndSetErrorNone("$val {$this->$val}")) {
1183         return false;
1184       }
1185     }
1186    
1187     //Commit changes
1188     if(checkAndSetErrorNone("commit")) {
1189       return true;
1190     } else {
1191       return false;
1192     }
1193   }
1194  } 
1195  
1196   /*###############################################
1197   * Class that represents a group's park permissions
1198   * Attributes:
1199   *   park_call: Allows users to park calls(BOOLEAN[allow or deny])
1200   *   set_parked_call_note: Allows users to set parked call notes(BOOLEAN[allow or deny])
1201   *   unpark_call: Allows users to take calls from the parking lot via the panel(BOOLEAN[allow or deny])
1202   *
1203   * Methods:
1204   *   update: Commits changes made to the property configuration
1205   *     Takes: nothing
1206   *     Returns: true if successful false if not
1207   */
1208   class ISymphonyGroupParkPermission {
1209    
1210   //Mode attributes
1211   var $mode_location = "";
1212   var $mode_tenant = "";
1213   var $mode_group = "";   
1214    
1215   //Property attributes
1216   var $park_call = "";
1217   var $set_parked_call_note = "";
1218   var $unpark_call = "";
1219  
1220   //Methods
1221   function update() {
1222    
1223     global $parkPermissionPropertyArray;
1224    
1225     //Move to group park permission mode
1226     if(!moveToParkGroupPermission($this->mode_location, $this->mode_tenant, $this->mode_group)) {
1227       return false;
1228     }
1229        
1230     //Modify properties
1231     foreach($parkPermissionPropertyArray as $val) {
1232       if(!checkAndSetErrorNone("$val {$this->$val}")) {
1233         return false;
1234       }
1235     }
1236    
1237     //Commit changes
1238     if(checkAndSetErrorNone("commit")) {
1239       return true;
1240     } else {
1241       return false;
1242     }
1243   }
1244  }   
1245  
1246  /*###############################################
1247   * Class that represents a specified group remote permission set
1248   * Attributes:
1249   *   call_voice_mail: Allows user to call remote extension voice mail(BOOLEAN[allow or deny])
1250   *   transfer_to: Allows users to transfer calls to remote extensions(BOOLEAN[allow or deny])
1251   *   transfer_call_to_voice_mail: Allows users to transfer calls to remote extension voice mail(BOOLEAN[allow or deny])
1252   *   steal_call: Allows users to steal calls from remote extensions(BOOLEAN[allow or deny])
1253   *   record: Allows users to record remote extension calls(BOOLEAN[allow or deny])
1254   *   originate_to: Allows users to originate calls to remote extensions via the panel(BOOLEAN[allow or deny])
1255   *   email: Allows users to email remote extensions(BOOLEAN[allow or deny]) 
1256   *   call_cell_phone: Allows users to call remote extension cell phones(BOOLEAN[allow or deny])
1257   *   barge: Allows users to barge in on remote extension calls(BOOLEAN[allow or deny])
1258   *   transfer_call_to_cell_phone: Allows users to transfer calls to remote extension voice mail(BOOLEAN[allow or deny])
1259   *   chat: Allows users to initiate chat sessions with remote extensions(BOOLEAN[allow or deny])
1260   *   agent_login: Allows users to login/logout remote extension agents(BOOLEAN[allow or deny])
1261   *   view_calls: Allows users to see remote extension call status(BOOLEAN[allow or deny]) 
1262   *   view_caller_id: Allows users to see remote extension callerID(BOOLEAN[allow or deny])
1263   *
1264   * Methods:
1265   *   update: Commits changes made to the property configuration
1266   *     Takes: nothing
1267   *     Returns: true if successful false if not
1268   *   add: Adds the given permission with specified configuration
1269   *     Takes: location, tenant, permission group, extension
1270   *     Returns: true if successful false if not
1271   */ 
1272   class ISymphonyGroupRemotePermission {
1273    
1274   //Mode attributes
1275   var $mode_location = "";
1276   var $mode_tenant = "";
1277   var $mode_group = "";
1278   var $mode_extension = "";   
1279    
1280   //Property attributes
1281   var $call_voice_mail = "";
1282   var $transfer_to = "";
1283   var $transfer_call_to_voice_mail = "";
1284   var $steal_call = "";
1285   var $record = "";
1286   var $originate_to = "";
1287   var $email = "";
1288   var $call_cell_phone = "";
1289   var $barge = "";
1290   var $transfer_call_to_cell_phone = "";
1291   var $chat = "";
1292   var $agent_login = ""; 
1293   var $view_calls = "";
1294   var $view_caller_id = "";
1295  
1296   //Methods
1297   function update() {
1298    
1299     global $remotePermissionPropertyArray;
1300    
1301     //Move to group remote permission mode
1302     if(!moveToRemoteGroupPermission($this->mode_location, $this->mode_tenant, $this->mode_group, $this->mode_extension)) {
1303       return false;
1304     }
1305        
1306     //Modify properties
1307     foreach($remotePermissionPropertyArray as $val) {
1308       if(!checkAndSetErrorNone("$val {$this->$val}")) {
1309         return false;
1310       }
1311     }
1312    
1313     //Commit changes
1314     if(checkAndSetErrorNone("commit")) {
1315       return true;
1316     } else {
1317       return false;
1318     }
1319   }
1320  
1321   function add($location, $tenant, $group, $extension) {
1322    
1323     global $remotePermissionPropertyArray;
1324    
1325     //Move to group mode
1326     if(!moveToPermissionGroup($location, $tenant, $group)) {
1327       return false;
1328     }
1329    
1330     //Initiate new command
1331     if(!checkAndSetErrorNone("new remote $extension")) {
1332       return false;
1333     }
1334    
1335     //Modify properties
1336     foreach($remotePermissionPropertyArray as $val) {
1337       if(!checkAndSetErrorNone("$val {$this->$val}")) {
1338         return false;
1339       }
1340     }
1341    
1342     //Commit addition
1343     if(checkAndSetErrorNone("commit")) {
1344      
1345       //Set mode properties if addition was successful so user can call commit
1346       $this->mode_location = $location;
1347       $this->mode_tenant = $tenant;
1348       $this->mode_group = $group;
1349       $this->mode_extension = $extension;
1350       return true;
1351      
1352     } else {
1353       return false;
1354     }
1355   }   
1356  }   
1357  
1358  /*###############################################
1359   * Class that represents a specified group queue permission set
1360   * Attributes:
1361   *   transfer_to: Allows users to transfer calls to a queue(BOOLEAN[allow or deny])
1362   *   steal_call: Allows users to steal calls from a queue(BOOLEAN[allow or deny])
1363   *
1364   * Methods:
1365   *   update: Commits changes made to the property configuration
1366   *     Takes: nothing
1367   *     Returns: true if successful false if not
1368   *   add: Adds the given permission with specified configuration
1369   *     Takes: location, tenant, permission group, queue
1370   *     Returns: true if successful false if not
1371   */   
1372   class ISymphonyGroupQueuePermission {
1373    
1374   //Mode attributes
1375   var $mode_location = "";
1376   var $mode_tenant = "";
1377   var $mode_group = "";
1378   var $mode_queue = "";   
1379    
1380   //Property attributes
1381   var $transfer_to = "";
1382   var $steal_call = "";
1383  
1384   //Methods
1385   function update() {
1386    
1387     global $queuePermissionPropertyArray;
1388    
1389     //Move to group mode
1390     if(!moveToQueueGroupPermission($this->mode_location, $this->mode_tenant, $this->mode_group, $this->mode_queue)) {
1391       return false;
1392     }
1393        
1394     //Modify properties
1395     foreach($queuePermissionPropertyArray as $val) {
1396       if(!checkAndSetErrorNone("$val {$this->$val}")) {
1397         return false;
1398       }
1399     }
1400    
1401     //Commit changes
1402     if(checkAndSetErrorNone("commit")) {
1403       return true;
1404     } else {
1405       return false;
1406     }
1407   }
1408  
1409   function add($location, $tenant, $group, $queue) {
1410    
1411     global $queuePermissionPropertyArray;
1412    
1413     //Move to group mode
1414     if(!moveToPermissionGroup($location, $tenant, $group)) {
1415       return false;
1416     }
1417    
1418     //Initiate new command
1419     if(!checkAndSetErrorNone("new queue $queue")) {
1420       return false;
1421     }
1422    
1423     //Modify properties
1424     foreach($queuePermissionPropertyArray as $val) {
1425       if(!checkAndSetErrorNone("$val {$this->$val}")) {
1426         return false;
1427       }
1428     }
1429    
1430     //Commit addition
1431     if(checkAndSetErrorNone("commit")) {
1432      
1433       //Set mode properties if addition was successful so user can call commit
1434       $this->mode_location = $location;
1435       $this->mode_tenant = $tenant;
1436       $this->mode_group = $group;
1437       $this->mode_queue = $queue;
1438       return true;
1439      
1440     } else {
1441       return false;
1442     }
1443   }   
1444  } 
1445  
1446  /*###############################################
1447   * Class that represents a specified group conference room permission set
1448   * Attributes:
1449   *   steal_call: Allows users to steal calls from conference rooms(BOOLEAN[allow or deny])
1450   *   transfer_to: Allows users to transfer calls to conference rooms(BOOLEAN[allow or deny])
1451   *   originate_to: Allows users to originate calls to a conference room(BOOLEAN[allow or deny])
1452   *   mute_users: Allows users to mute conference room users(BOOLEAN[allow or deny])
1453   *   kick_users: Allows users to kick conference room users from the room(BOOLEAN[allow or deny])
1454   *
1455   * Methods:
1456   *   update: Commits changes made to the property configuration
1457   *     Takes: nothing
1458   *     Returns: true if successful false if not
1459   *   add: Adds the given permission with specified configuration
1460   *     Takes: location, tenant, permission group, room
1461   *     Returns: true if successful false if not
1462   */ 
1463   class ISymphonyGroupConferenceRoomPermission {
1464    
1465   //Mode attributes
1466   var $mode_location = "";
1467   var $mode_tenant = "";
1468   var $mode_group = "";
1469   var $mode_room = "";   
1470    
1471   //Property attributes
1472   var $steal_call = "";
1473   var $transfer_to = "";
1474   var $originate_to = "";
1475   var $mute_users = "";
1476   var $kick_users = "";
1477  
1478   //Methods
1479   function update() {
1480    
1481     global $conferenceRoomPermissionPropertyArray;
1482    
1483     //Move to group mode
1484     if(!moveToConferenceRoomGroupPermission($this->mode_location, $this->mode_tenant, $this->mode_group, $this->mode_room)) {
1485       return false;
1486     }
1487        
1488     //Modify properties
1489     foreach($conferenceRoomPermissionPropertyArray as $val) {
1490       if(!checkAndSetErrorNone("$val {$this->$val}")) {
1491         return false;
1492       }
1493     }
1494    
1495     //Commit changes
1496     if(checkAndSetErrorNone("commit")) {
1497       return true;
1498     } else {
1499       return false;
1500     }
1501   }
1502  
1503   function add($location, $tenant, $group, $room) {
1504    
1505     global $conferenceRoomPermissionPropertyArray;
1506    
1507     //Move to group mode
1508     if(!moveToPermissionGroup($location, $tenant, $group)) {
1509       return false;
1510     }
1511    
1512     //Initiate new command
1513     if(!checkAndSetErrorNone("new meetme $room")) {
1514       return false;
1515     }
1516    
1517     //Modify properties
1518     foreach($conferenceRoomPermissionPropertyArray as $val) {
1519       if(!checkAndSetErrorNone("$val {$this->$val}")) {
1520         return false;
1521       }
1522     }
1523    
1524     //Commit addition
1525     if(checkAndSetErrorNone("commit")) {
1526      
1527       //Set mode properties if addition was successful so user can call commit
1528       $this->mode_location = $location;
1529       $this->mode_tenant = $tenant;
1530       $this->mode_group = $group;
1531       $this->mode_room = $room;
1532       return true;
1533      
1534     } else {
1535       return false;
1536     }
1537   }   
1538  }   
1539  
1540  /*###############################################
1541   * Class that represents a profile's local override permissions
1542   * Attributes:
1543   *   call_voice_mail: Allows users to call there own extension's voice mail(BOOLEAN[allow or deny])
1544   *   hold_calls: Allows users to place their calls on hold(BOOLEAN[allow or deny])
1545   *   transfer_call_to_voice_mail: Allows users to transfer call to their voice mail(BOOLEAN[allow or deny])
1546   *   mute: Allows users to mute/unmute themselves when in a conference room or barged call(BOOLEAN[allow or deny])
1547   *   record: Allows users to record their calls(BOOLEAN[allow or deny])
1548   *   hangup: Allows users to hangup their calls via the panel(BOOLEAN[allow or deny])
1549   *   set_user_status_note: Allows users to set their status notes and return time(BOOLEAN[allow or deny]) 
1550   *   call_cell_phone: Allows users to call their cell phone(BOOLEAN[allow or deny])
1551   *   add_extension_directory: Allows users to add extension directories(BOOLEAN[allow or deny]) 
1552   *   set_user_status: Allows users to set their status(BOOLEAN[allow or deny])
1553   *   transfer_call_to_cell_phone: Allows users to transfer calls to their cell phone(BOOLEAN[allow or deny])
1554   *   agent_login: Allows users to login/logout of their agent via the panel(BOOLEAN[allow or deny])
1555   *   add_temp_meetme_room: Allows users to create temporary conference rooms BOOLEAN[allow or deny]
1556   *
1557   * Methods:
1558   *   update: Commits changes made to the property configuration
1559   *     Takes: nothing
1560   *     Returns: true if successful false if not
1561   */
1562   class ISymphonyOverrideLocalPermission {
1563    
1564   //Mode attributes
1565   var $mode_location = "";
1566   var $mode_tenant = "";
1567   var $mode_profile = "";
1568    
1569   //Property attributes
1570   var $call_voice_mail = "";
1571   var $hold_calls = "";
1572   var $transfer_call_to_voice_mail = "";
1573   var $mute = "";
1574   var $record = "";
1575   var $hangup = "";
1576   var $set_user_status_note = "";
1577   var $call_cell_phone = "";
1578   var $add_extension_directory = "";
1579   var $set_user_status = "";
1580   var $transfer_call_to_cell_phone = "";
1581   var $agent_login = "";
1582   var $add_temp_meetme_room = "";
1583  
1584   //Methods
1585   function update() {
1586    
1587     global $localPermissionPropertyArray;
1588    
1589     //Move to profile local permission mode
1590     if(!moveToLocalOverridePermission($this->mode_location, $this->mode_tenant, $this->mode_profile)) {
1591       return false;
1592     }
1593        
1594     //Modify properties
1595     foreach($localPermissionPropertyArray as $val) {
1596       if(!checkAndSetErrorNone("$val {$this->$val}")) {
1597         return false;
1598       }
1599     }
1600    
1601     //Commit changes
1602     if(checkAndSetErrorNone("commit")) {
1603       return true;
1604     } else {
1605       return false;
1606     }
1607   }
1608  }   
1609  
1610   /*###############################################
1611   * Class that represents a profile's park override permissions
1612   * Attributes:
1613   *   park_call: Allows users to park calls(BOOLEAN[allow or deny])
1614   *   set_parked_call_note: Allows users to set parked call notes(BOOLEAN[allow or deny])
1615   *   unpark_call: Allows users to take calls from the parking lot via the panel(BOOLEAN[allow or deny])
1616   *
1617   * Methods:
1618   *   update: Commits changes made to the property configuration
1619   *     Takes: nothing
1620   *     Returns: true if successful false if not
1621   */
1622   class ISymphonyOverrideParkPermission {
1623    
1624   //Mode attributes
1625   var $mode_location = "";
1626   var $mode_tenant = "";
1627   var $mode_profilegroup = "";   
1628    
1629   //Property attributes
1630   var $park_call = "";
1631   var $set_parked_call_note = "";
1632   var $unpark_call = "";
1633  
1634   //Methods
1635   function update() {
1636    
1637     global $parkPermissionPropertyArray;
1638    
1639     //Move to profile park permission mode
1640     if(!moveToParkOverridePermission($this->mode_location, $this->mode_tenant, $this->mode_profile)) {
1641       return false;
1642     }
1643        
1644     //Modify properties
1645     foreach($parkPermissionPropertyArray as $val) {
1646       if(!checkAndSetErrorNone("$val {$this->$val}")) {
1647         return false;
1648       }
1649     }
1650    
1651     //Commit changes
1652     if(checkAndSetErrorNone("commit")) {
1653       return true;
1654     } else {
1655       return false;
1656     }
1657   }
1658  }   
1659
1660  /*###############################################
1661   * Class that represents a profile's specified remote override permission set
1662   * Attributes:
1663   *   call_voice_mail: Allows user to call remote extension voice mail(BOOLEAN[allow or deny])
1664   *   transfer_to: Allows users to transfer calls to remote extensions(BOOLEAN[allow or deny])
1665   *   transfer_call_to_voice_mail: Allows users to transfer calls to remote extension voice mail(BOOLEAN[allow or deny])
1666   *   steal_call: Allows users to steal calls from remote extensions(BOOLEAN[allow or deny])
1667   *   record: Allows users to record remote extension calls(BOOLEAN[allow or deny])
1668   *   originate_to: Allows users to originate calls to remote extensions via the panel(BOOLEAN[allow or deny])
1669   *   email: Allows users to email remote extensions(BOOLEAN[allow or deny]) 
1670   *   call_cell_phone: Allows users to call remote extension cell phones(BOOLEAN[allow or deny])
1671   *   barge: Allows users to barge in on remote extension calls(BOOLEAN[allow or deny])
1672   *   transfer_call_to_cell_phone: Allows users to transfer calls to remote extension voice mail(BOOLEAN[allow or deny])
1673   *   chat: Allows users to initiate chat sessions with remote extensions(BOOLEAN[allow or deny])
1674   *   agent_login: Allows users to login/logout remote extension agents(BOOLEAN[allow or deny])
1675   *   view_calls: Allows users to see remote extension call status(BOOLEAN[allow or deny]) 
1676   *   view_caller_id: Allows users to see remote extension callerID(BOOLEAN[allow or deny])
1677   *
1678   * Methods:
1679   *   update: Commits changes made to the property configuration
1680   *     Takes: nothing
1681   *     Returns: true if successful false if not
1682   *   add: Adds the given permission with specified configuration
1683   *     Takes: location, tenant, profile, extension
1684   *     Returns: true if successful false if not
1685   */ 
1686   class ISymphonyOverrideRemotePermission {
1687    
1688   //Mode attributes
1689   var $mode_location = "";
1690   var $mode_tenant = "";
1691   var $mode_proile = "";
1692   var $mode_extension = "";   
1693    
1694   //Property attributes
1695   var $call_voice_mail = "";
1696   var $transfer_to = "";
1697   var $transfer_call_to_voice_mail = "";
1698   var $steal_call = "";
1699   var $record = "";
1700   var $originate_to = "";
1701   var $email = "";
1702   var $call_cell_phone = "";
1703   var $barge = "";
1704   var $transfer_call_to_cell_phone = "";
1705   var $chat = "";
1706   var $agent_login = ""; 
1707   var $view_calls = "";
1708   var $view_caller_id = "";
1709  
1710   //Methods
1711   function update() {
1712    
1713     global $remotePermissionPropertyArray;
1714    
1715     //Move to profile remote permission mode
1716     if(!moveToRemoteOverridePermission($this->mode_location, $this->mode_tenant, $this->mode_profile, $this->mode_extension)) {
1717       return false;
1718     }
1719        
1720     //Modify properties
1721     foreach($remotePermissionPropertyArray as $val) {
1722       if(!checkAndSetErrorNone("$val {$this->$val}")) {
1723         return false;
1724       }
1725     }
1726    
1727     //Commit changes
1728     if(checkAndSetErrorNone("commit")) {
1729       return true;
1730     } else {
1731       return false;
1732     }
1733   }
1734  
1735   function add($location, $tenant, $profile, $extension) {
1736    
1737     global $remotePermissionPropertyArray;
1738    
1739     //Move to profile mode
1740     if(!moveToProfile($location, $tenant, $profile)) {
1741       return false;
1742     }
1743    
1744     //Initiate new command
1745     if(!checkAndSetErrorNone("new remote $extension")) {
1746       return false;
1747     }
1748    
1749     //Modify properties
1750     foreach($remotePermissionPropertyArray as $val) {
1751       if(!checkAndSetErrorNone("$val {$this->$val}")) {
1752         return false;
1753       }
1754     }
1755    
1756     //Commit addition
1757     if(checkAndSetErrorNone("commit")) {
1758      
1759       //Set mode properties if addition was successful so user can call commit
1760       $this->mode_location = $location;
1761       $this->mode_tenant = $tenant;
1762       $this->mode_profile = $profile;
1763       $this->mode_extension = $extension;
1764       return true;
1765      
1766     } else {
1767       return false;
1768     }
1769   }   
1770  }   
1771  
1772  /*###############################################
1773   * Class that represents a profile's specified override queue permission set
1774   * Attributes:
1775   *   transfer_to: Allows users to transfer calls to a queue(BOOLEAN[allow or deny])
1776   *   steal_call: Allows users to steal calls from a queue(BOOLEAN[allow or deny])
1777   *
1778   * Methods:
1779   *   update: Commits changes made to the property configuration
1780   *     Takes: nothing
1781   *     Returns: true if successful false if not
1782   *   add: Adds the given permission with specified configuration
1783   *     Takes: location, tenant, profile, queue
1784   *     Returns: true if successful false if not
1785   */   
1786   class ISymphonyOverrideQueuePermission {
1787    
1788   //Mode attributes
1789   var $mode_location = "";
1790   var $mode_tenant = "";
1791   var $mode_profile = "";
1792   var $mode_queue = "";   
1793    
1794   //Property attributes
1795   var $transfer_to = "";
1796   var $steal_call = "";
1797  
1798   //Methods
1799   function update() {
1800    
1801     global $queuePermissionPropertyArray;
1802    
1803     //Move to profile queue permission mode
1804     if(!moveToQueueOverridePermission($this->mode_location, $this->mode_tenant, $this->mode_profile, $this->mode_queue)) {
1805       return false;
1806     }
1807        
1808     //Modify properties
1809     foreach($queuePermissionPropertyArray as $val) {
1810       if(!checkAndSetErrorNone("$val {$this->$val}")) {
1811         return false;
1812       }
1813     }
1814    
1815     //Commit changes
1816     if(checkAndSetErrorNone("commit")) {
1817       return true;
1818     } else {
1819       return false;
1820     }
1821   }
1822  
1823   function add($location, $tenant, $profile, $queue) {
1824    
1825     global $queuePermissionPropertyArray;
1826    
1827     //Move to profile mode
1828     if(!moveToProfile($location, $tenant, $profile)) {
1829       return false;
1830     }
1831    
1832     //Initiate new command
1833     if(!checkAndSetErrorNone("new queue $queue")) {
1834       return false;
1835     }
1836    
1837     //Modify properties
1838     foreach($queuePermissionPropertyArray as $val) {
1839       if(!checkAndSetErrorNone("$val {$this->$val}")) {
1840         return false;
1841       }
1842     }
1843    
1844     //Commit addition
1845     if(checkAndSetErrorNone("commit")) {
1846      
1847       //Set mode properties if addition was successful so user can call commit
1848       $this->mode_location = $location;
1849       $this->mode_tenant = $tenant;
1850       $this->mode_profile = $profile;
1851       $this->mode_queue = $queue;
1852       return true;
1853      
1854     } else {
1855       return false;
1856     }
1857   }   
1858  } 
1859  
1860  /*###############################################
1861   * Class that represents a profile's specified override conference room permission set
1862   * Attributes:
1863   *   steal_call: Allows users to steal calls from conference rooms(BOOLEAN[allow or deny])
1864   *   transfer_to: Allows users to transfer calls to conference rooms(BOOLEAN[allow or deny])
1865   *   originate_to: Allows users to originate calls to a conference room(BOOLEAN[allow or deny])
1866   *   mute_users: Allows users to mute conference room users(BOOLEAN[allow or deny])
1867   *   kick_users: Allows users to kick conference room users from the room(BOOLEAN[allow or deny])
1868   *
1869   * Methods:
1870   *   update: Commits changes made to the property configuration
1871   *     Takes: nothing
1872   *     Returns: true if successful false if not
1873   *   add: Adds the given permission with specified configuration
1874   *     Takes: location, tenant, profile, room
1875   *     Returns: true if successful false if not
1876   */ 
1877   class ISymphonyOverrideConferenceRoomPermission {
1878    
1879   //Mode attributes
1880   var $mode_location = "";
1881   var $mode_tenant = "";
1882   var $mode_profile = "";
1883   var $mode_room = "";   
1884    
1885   //Property attributes
1886   var $steal_call = "";
1887   var $transfer_to = "";
1888   var $originate_to = "";
1889   var $mute_users = "";
1890   var $kick_users = "";
1891  
1892   //Methods
1893   function update() {
1894    
1895     global $conferenceRoomPermissionPropertyArray;
1896    
1897     //Move to profile mode
1898     if(!moveToConferenceRoomOverridePermission($this->mode_location, $this->mode_tenant, $this->mode_profile, $this->mode_room)) {
1899       return false;
1900     }
1901        
1902     //Modify properties
1903     foreach($conferenceRoomPermissionPropertyArray as $val) {
1904       if(!checkAndSetErrorNone("$val {$this->$val}")) {
1905         return false;
1906       }
1907     }
1908    
1909     //Commit changes
1910     if(checkAndSetErrorNone("commit")) {
1911       return true;
1912     } else {
1913       return false;
1914     }
1915   }
1916  
1917   function add($location, $tenant, $profile, $room) {
1918    
1919     global $conferenceRoomPermissionPropertyArray;
1920    
1921     //Move to profile mode
1922     if(!moveToProfile($location, $tenant, $profile)) {
1923       return false;
1924     }
1925    
1926     //Initiate new command
1927     if(!checkAndSetErrorNone("new meetme $room")) {
1928       return false;
1929     }
1930    
1931     //Modify properties
1932     foreach($conferenceRoomPermissionPropertyArray as $val) {
1933       if(!checkAndSetErrorNone("$val {$this->$val}")) {
1934         return false;
1935       }
1936     }
1937    
1938     //Commit addition
1939     if(checkAndSetErrorNone("commit")) {
1940      
1941       //Set mode properties if addition was successful so user can call commit
1942       $this->mode_location = $location;
1943       $this->mode_tenant = $tenant;
1944       $this->mode_profile = $profile;
1945       $this->mode_room = $room;
1946       return true;
1947      
1948     } else {
1949       return false;
1950     }
1951   }   
1952  }   
1953 ?>
Note: See TracBrowser for help on using the browser.