def _get_cups_cupc(self): sqlutils = AXLSQLUtils(self.__configname__) if not self.__attached__: raise exceptions.NotAttachedException('User is not attached') re = sqlutils.has_cups_cupc(self._uuid) if re is None: return None, None, None return re['enablecups'] == 't', re['enablecupc'] == 't', re['pkid']
def get_mobility_association(self): """ return phones that are associated with this user. """ sqlutils = AXLSQLUtils(self.__configname__) if not self.__attached__: raise exceptions.NotAttachedException('User is not attached') for i in sqlutils.user_phone_association(self._uuid): yield Phone(uuid=i['fkdevice'])
def set_single_number_reach(self, value): """ Set single number reach flag is not possible in version 10.5 see ticket: https://supportforums.cisco.com/discussion/12438721/single-number-reach-axl The workaround is again to set some value with SQL! Yupiiiii! """ if not self.__attached__: raise exceptions.NotAttachedException('User is not attached') sqlutils = AXLSQLUtils(self.__configname__) sqlutils.set_single_number_reach(self._uuid, value)
def update_bfcp(self, value): if not self.__attached__: raise exceptions.LogoutException('Phone is not attached') if not self.protocol == 'SIP': raise exceptions.PyAXLException('To change BFCP the phone must support SIP protocol') # only available for newer version, is this flag is not present we need to do it with sql if hasattr(self, 'AllowPresentationSharingUsingBfcp'): clone = copy(self) clone.AllowPresentationSharingUsingBfcp = value clone.__updateable__ = ['AllowPresentationSharingUsingBfcp'] clone.update() self.AllowPresentationSharingUsingBfcp = value else: sqlutils = AXLSQLUtils(self.__configname__) sqlutils.update_bfcp(self._uuid, value)
def set_cups_cupc(self, cups, cupc): sqlutils = AXLSQLUtils(self.__configname__) if cupc and not cups: raise exceptions.PyAXLException('If cupc is true, cups must also be true') rcups, rcupc, pkid = self._get_cups_cupc() if rcups is None and cups: sqlutils.insert_cups(self._uuid, cupc) elif rcups and not cups: sqlutils.remove_cups(self._uuid) elif rcups and cups: sqlutils.update_cups(self._uuid, cupc)
def get_single_number_reach(self): if not self.__attached__: raise exceptions.NotAttachedException('User is not attached') sqlutils = AXLSQLUtils(self.__configname__) value = sqlutils.get_single_number_reach(self._uuid) return value['enablesinglenumberreach'] == 't'