Fetch pjsip extension secret on Asterisk 16, FreePBX 15

Hello!
…so i have a running instance of asterisk 16 with FreePBX 15, i have some extensions created using the normal FreePBX Extensions Application, extensions use pjsip.

I had setup an application that uses the provided Graphql Api to fetch the the extension details with the following query.
{ fetchAllExtensions { extension { id extensionId tech coreDevice { id deviceId devicetype description emergencyCid tech { __typename ... on pjsip { tech secret } ... on unknowntech { tech } } } } } }
…this used to work very well, until something happened and lost the vm running asterisk. After setting up another instance, this same query would not ran, this is the updated query that works,
{ fetchAllExtensions { extension { id extensionId tech coreDevice { id deviceId dial devicetype description emergencyCid tech user{ password } } } } }

…as you notice the tech field is not a sub selection anymore, and for this reason, i cant seem to get the pjsip extension secret anymore.
i have the same versions as the earlier setup, installed from digitalOcean market place.
I have tried updating the Api modules and others but this did not change,

…is this a bug or is there something i might be missing?

I’m facing the same issue after updating the modules.

The docs indicate there’s a new attribute under user called sipsecret, but it doesn’t work for me.

Maybe @oliv2831 can help, as he came up with the original solution in the other thread.

Did you update to edge?

1 Like

I just did… running core 15.0.12.68, where the changelog implies the fix is included.

However, when using the API explorer I get an error when trying to fetch sipsecret

There’s a new fix for this today in Edge. Working syntax:

{
  fetchExtension(extensionId: "4033") {
    status
    message
    extensionId
    user {      extPassword    }
  }
}

You can also set the SIP secret like this (extensionId and name are both mandatory, and name gets updated with whatever you provide):

mutation {
  updateExtension(input: {extensionId: 4033, name: "Freddy M", extPassword: "aabbccdd"}) {
    status
    message
  }
}

Module version for the relevant modules:

[root@freepbx ~]# fwconsole ma --edge listonline |egrep "core|api|userman"`
| api                  | 15.0.3.14  | Enabled and up to date                | AGPLv3+     |`
| core                 | 15.0.12.70 | Enabled and up to date                | GPLv3+      |`
| userman              | 15.0.37    | Enabled and up to date                | AGPLv3+     |`
2 Likes

Working now, thank you!

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.