Jump to content
Vodia PBX forum
chrispopp

Getting extension password via REST api

Recommended Posts

Problem is that we want to generate the password automatically and randomly. Otherwise generating all extensions with the same password, may pose a security risk.

 

Also, changing the password randomly on the fly, will take the deskphones offline... which is not an option.

Share this post


Link to post
Share on other sites

Maybe someone from Vodia can chime in on getting the password via REST API.

 

I guess another way to do it might be to grab it from the raw config file of the extension.

 

Have you looked at these docs on the REST API? There is a "Get user settings" call you can make but I am hot sure what it does or returns. I have never done any programming with the REST API so I am completely ignorant of how it works however I am interested in learning more about it.

 

https://vodia.com/doc/vodia_pbx_rest_api.pdf

 

https://vodia.com/doc/vodia_php_rest_api

Share this post


Link to post
Share on other sites

Providing the password is not a good idea. If the admin account leaks out this would be a easy way to get all the passwords. An alternative would be to set the password (overwrite it).

Share this post


Link to post
Share on other sites

I believe that if the admin account leaks, it would be just as easy to log-on and take everything anyways. If we would overwrite it, that means that we would need to support another CMS. Otherwise we can specifically, use the MAC address field, and retrieve the credentials based on that. Only problem is that we currently cannot retrieve the SIP password. There should be a way to retrieve it. I would say that close to 80% of clients are asking for smartphone applications, and it's really hard to be copetitve without one.

Share this post


Link to post
Share on other sites

Ok, the solution is to leave this question to the operator... There is a setting called "rest_show_passwords" in the pbx.xml; if you set it to "true", you can get them with /rest/domain/<domain>/user_settings/<account>. Default is not to show the passwords.

Share this post


Link to post
Share on other sites
On 11/28/2016 at 3:49 PM, Vodia PBX said:

Ok, the solution is to leave this question to the operator... There is a setting called "rest_show_passwords" in the pbx.xml; if you set it to "true", you can get them with /rest/domain/<domain>/user_settings/<account>. Default is not to show the passwords.

Has this changed in the latest version? I am unable to get the passwords anymore...

Share this post


Link to post
Share on other sites

Hi,

 

You have to follow the same steps:

1) Setting called "rest_show_passwords" in the pbx.xml if you set it to "true".

2) Restart the PBX.

3) Use this REST API command 'sudo curl -u admin:password GET -D - http://127.0.0.1/rest/domain/<domain>/user_settings/<account>'

Share this post


Link to post
Share on other sites

I am able to retrieve the passwords from old releases. But does not work on the newest release. 60.0.1. Can you please check if it works?

Share this post


Link to post
Share on other sites

Hi,

 

The procedure we provided above is from the latest version 60.0.1. Did you follow the steps 2 and 3 exactly as it's shown? We also tried to "append" the outputs of the pbx.xml before and after restart and can clearly see the difference ( password visible) in the latter part of the file.

Please test the API command above again, it has been edited to suit you better.

Share this post


Link to post
Share on other sites

Can you tell me the difference? The reason is that we had a third party app that was working using the SIP passwords. Now it simply returns an error. 

Trying to send it to the programmer to change the logic, but to be honest I cannot see a difference between the old command and the new one.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×