Discussions
Mapping Phone number to Domain
In the V1 API I was able to do a query like this which would return information on a phone number including the domain the number was part of if the number was on the switch.
V1 method I would pass these parms
postParameters.Add("object", "phonenumber");
postParameters.Add("action", "read");
postParameters.Add("dialplan", "DID Table");
postParameters.Add("matchrule", "sip:" + phoneNumber + "@*");
postParameters.Add("format", "json");
In the V2 API the closet method I see is Get All Phone Numbers for System or Reseller
get
https://{server}/ns-api/v2/phonenumbers
Which returns an array of objects, where each object includes the phone number and domain. But this means I need to look at every phone number on the switch to figure out if the number already exists.
Is there an equivalent method in V2 to provided a phone number and find out what domain its in without having to loop through all the phone numbers on the switch?