|
|
@ -45,23 +45,20 @@ sub create_location {
|
|
|
|
my($contact, $q, $expires, $flags, $cflags) = @$params{qw/contact q expires flags cflags/};
|
|
|
|
my($contact, $q, $expires, $flags, $cflags) = @$params{qw/contact q expires flags cflags/};
|
|
|
|
my $aor = get_aor($c, $prov_subscriber);
|
|
|
|
my $aor = get_aor($c, $prov_subscriber);
|
|
|
|
my $path = _compose_location_path($c, $prov_subscriber, $params);#compose path from path or socket from params
|
|
|
|
my $path = _compose_location_path($c, $prov_subscriber, $params);#compose path from path or socket from params
|
|
|
|
my $exp_type = $c->config->{sip}{usrloc_expires_type} // '';
|
|
|
|
|
|
|
|
if ($expires) {
|
|
|
|
if ($expires) {
|
|
|
|
$expires //= 0;
|
|
|
|
|
|
|
|
if ($exp_type ne 'epoch') {
|
|
|
|
|
|
|
|
$expires = NGCP::Panel::Utils::DateTime::from_string($expires)->epoch;
|
|
|
|
$expires = NGCP::Panel::Utils::DateTime::from_string($expires)->epoch;
|
|
|
|
|
|
|
|
$expires //= 0;
|
|
|
|
$expires -= time();
|
|
|
|
$expires -= time();
|
|
|
|
}
|
|
|
|
|
|
|
|
# "expires" is required to be an integer but it is not a timestamp
|
|
|
|
# "expires" is required to be an integer but it is not a timestamp
|
|
|
|
# <=0: 1970-01-01 00:00:00
|
|
|
|
# <=0: 1970-01-01 00:00:00
|
|
|
|
# 1: now
|
|
|
|
# 1: now
|
|
|
|
# >=1: now + seconds to the future
|
|
|
|
# >=1: now + seconds to the future
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
$expires = 4294967295;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$expires //= 4294967295;
|
|
|
|
|
|
|
|
$expires = 0 if $expires < 0;
|
|
|
|
$expires = 0 if $expires < 0;
|
|
|
|
$flags //= 0;
|
|
|
|
$flags //= 0;
|
|
|
|
$cflags //= 0;
|
|
|
|
$cflags //= 0;
|
|
|
|
|
|
|
|
|
|
|
|
my $ret = NGCP::Panel::Utils::XMLDispatcher::dispatch($c, "proxy-ng", 1, 1, <<EOF );
|
|
|
|
my $ret = NGCP::Panel::Utils::XMLDispatcher::dispatch($c, "proxy-ng", 1, 1, <<EOF );
|
|
|
|
<?xml version="1.0" ?>
|
|
|
|
<?xml version="1.0" ?>
|
|
|
|
<methodCall>
|
|
|
|
<methodCall>
|
|
|
|