I should be able to add an inbound route using Graphql via:
mutation {
addInboundRoute(input: {
extension:"3068675309"
cidnum:"3068675309"
description:"sholinaty TEST"
grppre:"SHOLE"
destination:"ext-queues,999"
}) {
inboundRoute {
id
}
status
message
}
}
that should have each of the Mandatory fields (Extension, CIDNum, destination)
however, it responds with an HTTP 400, with “Internal Server Error” as the response.
My assumption is that the issue is the Destination, but where/how would I find what to use?
in the example its just a number. but Inbound Routes have several configuration options (dropdowns) and specific data there…
Anyone have a working example of how to get the AddInboundRoute Graphql API working?
this is the weirdest thing.
From walking the source code, that API should be adding a line to the SQL table incoming
checking that table, the values I’m sending Should exist (Example off my test server)
Maybe the Wiki is wrong and there are more mandatory fields? Use the example and start removing what the Wiki refers to as “Optional” fields and see when it breaks
man… who Wrote this…
the graphql API:
runs “add DID Defaults” on an empty array
then calls a function… that calls AddDIDDefaults with the input values (use input value if set…) a second time…
Still not sure yet why its failing if any of those boolean fields arent set in the request. it doesn’t make sense.
… inputs = inputs
defaults = blank array
defaults = fetch the defaults
for each field in defaults, if not set in input, set it to the default (so now, Input = input, or Default if not set)
then MERGE the defaults and input for some reason
then call addDID, which fetches the “set or default” a 2nd time
… its been a bad day… sorry about that.
One of our sip trunk providers migrated us to a new platform with maybe 30% the functionality of the old one, and now all my backlogged tasks are “Urgent” and blocked.