[Spce-user] No ipauth id found, block registration if subscriber created via API

Hohl Matthias matthias.hohl at telematica.at
Mon May 13 09:39:33 EDT 2019


Hello,

 

after some tests now we solved the problem:

 

When preferences have max_occur == 0 in subscriber preference definitions, they are internally threated as lists (arrays), so via JSON api it can happen, that they are commited as [], when listing is empty.
We have implemented the differentiation between "" and null for strings, but not for lists.
when we add an IP address to the allowed_ip list and removing it again, the internal group is not resolved and dereferenced, therefore the derivation from subscriber profile does not happen.
Thus we have now implemented to set null instead of pushing an empty list [].

 

I suggest to consider this case on the remote side.
An empty list is also a use case where we want the derivation to happen or plaease, automatically handle the empty list as null.

We now at least understand the issue and have implemented a workaronud on our side, but this is not a clean workflow.

Thanks

 

 

 

Von: Daniel Grotti <dgrotti at sipwise.com> 
Gesendet: Montag, 13. Mai 2019 14:12
An: Hohl Matthias <matthias.hohl at telematica.at>; spce-user at lists.sipwise.com
Betreff: Re: AW: AW: [Spce-user] No ipauth id found, block registration if subscriber created via API

 

Hi Matthias,
I checked our internal systems where we use API to create users as I 
don't see allowed_ips_grp set by default.


Can you send me your API creation function, so I can test it locally?





Daniel Grotti

Head of Customer Support Sipwise GmbH
e: dgrotti at sipwise.com <mailto:dgrotti at sipwise.com>  Europaring F15
t: +43(0)130120332 A-2345 Brunn Am Gebirge
w: www.sipwise.com <http://www.sipwise.com>  FN: 305595f FG: LG Wiener Neustadt

