AsterNET.ARI icon indicating copy to clipboard operation
AsterNET.ARI copied to clipboard

How use GetObject /UpdateObject ?

Open stevenhzj opened this issue 5 years ago • 1 comments

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

stevenhzj avatar Jul 22 '20 07:07 stevenhzj

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

skrusty avatar Aug 30 '20 20:08 skrusty