diff --git a/odins_spear/methods/post.py b/odins_spear/methods/post.py index 39251a7..ed69701 100644 --- a/odins_spear/methods/post.py +++ b/odins_spear/methods/post.py @@ -381,25 +381,6 @@ def group_trunk_group(self, service_provider_id: str, group_id: str, trunk_name: sip_authentication_username: str="", sip_authentication_password: str=""): """ Builds a Trunk Group (TG) in the specified group. - Default fields: - "capacityExceededTrapInitialCalls":0, - "capacityExceededTrapOffsetCalls":0, - "clidSourceForScreenedCallsPolicy":"Profile Name Profile Number", - "continuousOptionsSendingIntervalSeconds":30, - "failureOptionsSendingIntervalSeconds":10, - "failureThresholdCounter":1, - "invitationTimeout":6, - "inviteFailureThresholdCounter":1, - "inviteFailureThresholdWindowSeconds":30, - "pilotUserCallOptimizationPolicy":"Optimize For User Services", - "pilotUserCallingLineAssertedIdentityPolicy":"Unscreened Originating Calls", - "pilotUserCallingLineIdentityForEmergencyCallsPolicy":"No Calls", - "pilotUserCallingLineIdentityForExternalCallsPolicy":"No Calls", - "pilotUserChargeNumberPolicy":"No Calls", - "requireAuthentication":"false", - "successThresholdCounter":1, - "useSystemUserLookupPolicy":"true", - "userLookupPolicy":"Basic" Args: service_provider_id (str): The service provider ID in which the target group is built. @@ -424,10 +405,6 @@ def group_trunk_group(self, service_provider_id: str, group_id: str, trunk_name: payload["serviceProviderId"] = service_provider_id payload["groupId"] = group_id - if payload["requireAuthentication"] == "true": - payload["sipAuthenticationUserName"] = sip_authentication_username - payload["sipAuthenticationPassword"] = sip_authentication_password - default_payload_values = { "capacityExceededTrapInitialCalls": 0, "capacityExceededTrapOffsetCalls": 0, @@ -451,6 +428,10 @@ def group_trunk_group(self, service_provider_id: str, group_id: str, trunk_name: for key, default_value in default_payload_values.items(): payload.setdefault(key, default_value) + if payload["requireAuthentication"] == "true": + payload["sipAuthenticationUserName"] = sip_authentication_username + payload["sipAuthenticationPassword"] = sip_authentication_password + return self.requester.post(endpoint, data=payload) #TWO STAGE DIALING diff --git a/odins_spear/methods/put.py b/odins_spear/methods/put.py index b30debd..7e5cbd7 100644 --- a/odins_spear/methods/put.py +++ b/odins_spear/methods/put.py @@ -1048,16 +1048,15 @@ def user_services(self, user_id: str, services: list =None, service_packs: list #TRUNK GROUPS def group_trunk_groups_call_capacity(self, service_provider_id: str, group_id: str, max_active_calls: int=None, - max_available_active_calls: int=None, bursting_max_active_calls: int=None, - number_of_bursting_btlus: int=None): + bursting_max_active_calls: int=None, number_of_bursting_btlus: int=None): """ Updates the trunking call capacity in the specified group. + NOTE: The max available active calls cannot be changed here. Please see service_providers_trunk_group_call_capacity to update this. Args: service_provider_id (str): Service provider ID where the target group is built group_id (str): Group ID whose trunk group call capacity needs updating max_active_calls (int, optional): The max active calls for the group. - max_available_active_calls (int, optional): The max available active calls for the group. bursting_max_active_calls (int, optional): The bursting max active calls for the group. number_of_bursting_btlus (int, optional): The number of Business Trunking License Units for bursting. @@ -1074,8 +1073,6 @@ def group_trunk_groups_call_capacity(self, service_provider_id: str, group_id: s if max_active_calls: updates["maxActiveCalls"] = max_active_calls - if max_available_active_calls: - updates["maxAvailableActiveCalls"] = max_available_active_calls if bursting_max_active_calls: updates["burstingMaxActiveCalls"] = bursting_max_active_calls if number_of_bursting_btlus: @@ -1084,13 +1081,14 @@ def group_trunk_groups_call_capacity(self, service_provider_id: str, group_id: s return self.requester.put(endpoint, data=updates) - def group_trunk_group(self, service_provider_id: str, group_id: str, updates: dict): + def group_trunk_group(self, service_provider_id: str, group_id: str, trunk_group_name: str, updates: dict): """ Updates trunk group (TG) information. Args: service_provider_id (str): Service provider ID where the target group is built group_id (str): Group ID whose trunk group call capacity needs updating + trunk_group_name (str): The name of the trunk group that is being updated. updates (dict): Updates to be applied to the TG. Returns: @@ -1101,6 +1099,7 @@ def group_trunk_group(self, service_provider_id: str, group_id: str, updates: di updates["serviceProviderId"] = service_provider_id updates["groupId"] = group_id + updates["name"] = trunk_group_name return self.requester.put(endpoint, data=updates)