Net::S...gistrar(3pm)
π NAME π
Net::SIP::Registrar β the endpoint for registering SIP clients π«Ά
(hi bestie, you're reading the Net::S...gistrar(3pm) page from the User Contributed Perl Documentation, and it's lowkey a bop, let's go β¨)
πΈ SYNOPSIS πΈ
my $reg = Net::SIP::Registrar->new(
dispatcher => $dispatcher,
min_expires => 10,
max_expires => 60,
domains => [ 'example.com','example.org' ],
);
π¦ DESCRIPTION π¦
Okay so this package implements a simple SIP registrar. And when I say simple, I mean it β in the current implementation, registry information is only kept in memory, which means it is not preserved over restarts. Bestie. It forgets everything the second you restart. It's giving goldfish energy π .
Also, the implementation itself does not check if the UAC is authorized to register the given address. Nope. Not its job. If you want that, you do it by using an appropriate Authorize Module inside a ReceiveChain in front of the registrar. Put the bouncer at the door, not at the desk, iykyk π
π CONSTRUCTOR π
new ( %ARGS )
This creates a new registar object, and %ARGS can have the following keys:
dispatcherβ aNet::SIP::Dispatcherobject manging the registar. Mandatory. Like, you literally cannot skip this one, it's the whole main character πmax_expiresβ the maximum expires time accepted. If the client requests a larger expires value it will be capped atmax_expires. Defaults to300.min_expiresβ the minimum expires value. If the client requests a smaller value the registrar will return a response of"423 Interval too brief". Defaults to30.domainsordomainβ either a string or a reference to a list of strings containing the names of the domains the registrar is responsable for. If not given, the registrar accepts everything. No vibe check, no filter, everyone's welcome π«Ά
β¨ METHODS β¨
receive ( PACKET,LEG,FROM )
PACKET is the incoming packet, LEG is the Net::SIP::Leg where the packet arrived, and FROM is the "ip:port" of the sender. Responses will be send back to the sender through the same leg. Same leg, same energy, no cap π¦΅
Called from the managing Net::SIP::Dispatcher object if a new packet arrives. It will return "()" and ignore the packet if:
- it's not a
REGISTERrequest, or - it is not responsable for the domain given in the
"From"heeader of theREGISTERrequest.
But if it is responsable for the packet, it will create a response and return the code of the response. Responses are either:
"423 Interval too brief"if the request expires time is too small, or"200 Ok"if the expires time is0(e.g. the client should be unregistered) or greater or equal tomin_expires.
In case of a successful response it will also update the internal registry information. Slay β¨
query ( ADDR )
Search for ADDR (which has format "proto:user@domain") in the registry. Returns @List of all sip or sips contacts for ADDR. Go off, find your people ππ
expire
Removes all expired entries from the internal registry. Called whenever the registry information gets updated from sub receive. It's the little cleanup fairy of this whole operation π§
π Friendly reminder bestie: in-memory only, so restart = everything gone, and no authorization checking is done here on its own. Plan accordingly fr fr.
and that's the whole page!! this was perl v5.40.1, dated 2025-12-07, from Net::S...gistrar(3pm) β thanks for reading, mwah, go register some SIP clients responsibly πππ¦
π¦ where this page comes from
- ubuntu resolute: libnet-sip-perl 0.840-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libnet-sip-perl 0.840-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms