Giter VIP home page Giter VIP logo

api's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

api's Issues

[bug]: Doreload GQL resquest doesn't work.

FreePBX Version

FreePBX 17

Issue Description

Doreload doesn't work.

mutation {
                  doreload(input: {}) {
                    status
                    transaction_id
                  }
                }

After getting the transaction ID, it is still being processed and forever.

query {
    fetchApiStatus( txnId: 15) {
        status message
    }
} 

Response:

{
	"data": {
		"fetchApiStatus": {
			"status": true,
			"message": "Processing"
		}
	}
}

Operating Environment

API 17.0.1.2
Framework 17.0.15.25

Relevant log output

[2024-05-31 07:00:12] [dbug.DEBUG]: 2024-May-31 07:00:12        /var/www/html/admin/modules/api/Gql/Api.php:104


 [] []
[2024-05-31 07:00:12] [dbug.DEBUG]: stdClass Object
(
    [message] => Internal server error
    [locations] => Array
        (
            [0] => stdClass Object
                (
                    [line] => 58
                    [column] => 7
                )

        )

    [path] => Array
        (
            [0] => __schema
            [1] => types
            [2] => 0
            [3] => fields
            [4] => 0
            [5] => args
            [6] => 4
            [7] => defaultValue
        )

)

[improvement]: API - Logic inconsistent.

FreePBX Version

FreePBX 16

Improvement Description

About Extension we can Add and Update an extension but if the goal is to update any extension, the request featching the extension doesn't return maxcontact. And there is no way to get this value with any existing API requests.
That will be nice to see maxcontact's value when we are editing this extension.
Need to check if this kind of case is true for the other requests. Whatever if the request is RestAPI or GQL though.

Indeed, the locic will be:
If we can update something, the be sure to get the same items with their value. Otherwise, it doesn't make sense.

Example:
We can imagine creating the extension 100 with max contact = 1 (by default).
Some days later, we decide to update max contact to 3. Ok in this case we set maxcontact to 3.
If we need to check this value, then, there is no way to verify it. And I think if we set nothing on maxcontact, the value will be changer to 1 and not 3.

maxcontact is not alone in this case. All fields present in addExtension and updateExtension cannot be read in a same request. Need to send at least 2 requests to get almost what we need to display the fields for udpate.
The logic would be to get everything when we read any items necessary for updates.

[bug]: API - Internal server error 500

FreePBX Version

FreePBX 17

Issue Description

Unable to get token.
And a simple RestAPI request returns and error 500.

No way to use APIs on 17.

Operating Environment

FreePBX 17 version updated.

Relevant log output

{
	"error": {
		"type": "TypeError",
		"message": "Slim\\App::__construct(): Argument #1 ($responseFactory) must be of type Psr\\Http\\Message\\ResponseFactoryInterface, array given, called in \/var\/www\/html\/admin\/modules\/api\/Rest\/Api.php on line 49",
		"code": 0,
		"file": "\/var\/www\/html\/admin\/libraries\/Composer\/vendor\/slim\/slim\/Slim\/App.php",
		"line": 47
	}
}

[bug]: API GQL/Core: Delete Extension doesn't set Need Reload.

FreePBX Version

FreePBX 16

Issue Description

When you delete an extension, Need Reload is not set, however, if you delete an extension through GUI, need reload is set. (You can see Apply Config button).
This action with API should execute the same action as the GUI.
Just set needreload = true at the end of the API for delete extension.

This difference is importent if the changes are not applied after deletion and if there is no way to know if the system needs reloading.

Operating Environment

framework: 16.0.40.7
api: 16.0.13
core: 16.0.68.24

Relevant log output

No response

[bug]: API -Scope Visualizer - Check box issue.

FreePBX Version

FreePBX 16

Issue Description

Clicking on visualizer, the feature to select read, write an item for scope works fine.
However, if you filter something on Search on the top of right of table, the list is correctly updated but if you click on any check box selecting what you want, nothing is changed. The Check box is not selected and you cannot unselect anything.
But if you change the keyword to search, the check box is updated and you can unselect it. But the issue is comming again.

Just try to reproduce this issue putting something in the Search field.

Operating Environment

framework: 16.0.40.7
api: 16.0.13

Relevant log output

No response

[bug]: API GQL/Core: All VM secret are not sync with the table "users"

FreePBX Version

FreePBX 16

Issue Description

When an extension is created the VM secret is set in the "users" table, but if you use fetchAllExtensions or fetchExtension, the password is empty for the others extensions and not for the new extensions created with API.

That means, you need to synchronize all VM secret to the "users" table. Otherwise, the admin could not know the VM Secret throught fetchAllExtensions or fetchExtension

However, fetchVoiceMail works fine. VM secret is present.

BTW, I wondered if password is a good name. Indeed, there is much name discribing passwords.
Password for extension
Password for User Manager.
Password for VM.

As the VM password is named : password, it will make sens to rename it as vm-password. just for avoid to get confuse.

The most important for now is, to sync the vm-password into the "users" table on the key password or getting data from voicemail.conf.
I know the fact to parse the file, voicemail.conf is not the best way and it's not faster. The idea will be to put voicemails data into a table looks good though.

Operating Environment

framework: 16.0.40.7
api: 16.0.13

Relevant log output

MariaDB [asterisk]> select extension, password from users;
+-----------+----------+
| extension | password |
+-----------+----------+
| 1000      |          |
| 1001      |          |
| 1002      |          |
| 1003      |          |
| 101       |          |
| 102       |          |
| 103       |          |
| 104       |          |
| 106       |          |
| 107       |          |
| 108       |          |
| 110       |          |
| 111       |          |
| 112       |          |
| 114       |          |
| 9919988   |          |
| 200       |          |
| 201       |          |
| 113       |          |
| 105       |          |
| 122       |          |
| 121       |          |
| 123       |          |
| 100       |          |
| 109       |          |
| 120       |          |
| 1020      | test     |
| 1021      |          |
+-----------+----------+
28 rows in set (0.00 sec)

[root@freepbx ~]# more /etc/asterisk/voicemail.conf | grep test
1020=test,Room 20,[email protected],,attach=no|saycid=no|envelope=no|delete=no

Here we can expect to see any vm-password in the password key. But a single password is recorded. The one created throught API.

Additionally, the field allows all alphabetic characters. Need to filter it with a regex accepting 0-9 and empty (no vm secret)

[bug]: API Authorize URI doesn't work.

FreePBX Version

FreePBX 16

Issue Description

When an API is created, there is no owner created in the api_applications table.
For this reason, if someone need to use authorize URI, the is no association between the username and the client_id.
I forced the owner putting username id, it doesn't work anyway.
I think something is missing with this logic.

I imagine if the admin create a web-app or a single page API, then it should get a list box with the users to be associate with the client_id.
For now, the FreePBX server cannot return any token with the client_id, client_secret, code ...etc

I used this document bellow trying the web-app and single-page method, no way.
https://aaronparecki.com/oauth-2-simplified/#web-server-apps

I think samgoma should write a document giving some examples with the authorize URI usage once fixed.

Here, the link in the FreePBX forum relating this issue.

https://community.freepbx.org/t/api-web-app-type-authentication-issue/94633

However, machine to machine works fine, but it's not safe to use any remote applications for managing any FreePBX / PBXact systems.

Operating Environment

framework: 16.0.40.7
api: 16.0.13

Relevant log output

{"error":"invalid_client","message":"Client authentication failed"}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.