EPM cli commands doesn't works

(Jozek Stefanski) #1

I purchased Endpoint Manager for phones provisioning and it works really great but only if I’m using it via GUI. So when I press e.g. “Save, Rebuild Config(s) and Update Phones” option from FreePBX EPM GUI, everything is ok.

But if I’m trying do the same from CLI - I get only “Update command sent to XXX” and phone is still unconfigured.

[root@freepbx ~]# fwconsole epm listtemplates
| Brand | Template Name | Destination | Time Zone | Provision Type | Provision Address | Background | Firmware | Internal Default | External Default |
| yealink | t42s | | -06:00 | HTTP | | None | | | |
[root@freepbx ~]# fwconsole epm update t42s
Update command sent to 604
Update command sent to 644
Update command sent to 654

And nothing happend on the phones.

Thank you for any help.


Be aware that the GUI would be using the Asterisk user and shell, not root which is who ‘you’ are when you do that.

su asterisk -c "fwconsole epm update t42s"

or just

su asterisk

and debug from there

(Jozek Stefanski) #3

[root@freepbx ~]# su asterisk -c “fwconsole epm update t42s”
Update command sent to 604
Update command sent to 644
Update command sent to 654

And still phones are untouched.

Also tried with switch user to asterisk:
[asterisk@freepbx ~]$ fwconsole epm update t42s
Update command sent to 604
Update command sent to 644
Update command sent to 654

And again nothing :confused:


well, that’s not the problem then :slight_smile:

(Jozek Stefanski) #5

The problem is that I purchased this module for using it from CLI and it works only from GUI :wink:


I suggest you open a ticket then as it is closed source so only available to Sangoma for diagnostics.

(Jared Busch) #7

I can verify 100% that the CLI worked a few months ago.

Tell the phone to update manually.

rasterisk -x ‘pjsip send notify reboot-yealink endpoint 604’

That is the command that EPM sends

(Lorne Gaetz) #8

EPM version?

fwconsole ma list | grep endpoint

(Jared Busch) #9

I just logged in to a client system and it definitely does not work.

It displayed this.

But nothing hit the http access log.

(Jared Busch) #10

(Jared Busch) #11

As soon as i issued the command manually, the phone reported in.

Updating a single extension also does nothing.

@milansport This is what you need to do. If you purchased it and it is up to date, you have support.

(Lorne Gaetz) #12

Are we talking about PJSIP endpoints with a single contact? I suspect this may be due to the recentish change of referring to pjsip contact one as XXXX-1 instead of XXXX. Support ticket pls.

(Jared Busch) #13

Looks likely. Issuing the command fir the extension with the -1 results in the same.

(Jared Busch) #14

That is not how the fwconsole command works. As long as it is execute with sudo rights, it will subsequently do what it needs to do with the proper user.


That was not my point. The point is that running anything in different environments is, well, not the same. Aas you see in this case the fwconsole wrapper does not achieve the same result, so at least try and normalize first.

Also as 99% of our readers do all this stuff as root, all the sudo stuff is kinda redundant

(Jozek Stefanski) #16

Yup, support confirmed that was a bug, fixed in EPM version
Installation: fwconsole ma downloadinstall endpoint --tag=

But I have another question about EPM. I thought that EPM can configure whole phone including SIP account. But when I’m trying to change SIP account on the phone via EPM it seems doesn’t works.

E.g. I have Yealink phone with configured SIP account:

If I want to change some configuration on it besides SIP account - it works.
But when I’m trying to change SIP account from e.g. 654 to 333 - nothing happens.

Is it bacause communication between FreePBX and phone is realized with extension number and EPM can’t change it on the phone or maybe this is another bug? :wink:

(Itzik) #17

It’s not a bug.

When you update 654 to 333 and send a update, FreePBX will send a SIP NOTIFY to 333.

In this case, you will need to manually send the SIP NOTIFY to 654 after changing to 333.

(Jared Busch) #18

The point is you’re just trying to confuse things. When executing fwconsole with admin rights whether you are root or sudo it will do everything with the appropriate rights. There is never a need to execute it as the asterisk user.


If you say so, but I have

head -1 $(which fwconsole)

that says otherwise :wink:

Any linux command is always executed in the ‘environment’ of the user making that call, the ‘environment’ of the GUI is almost certainly not the same as the ‘environment’ of root or ‘sudo’ .

As I noted fwconsole will be executed using whatever ‘php’ is in the environment of the caller. as such ‘php’ could either be the found in PATH or directly defined , thus root might find php7.n but the asterisk user might find php5.6 , further the PATH used might find a different php binary in that family even when called.

If as the OP said it works in the gooey but does not in a shell then please agree that the gooey has a different ‘environment’ than any shell.

So likely the gooey is NOT using the fwconsole wrapper (why would it) , but the OP was, hence my post, confusing or not, it was a reasonable diagnostic that given the feedback I followed with an effective ‘then don’t do that’ .

(system) closed #20

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