示例#1
0
 def get_pn_registrations(self):
     tree = self.xsi_get("profile/PushNotificationRegistrations")
     res = []
     for e in tree.findall(utils.ns_escape("pushNotificationRegistration")):
         item = utils.node_list(e)
         item["token"] = utils.node_value(
             e, "deviceTokenList"
             "/deviceToken/token")
         res.append(item)
     return res
示例#2
0
 def get_simultaneous_ring(self, **kwargs):
     """Get Simultaneous Ring call setting.
     """
     tree = self.xsi_get("services/simultaneousringpersonal")
     active, ring = [
         utils.node_value(tree, x) for x in ("active", "incomingCalls")
     ]
     return {
         "active":
         utils.str_to_bool(active),
         "incomingCalls": (ring == "Do not Ring if on a Call"),
         "simRingLocations":
         map(
             lambda elem: utils.node_list(elem),
             tree.findall(
                 utils.ns_escape("simRingLocations/simRingLocation")))
     }
示例#3
0
 def get_broadworks_anywhere(self):
     """Get BroadWorks Anywhere call setting.
     """
     tree = self.xsi_get("services/broadworksanywhere")
     dial, paging = [
         utils.node_value(tree, x)
         for x in ("alertAllLocationsForClickToDialCalls",
                   "alertAllLocationsForGroupPagingCalls")
     ]
     return {
         "alertAllLocationsForClickToDialCalls":
         utils.str_to_bool(dial),
         "alertAllLocationsForGroupPagingCalls":
         utils.str_to_bool(paging),
         "locations":
         map(lambda elem: utils.node_list(elem),
             tree.findall(utils.ns_escape("locations/location")))
     }
示例#4
0
 def get_broadworks_anywhere_location(self, phoneNumber):
     """Get BroadWorks Anywhere location.
     """
     tree = self.xsi_get("services/broadworksanywhere/location/%s" %
                         phoneNumber)
     return utils.node_list(tree.getroot())