diff --git a/lib/NGCP/Panel/Utils/Preferences.pm b/lib/NGCP/Panel/Utils/Preferences.pm index f438188896..f57369e477 100644 --- a/lib/NGCP/Panel/Utils/Preferences.pm +++ b/lib/NGCP/Panel/Utils/Preferences.pm @@ -2778,7 +2778,7 @@ sub update_sems_peer_auth { sub get_peer_auth_params { my ($c, $prov_subscriber, $prefs) = @_; - foreach my $attribute (qw/peer_auth_user peer_auth_hf_user peer_auth_realm peer_auth_pass peer_auth_register/){ + foreach my $attribute (qw/peer_auth_user peer_auth_hf_user peer_auth_realm peer_auth_registrar_server peer_auth_pass peer_auth_register/){ my $rs; $rs = get_usr_preference_rs( c => $c, diff --git a/lib/NGCP/Panel/Utils/Sems.pm b/lib/NGCP/Panel/Utils/Sems.pm index ed76fda0b9..5bb87bc7d0 100644 --- a/lib/NGCP/Panel/Utils/Sems.pm +++ b/lib/NGCP/Panel/Utils/Sems.pm @@ -97,6 +97,9 @@ sub create_peer_registration { # use the value of the peer_auth_user instead my $authorization_username = $$prefs{peer_auth_hf_user} // $$prefs{peer_auth_user}; + # if there a specific registrar server defined, provide it. Otherwise use realm's value. + my $registrar_server = $$prefs{peer_auth_registrar_server} // $$prefs{peer_auth_realm}; + my @ret = NGCP::Panel::Utils::XMLDispatcher::dispatch($c, "appserver", $all, 1, < @@ -109,6 +112,7 @@ sub create_peer_registration { sip:$$prefs{peer_auth_user}\@$contact;uuid=$uuid$transport $authorization_username $type + $registrar_server EOF @@ -219,6 +223,9 @@ sub update_peer_registration { # use the value of the peer_auth_user instead my $authorization_username = $$prefs{peer_auth_hf_user} // $$prefs{peer_auth_user}; + # if there a specific registrar server defined, provide it. Otherwise use realm's value. + my $registrar_server = $$prefs{peer_auth_registrar_server} // $$prefs{peer_auth_realm}; + my @ret = NGCP::Panel::Utils::XMLDispatcher::dispatch($c, "appserver", $all, 1, < @@ -231,6 +238,7 @@ sub update_peer_registration { sip:$$prefs{peer_auth_user}\@$contact;uuid=$uuid$transport $authorization_username $type + $registrar_server EOF @@ -243,6 +251,9 @@ EOF # use the value of the peer_auth_user instead my $old_authorization_username = $$oldprefs{peer_auth_hf_user} // $$oldprefs{peer_auth_user}; + # if there a specific registrar server defined, provide it. Otherwise use realm's value. + my $old_registrar_server = $$oldprefs{peer_auth_registrar_server} // $$oldprefs{peer_auth_realm}; + if(grep { $$_[1] == 0 or $$_[2] !~ m#OK# } @ret) { # error $c->log->error("Failed XML-RPC call to appserver: ". Dumper \@ret); @@ -260,6 +271,7 @@ EOF sip:$$oldprefs{peer_auth_user}\@$contact;uuid=$uuid $old_authorization_username $type + $old_registrar_server EOF @@ -328,6 +340,9 @@ EOF # use the value of the peer_auth_user instead my $old_authorization_username = $$oldprefs{peer_auth_hf_user} // $$oldprefs{peer_auth_user}; + # if there a specific registrar server defined, provide it. Otherwise use realm's value. + my $old_registrar_server = $$oldprefs{peer_auth_registrar_server} // $$oldprefs{peer_auth_realm}; + if(grep { $$_[1] == 0 or $$_[2] !~ m#OK# } @ret) { # error $c->log->error("Failed XML-RPC call to appserver: ". Dumper \@ret); @@ -345,6 +360,7 @@ EOF sip:$$oldprefs{peer_auth_user}\@$contact;uuid=$uuid $old_authorization_username $type + $old_registrar_server EOF