Net::S...direct(3pm)
π NAME π
Net::SIP::Redirect β bestie, this one sends redirects to Requests based on a lookup at a registrar π
β¨ SYNOPSIS β¨
my $reg = Net::SIP::Registrar->new(...);
my $redir = Net::SIP::Redirect(
dispatcher => $dispatcher,
registrar => $reg,
);
π¦ DESCRIPTION π¦
Okay so this package? It implements a simple redirection of Requests using the info that a registrar hands over. That's it, that's the whole vibe. It's giving "you don't live here anymore, go talk to these people instead" π
πΈ CONSTRUCTOR πΈ
new ( %ARGS )
This creates a brand new redirect object, no cap. And %ARGS can have these keys in it π
dispatcherβ a Net::SIP::Dispatcher object that's managing the registar. Mandatory, so like, you literally cannot skip it, fr fr.registrarβ the Registrar object. It's an object shaped like a Net::SIP::Registrar, meaning it has aquery(address)method that returns a list of contacts. That's the whole requirement, she's lowkey flexible like that π«Ά
π METHODS π
receive ( PACKET, LEG, FROM )
So PACKET is the incoming packet, LEG is the Net::SIP::Leg where the packet showed up, and FROM is the "ip:port" of whoever sent it. Responses get sent right back to the sender through that same leg, obviously π
This gets called by the managing Net::SIP::Dispatcher object whenever a new packet arrives, like a little doorbell π
Here's the tea on what it does:
- If it's a REGISTER request, it will return
"()"and just ignore the packet. Not her problem, moving on π - For Requests, she'll query the registrar and return either
"302 Moved Temporarily"with the list of contacts, or"404 Not Found"if that address isn't registered. Iconic behaviour honestly π
Heads up bestie: those REGISTER requests get straight-up ignored and you get "()" back β that's intentional, not a bug π
perl v5.40.1 Β· 2025-12-07 β okay that's the whole page, mwah, go redirect some Requests and slay πβ¨ππ¦πΈπ π«Ά
π¦ 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