[Spce-user] Subscriber registrations issue, API v4.5.3

Irina Peshinskaya ipeshinskaya at sipwise.com
Tue Mar 28 14:10:52 EDT 2017


Dear Ivan,
SubscriberRegistration code tries to provide the latest id in the 
response, selecting record from the kamailio.location where contact is 
"sip:myTrunkName at 77.77.77.77:5060" and aor = 
subscriber[12].username at subscriber[12].domain.

Before create new record, SubscriberRegistration requests deletion of 
the existent.

Could you please send the result of the query:

select * from kamailio.location where contact 
="sip:myTrunkName at 77.77.77.77:5060";

?

Also /var/log/ngcp/api.log file may be useful to understand what 
happened. Could you please share it too?

Best regards,
Irina Peshinskaya


On 27.03.2017 20:41, Иван Иванов wrote:
> I got two bugs running API on Sipwise v4.5.3
> On creating subscriberregistrations/  (POST request)  the API doesn't 
> return me registrations/ ID as it expected, it returns
> smallest subscriber registration ID existed in DB regardless 
> subscriber ID.
> More details
> BUG #1.
> I send POST request to create subscriber registrations at 
> https://myVoipServer:1443/api/subscriberregistrations/
> with following data:
> {"subscriber_id":12,"contact":"sip:myTrunkName at 77.77.77.77:5060","q":1,"expires":"1969-12-31 
> 19:00:00"}
> On gettting the request API creates subscriber registrations with id 
> 31 (it'c correct) but in API response header indicates ID 5.
> Here is the row (part of responded header): Location: 
> /api/subscriberregistrations/5
> All next API calls (to create subscriber registrations) will  return 
> same ID equal to 5. So these is no way to get actual ID for
> the new  subscriber registration record. This ID is required for 
> further record manipulation.
> BUG #2.
> If I know the subscriber registration ID and if I need to modify it 
> (for example to change IP address) I do calling API with
> following PATCH request:
> https://myVoipServer:1443/api/subscriberregistrations/31 , where 31 is 
> subscriber registration ID (Now I can get it with HTML
> interface only) data I send: 
> [{"op":"replace","path":"/contact","value":"sip:myTrunkName at 77.77.77.88:5060"}]
> I expected this will update subscriber registration record with new IP 
> but in fact this replace registration record with new ID
> (32). This method assigns new ID to subscriber registration but it 
> doesn't return it (it's same as in Bug #1).
> Is there any advises how to resolve these bugs?
>
>
> _______________________________________________
> Spce-user mailing list
> Spce-user at lists.sipwise.com
> https://lists.sipwise.com/listinfo/spce-user

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sipwise.com/pipermail/spce-user_lists.sipwise.com/attachments/20170328/0ae43b94/attachment-0001.html>


More information about the Spce-user mailing list