Skip to content

How use GetObject /UpdateObject ? #78

Description

@stevenhzj

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions