Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How use GetObject /UpdateObject ? #78

Open
stevenhzj opened this issue Jul 22, 2020 · 1 comment
Open

How use GetObject /UpdateObject ? #78

stevenhzj opened this issue Jul 22, 2020 · 1 comment

Comments

@stevenhzj
Copy link

stevenhzj commented Jul 22, 2020

Centos 7
asterisk 16

I want use GetObject,UpdateObject to get /add a pjsip.but it's bad request
exp in Centos I use
$ curl -X PUT -H "Content-Type: application/json" -u asterisk:secret -d '{"fields": [ { "attribute": "auth_type", "value": "userpass"}, {"attribute": "username", "value": "alice"}, {"attribute": "password", "value": "secret" } ] }' https://localhost:8088/ari/asterisk/config/dynamic/res_pjsip/auth/alice

can add an auth,
but in asterNET.ARI, I like this to do ,but it's 400 (Bad request)

           ActionClient = new AriClient(new StasisEndpoint("192.168.137.211", 8088, "asterisk_ari", "123456"), AppName);

            var authDic = new Dictionary<string, string>();
              
            authDic.Add("auth_type", "userpass");
            authDic.Add("username", "alice");
            authDic.Add("password", "secret");
             ActionClient.Asterisk.UpdateObject("res_pjsip", "auth", "alice", authDic);

when alice is create by other way,it's sucess,but alice is not create ,it's return bad request

hope any help,tks

@skrusty
Copy link
Owner

skrusty commented Aug 30, 2020

Are you able to see what's being passed to Asterisk?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants