[OpenSIPS-Users] is_registered function

Bogdan-Andrei Iancu bogdan at opensips.org
Mon Oct 26 17:23:10 EST 2020


Hi Alexey,

As per docs, the is_registered() function accepts as the AOR param a 
valid SIP URI, not a username. So push $fu and not $fU.

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com
OpenSIPS Bootcamp 2020 online
   https://opensips.org/training/OpenSIPS_eBootcamp_2020/

On 10/26/20 3:49 PM, Alexey Kazantsev via Users wrote:
> Hi list,
> OpenSIPS 2.4.8
> is it possible to use is_registered() finction
> if the registered users are saved by mid_registrar module,
> and forwarded further to the main registrar server?
> mid_registrar saves users’ location well, to the «location» table,
> ‘opensipsctl fifo ul_dump’ shows the list of registered users.
> I’m trying to drop (ignore) all INVITEs to the external OpenSIPS interface
> except 1) from registered users, 2) from VoIP providers SIP trunks.
> Here’s the construction:
>
> 1.
>     # initial INVITE
> 2.
>     if(is_method("INVITE"))
> 3.
>     {
> 4.
>     # invite neither from VoIP ISP, nor from registered user -> drop
> 5.
>     if(!is_myself("$si") && $Rp == 5060) {
> 6.
>     if(!is_registered("location", "$fU") ||
>     !check_source_address("1")) exit;
> 7.
>     }
> 8.
> 9.
>     ...
>
> But the result is that _all_ invites are dropped, even from providers’ 
> IP addresses
> and from registered users.
> I also checked logs and found there such an ERROR:
>     ERROR:core:parse_uri: bad uri, state 0 parsed: <grz1> (4) / 
> <grz106> (6)
>     ERROR:registrar:extract_aor: failed to parse Address of Record
>     ERROR:registrar:msg_aor_parse: failed to extract address of record!
>     ERROR:registrar:is_registered: failed to parse!
> So, what is the reason of unsuccessful call passing from registered 
> users and white listed IPs,
> and why the ERROR occurs? (users have sip accounts like grz1XX, it’s 
> also strange that grz1
> is in logs).
> -----------------------------------------------
> BR, Alexey
> http://alexeyka.zantsev.com/
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20201026/63979273/attachment.html>


More information about the Users mailing list