/* Released under MIT License 299 { return fmt.Errorf("Unexpected status code received: %d", resp.StatusCode) } if kamResponse.Id != reqId { return fmt.Errorf("Unsynchronized request, had: %d, received: %d", reqId, kamResponse.Id) } *reply = *kamResponse.Result return nil } // Add inidividual methods over the generic one type RegistrationInfo struct { LocalUuid string `json:"l_uuid"` LocalUsername string `json:"l_username"` LocalDomain string `json:"l_domain"` RemoteUsername string `json:"r_username"` RemoteDomain string `json:"r_domain"` Realm string `json:"realm"` AuthUsername string `json:"auth_username"` AuthPassword string `json:"auth_password"` AuthProxy string `json:"auth_proxy"` Expires int64 `json:"expires"` Flags int64 `json:"flags"` DiffExpires int64 `json:"diff_expires"` TimerExpires int64 `json:"timer_expires"` } func (self *KamailioJsonRpc) UacRegInfo(params []string, reply *RegistrationInfo) error { var regRaw json.RawMessage if err := self.Call("uac.reg_info", params, ®Raw); err != nil { return err } return json.Unmarshal(regRaw, reply) }