Trunk's Default Route via API

Tom R

Platinum Partner
Advanced Certified
Joined
Sep 6, 2024
Messages
5
Reaction score
1
Is it possible to pull the SIP Trunk Default Route from the API?

I have explored the documentation but can't seem to find it.
Thanks
 
Is it possible to pull the SIP Trunk Default Route from the API?
  1. Which API and from where?
  2. 3CX API in the 3CX per CFD App or call script?
  3. 3CX configuration API via web request?
  4. Where is the 3CX hosted?
  5. How have you access to it?
  6. What is the purpose of the query?
 
  1. Which API and from where?
  2. 3CX API in the 3CX per CFD App or call script?
  3. 3CX configuration API via web request?
  4. Where is the 3CX hosted?
  5. How have you access to it?
  6. What is the purpose of the query?
3CX configuration API via web request, with a system owner user authenticated.

I need to be able to pull the default route so I can audit and report on call routing
 
powershell example for a single trunk:

Code:
$uri="https://$tcxurl/xapi/v1/Trunks(1234)?`$expand=RoutingRules(`$select=Id,Condition,Data,OfficeHoursDestination,RuleName)"
((Invoke-RestMethod -uri $uri -headers $headers -Method GET -ContentType "application/json").RoutingRules | Where { $_.Condition -eq "ForwardAll" }).OfficeHoursDestination.Number

you should know the specific trunk ID or get all in a loop and select it by name there
 
  • Like
Reactions: jed and Tom R
powershell example for a single trunk:

Code:
$uri="https://$tcxurl/xapi/v1/Trunks(1234)?`$expand=RoutingRules(`$select=Id,Condition,Data,OfficeHoursDestination,RuleName)"
((Invoke-RestMethod -uri $uri -headers $headers -Method GET -ContentType "application/json").RoutingRules | Where { $_.Condition -eq "ForwardAll" }).OfficeHoursDestination.Number

you should know the specific trunk ID or get all in a loop and select it by name there
Thanks. This is working!
 
  • Like
Reactions: fxbastler

Members Online Now

Forum statistics

Threads
111,831
Messages
589,277
Members
164,660
Latest member
RJenkinsROCK