Change DID Destination via Call Control API

Status
Not open for further replies.

Michael Groom

Customer
Joined
Dec 11, 2017
Messages
62
Reaction score
3
Not sure if this can be done, but can i change the destination of a DID via a script in the API?
 
Hello @Michael Groom,

Using the 3CX Call Control API you can change the 3CX configuration, including the DID destination. You can do it in the same way the 3CX console does.

Kind regards.
 
OK ty. is there a sample in the sample folder?
 
I'm not sure if there is a sample specific for changing a DID, but take a look at the CHM help file included, which has all the information you need. Look for the PhoneSystem class, which is the root entry point, and from there you can access all the information you need.

For example, invoking "PhoneSystem.Root.GetVoipProviders()" you will get an array of all the SIP trunks in your 3CX server. Then you can get the ExternalLine objects associated to that SIP trunk, and finally the DIDNumbers property will give you the DIDs for the lines. You can also get the inbound rules using the API. Please take a look at the docs for more details.

Kind regards.
 
Still working on a solution for this. Its hard to find exact stuff i need as api has poor documentation
 
Does anyone here know how to find the inbound rules for a did i have been through all of the documentation but there is no inbound rule like there is outbound.
 
PhoneSystem.Root.GetExternalLines() will give you the array of ExternalLines available.

Then, once you select your external line, you can check the ExternalLine.RoutingRules property.
 
Status
Not open for further replies.

Latest Posts

Forum statistics

Threads
112,323
Messages
591,896
Members
165,473
Latest member
NathanMitchell