noxxi / p5-net-sip

Net::SIP Perl Module
Other
15 stars 22 forks source link

Error where registrar hostname is not FQDN or IP #29

Open rsmck opened 4 years ago

rsmck commented 4 years ago

When using a single hostname in a REGISTER request (for example sip1) the following error is thrown;

Can't use string ("0") as an ARRAY ref while "strict refs" in use at /usr/local/share/perl/5.28.1/Net/SIP/Dispatcher.pm line 910

I've also tried to use domain2proxy as follows with the same error;

$domain2proxy = {"sip1" => $proxy};

# create the user agent
$ua = Net::SIP::Simple->new(
  from => $P->opts->from,
  domain2proxy => $domain2proxy,
  registrar => "sip1" 
  outgoing_proxy => $proxy
);

Unfortunately I'm not familiar enough with perl to fix this. If this is not possible, is there a method to prevent it attempting DNS resolution entirely?

Essentially I'm trying to send a REGISTER request with REGISTER sip:sip1 SIP/2.0 to the IP address in $proxy. Unfortunately a limitation of the platform means that I must include the exact local hostname in the REGISTER line, not an FQDN.

If this isn't a bug, and it's simply user error, then any advice you can offer would be much appreciated.

noxxi commented 4 years ago

The registrar is the server used for registration. Insofar it must be a resolvable name. If it is not resolvable you must make it so by creating and using your own Dispatcher with the appropriate dnsresolv option.

rsmck commented 4 years ago

Even if a proxy is set? There’s quite a few corporate systems I can think of where the registrar name does not resolve publicly, but is accessed via an SBC.

I looked at dnsresolv but my attempts to make a “working” function to return what it was expecting failed.

On 17 Oct 2020, at 07:24, Steffen Ullrich notifications@github.com wrote:

 The registrar is the server used for registration. Insofar it must be a resolvable name. If it is not resolvable you must make it so by creating and using your own Dispatcher with the appropriate dnsresolv option.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

pali commented 3 years ago

I understood RFC 3261 in a way that also REGISTER request should respect outbound proxy. Therefore if outgoing_proxy is set then it should be used for delivering REGISTER packets and also in the case when registrar is not resolvable by local DNS.