Change DID Destination via Call Control API

Discussion in 'CRM / Helpdesk / App Integration' started by Michael Groom, Mar 2, 2018.

Thread Status:
Not open for further replies.
  1. Michael Groom

    Joined:
    Dec 11, 2017
    Messages:
    43
    Likes Received:
    2
    Not sure if this can be done, but can i change the destination of a DID via a script in the API?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,078
    Likes Received:
    76
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Michael Groom

    Joined:
    Dec 11, 2017
    Messages:
    43
    Likes Received:
    2
    OK ty. is there a sample in the sample folder?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,078
    Likes Received:
    76
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Michael Groom

    Joined:
    Dec 11, 2017
    Messages:
    43
    Likes Received:
    2
    Still working on a solution for this. Its hard to find exact stuff i need as api has poor documentation
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. Michael Groom

    Joined:
    Dec 11, 2017
    Messages:
    43
    Likes Received:
    2
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Joined:
    Jun 27, 2007
    Messages:
    1,078
    Likes Received:
    76
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Thread Status:
Not open for further replies.