On 5/13/19 2:08 PM, Hohl Matthias wrote:
> Yes..
> 
> We definitely not set anything via API for allowed_ips
> 
> I don’t know from where this came from.
> 
> Any idea?
> 
> *Von:*Daniel Grotti <dgrotti at sipwise.com <mailto:dgrotti at sipwise.com> >
> *Gesendet:* Montag, 13. Mai 2019 14:05
> *An:* Hohl Matthias <matthias.hohl at telematica.at <mailto:matthias.hohl at telematica.at> >; 
> spce-user at lists.sipwise.com <mailto:spce-user at lists.sipwise.com> 
> *Betreff:* Re: AW: [Spce-user] No ipauth id found, block registration if 
> subscriber created via API
> 
> Hi,
> from API you have:
> 
> | 18878 | 16e48cc5-e84d-44d4-b822-ee31693aa69a | 43720560060 |
> sip.telematica.at | allowed_ips_grp | 1 | 334 |
> 1900-01-01 00:00:01 |
> 
> 
> 
> and this was not set via API ?
> 
> 
> very strange.
> 
> 
> 
> Daniel Grotti
> 
> Head of Customer Support Sipwise GmbH
> e: dgrotti at sipwise.com <mailto:dgrotti at sipwise.com>  <mailto:dgrotti at sipwise.com> Europaring F15
> t: +43(0)130120332 A-2345 Brunn Am Gebirge
> w: www.sipwise.com <http://www.sipwise.com>  <http://www.sipwise.com> FN: 305595f FG: LG Wiener 
> Neustadt
> 
> On 5/13/19 2:01 PM, Hohl Matthias wrote:
> > Subscriber Created via WEB GUI:
> >
> > //
> >
> > /MariaDB [(none)]> select * from kamailio.usr_preferences where
> > username="4314xxxxx";/
> >
> > 
> /+-------+--------------------------------------+------------+-------------------+-----------------------------+------+------------+---------------------+/
> >
> > /| id    | uuid                                 | username   |
> > domain            | attribute                   | type | value      |
> > last_modified       |/
> >
> > 
> /+-------+--------------------------------------+------------+-------------------+-----------------------------+------+------------+---------------------+/
> >
> > /| 18378 | 8d015d18-810d-4fc3-8de8-817fb679c732 | 4314704347 |
> > sip.telematica.at | ac                          |    0 | 1          |
> > 1900-01-01 00:00:01 |/
> >
> > /| 18379 | 8d015d18-810d-4fc3-8de8-817fb679c732 | 4314704347 |
> > sip.telematica.at | account_id                  |    1 | 766        |
> > 1900-01-01 00:00:01 |/
> >
> > /| 18377 | 8d015d18-810d-4fc3-8de8-817fb679c732 | 4314704347 |
> > sip.telematica.at | allowed_clis                |    0 | 4314xxxxx|
> > 1900-01-01 00:00:01 |/
> >
> > /| 18391 | 8d015d18-810d-4fc3-8de8-817fb679c732 | 4314704347 |
> > sip.telematica.at | allowed_clis                |    0 | 4314xxxxx|
> > 1900-01-01 00:00:01 |/
> >
> > /| 18380 | 8d015d18-810d-4fc3-8de8-817fb679c732 | 4314704347 |
> > sip.telematica.at | cc                          |    0 | 43         |
> > 1900-01-01 00:00:01 |/
> >
> > /| 18376 | 8d015d18-810d-4fc3-8de8-817fb679c732 | 4314704347 |
> > sip.telematica.at | cli                         |    0 | 4314xxxxx |
> > 1900-01-01 00:00:01 |/
> >
> > /| 18375 | 8d015d18-810d-4fc3-8de8-817fb679c732 | 4314704347 |
> > sip.telematica.at | cloud_pbx_hunt_policy       |    0 | serial     |
> > 1900-01-01 00:00:01 |/
> >
> > /| 18383 | 8d015d18-810d-4fc3-8de8-817fb679c732 | 4314704347 |
> > sip.telematica.at | concurrent_max              |    1 | 4          |
> > 1900-01-01 00:00:01 |/
> >
> > /| 18382 | 8d015d18-810d-4fc3-8de8-817fb679c732 | 4314704347 |
> > sip.telematica.at | ext_contract_id             |    0 | 2711       |
> > 1900-01-01 00:00:01 |/
> >
> > /| 18381 | 8d015d18-810d-4fc3-8de8-817fb679c732 | 4314704347 |
> > sip.telematica.at | ext_subscriber_id           |    0 | 2711       |
> > 1900-01-01 00:00:01 |/
> >
> > /| 18390 | 8d015d18-810d-4fc3-8de8-817fb679c732 | 4314704347 |
> > sip.telematica.at | force_inbound_calls_to_peer |    0 | force      |
> > 1900-01-01 00:00:01 |/
> >
> > /| 18384 | 8d015d18-810d-4fc3-8de8-817fb679c732 | 4314704347 |
> > sip.telematica.at | rewrite_callee_in_dpid      |    1 | 10         |
> > 1900-01-01 00:00:01 |/
> >
> > /| 18388 | 8d015d18-810d-4fc3-8de8-817fb679c732 | 4314704347 |
> > sip.telematica.at | rewrite_callee_lnp_dpid     |    1 | 55         |
> > 1900-01-01 00:00:01 |/
> >
> > /| 18386 | 8d015d18-810d-4fc3-8de8-817fb679c732 | 4314704347 |
> > sip.telematica.at | rewrite_callee_out_dpid     |    1 | 12         |
> > 1900-01-01 00:00:01 |/
> >
> > /| 18385 | 8d015d18-810d-4fc3-8de8-817fb679c732 | 4314704347 |
> > sip.telematica.at | rewrite_caller_in_dpid      |    1 | 9          |
> > 1900-01-01 00:00:01 |/
> >
> > /| 18389 | 8d015d18-810d-4fc3-8de8-817fb679c732 | 4314704347 |
> > sip.telematica.at | rewrite_caller_lnp_dpid     |    1 | 47         |
> > 1900-01-01 00:00:01 |/
> >
> > /| 18387 | 8d015d18-810d-4fc3-8de8-817fb679c732 | 4314704347 |
> > sip.telematica.at | rewrite_caller_out_dpid     |    1 | 11         |
> > 1900-01-01 00:00:01 |/
> >
> > 
> /+-------+--------------------------------------+------------+-------------------+-----------------------------+------+------------+---------------------+/
> >
> > /17 rows in set (0.01 sec)/
> >
> > Subscriber created via API:
> >
> > /MariaDB [(none)]> select * from kamailio.usr_preferences where
> > username="43720560060";/
> >
> > 
> /+-------+--------------------------------------+-------------+-------------------+----------------------------+------+-------------+---------------------+/
> >
> > /| id    | uuid                                 | username    |
> > domain            | attribute                  | type | value       |
> > last_modified       |/
> >
> > 
> /+-------+--------------------------------------+-------------+-------------------+----------------------------+------+-------------+---------------------+/
> >
> > /| 18873 | 16e48cc5-e84d-44d4-b822-ee31693aa69a | 43720560060 |
> > sip.telematica.at | ac                         |    0 | 720         |
> > 1900-01-01 00:00:01 |/
> >
> > /| 18874 | 16e48cc5-e84d-44d4-b822-ee31693aa69a | 43720560060 |
> > sip.telematica.at | account_id                 |    1 | 786         |
> > 1900-01-01 00:00:01 |/
> >
> > /| 18898 | 16e48cc5-e84d-44d4-b822-ee31693aa69a | 43720560060 |
> > sip.telematica.at | allowed_clis               |    0 | 43720560060 |
> > 1900-01-01 00:00:01 |/
> >
> > /| 18878 | 16e48cc5-e84d-44d4-b822-ee31693aa69a | 43720560060 |
> > sip.telematica.at | allowed_ips_grp            |    1 | 334         |
> > 1900-01-01 00:00:01 |/
> >
> > /| 18875 | 16e48cc5-e84d-44d4-b822-ee31693aa69a | 43720560060 |
> > sip.telematica.at | cc                         |    0 | 43          |
> > 1900-01-01 00:00:01 |/
> >
> > /| 18871 | 16e48cc5-e84d-44d4-b822-ee31693aa69a | 43720560060 |
> > sip.telematica.at | cli                        |    0 | 43720560060 |
> > 1900-01-01 00:00:01 |/
> >
> > /| 18870 | 16e48cc5-e84d-44d4-b822-ee31693aa69a | 43720560060 |
> > sip.telematica.at | cloud_pbx_hunt_policy      |    0 | serial      |
> > 1900-01-01 00:00:01 |/
> >
> > /| 18879 | 16e48cc5-e84d-44d4-b822-ee31693aa69a | 43720560060 |
> > sip.telematica.at | concurrent_max_per_account |    1 | 4           |
> > 1900-01-01 00:00:01 |/
> >
> > /| 18880 | 16e48cc5-e84d-44d4-b822-ee31693aa69a | 43720560060 |
> > sip.telematica.at | e164_to_ruri               |    1 | 0           |
> > 1900-01-01 00:00:01 |/
> >
> > /| 18876 | 16e48cc5-e84d-44d4-b822-ee31693aa69a | 43720560060 |
> > sip.telematica.at | emergency_suffix           |    0 | invalidAC_  |
> > 1900-01-01 00:00:01 |/
> >
> > /| 18881 | 16e48cc5-e84d-44d4-b822-ee31693aa69a | 43720560060 |
> > sip.telematica.at | man_allowed_ips_grp        |    1 | 335         |
> > 1900-01-01 00:00:01 |/
> >
> > 
> /+-------+--------------------------------------+-------------+-------------------+----------------------------+------+-------------+---------------------+/
> >
> > /11 rows in set (0.00 sec)/
> >
> > //
> >
> > //
> >
> > //
> >
> > *Von:*Spce-user <spce-user-bounces at lists.sipwise.com  <mailto:spce-user-bounces at lists.sipwise.com%20%0b> 
> <mailto:spce-user-bounces at lists.sipwise.com>> *Im Auftrag von
> > *Daniel Grotti
> > *Gesendet:* Montag, 13. Mai 2019 13:56
> > *An:* spce-user at lists.sipwise.com <mailto:spce-user at lists.sipwise.com>  <mailto:spce-user at lists.sipwise.com>
> > *Betreff:* Re: [Spce-user] No ipauth id found, block registration if
> > subscriber created via API
> >
> > Hi Mathias,
> > can you do the following check:
> >
> > 1. create subscriber via GUI with allowed_ips empty, then check:
> >
> > mysql> select * from kamailio.usr_preferecens where
> > username="<SUBSCRIBER_USERNAME>"
> >
> >
> > 2. create subscriber via API with allowed_ips not set, then check:
> >
> > mysql> select * from kamailio.usr_preferecens where
> > username="<SUBSCRIBER_USERNAME>"
> >
> >
> > Is there any differences?
> > In point 2 you maybe have allowed_ips set to value="" ?
> >
> >
> > Another question, what version are you using?
> >
> >
> >
> > Daniel Grotti
> >
> > Head of Customer Support Sipwise GmbH
> > e: dgrotti at sipwise.com <mailto:dgrotti at sipwise.com>  <mailto:dgrotti at sipwise.com> 
> <mailto:dgrotti at sipwise.com> Europaring F15
> > t: +43(0)130120332 A-2345 Brunn Am Gebirge
> > w: www.sipwise.com <http://www.sipwise.com>  <http://www.sipwise.com> <http://www.sipwise.com> 
> FN: 305595f FG: LG Wiener
> > Neustadt
> >
> > On 5/13/19 1:46 PM, Hohl Matthias wrote:
> > > Hello,
> > >
> > > We created a new tool for creating subscribers via the SPCE API, but we
> > > found out, that created subscribers don’t use the “domain default”
> > > allowed_ips setting.
> > >
> > > We definitely create the subscribers without this value. So if we check
> > > the subscriber preferences via web gui the “allowed_ips setting is also
> > > blank, also via API GET we don’t get any value for “allowed_ips” back…
> > > so it normally should use the domain default settings.
> > >
> > > If we create a subscriber via web interface directly and leave this
> > > allowed_ips empty, if works like a charme with the “domain defaults
> > > allowed_ips” settings. So this problem is just there, if we create a
> > > subscriber via API and leave “allowed_ips” empty.
> > >
> > > Subscriber settings:
> > >
> > > If we check the API via GET it preferences looks like this:
> > >
> > > /  //},//
> > > //  //"ac" : "720",//
> > > //  //"allowed_clis" : [//
> > > //      //"43720560060"//
> > > //  //],//
> > > //  //"cc" : "43",//
> > > //  //"cli" : "43720560060",//
> > > //  //"concurrent_max_per_account" : 4,//
> > > //  //"e164_to_ruri" : false,//
> > > //  //"emergency_suffix" : "invalidAC_",//
> > > //  //"id" : 933,//
> > > //  //"subscriber_id" : 933//
> > > }///
> > >
> > > But if we try to register we get this log entries:
> > >
> > > /May 13 13:27:39 spce proxy[2114]: NOTICE: <script>: New request on
> > > proxy - M=REGISTER R=sip:x.telematica.at
> > > F=sip:43720560060 at x.telematica.at T=sip:43720560060 at x.telematica.at
> > > IP=176.123.xxx.xxx:5060 (127.0.0.1:5060)
> > > ID=25da2ba63f1576e66b506a9918105d2a at 127.0.0.1 <mailto:ID=25da2ba63f1576e66b506a9918105d2a at 127.0.0.1>  
> <mailto:ID=25da2ba63f1576e66b506a9918105d2a at 127.0.0.1>
> > <mailto:ID=25da2ba63f1576e66b506a9918105d2a at 127.0.0.1> UA='PBX v1.7 R6'
> > > DESTIP=127.0.0.1:5062/
> > >
> > > /May 13 13:27:39 spce proxy[2114]: NOTICE: <script>: Sending reply 
> S=100
> > > Trying fs='127.0.0.1:5062' du='127.0.0.1:5060' - R=sip:x.telematica.at
> > > ID=25da2ba63f1576e66b506a9918105d2a at 127.0.0.1 <mailto:ID=25da2ba63f1576e66b506a9918105d2a at 127.0.0.1>  
> <mailto:ID=25da2ba63f1576e66b506a9918105d2a at 127.0.0.1>
> > <mailto:ID=25da2ba63f1576e66b506a9918105d2a at 127.0.0.1> UA='PBX v1.7 R6'/
> > >
> > > /May 13 13:27:39 spce proxy[2114]: WARNING: <script>: No ipauth id
> > > found, block registration - R=sip:x.telematica.at
> > > ID=25da2ba63f1576e66b506a9918105d2a at 127.0.0.1 <mailto:ID=25da2ba63f1576e66b506a9918105d2a at 127.0.0.1>  
> <mailto:ID=25da2ba63f1576e66b506a9918105d2a at 127.0.0.1>
> > <mailto:ID=25da2ba63f1576e66b506a9918105d2a at 127.0.0.1> UA='PBX v1.7 R6'/
> > >
> > > If we sent 0.0.0.0 or the registration IP via API for “allowed_ips” or
> > > set the “ignore_allowed_ips” setting to true, then we can register.
> > >
> > > So the problem is, that if this settings are not set via API, the
> > > subscriber didn’t use the domain default allowed ip list, where we
> > > defined our ip ranges.
> > >
> > > Do you have any idea, how to fix that?
> > >
> > > Mit freundlichen Grüßen,
> > >
> > > Matthias Hohl
> > >
> > >
> > > _______________________________________________
> > > Spce-user mailing list
> > > Spce-user at lists.sipwise.com <mailto:Spce-user at lists.sipwise.com>  <mailto:Spce-user at lists.sipwise.com> 
> <mailto:Spce-user at lists.sipwise.com>
> > > https://lists.sipwise.com/listinfo/spce-user
> > >
> > _______________________________________________
> > Spce-user mailing list
> > Spce-user at lists.sipwise.com <mailto:Spce-user at lists.sipwise.com>  <mailto:Spce-user at lists.sipwise.com> 
> <mailto: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/20190513/2265c8bc/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5585 bytes
Desc: not available
URL: <http://lists.sipwise.com/pipermail/spce-user_lists.sipwise.com/attachments/20190513/2265c8bc/attachment-0001.p7s>


More information about the Spce-user mailing list