Fetch pjsip extension secret on Asterisk 16, FreePBX 15

Tags: #<Tag:0x00007fb478a6b100> #<Tag:0x00007fb478a6afc0>

(Ricoh) #1

…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.

(Jared Busch) #4

Did you update to edge?


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

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

(Greg Blumenthal) #7

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

  fetchExtension(extensionId: "4033") {
    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"}) {

Module version for the relevant modules:

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

How to add secret in extension at the time creation via GraphQL

Working now, thank you!

(system) closed #9

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