[OpenSIPS-Users] pn still problems part 2

rvg at rvgeerligs.nl rvg at rvgeerligs.nl
Sat Mar 9 14:09:36 UTC 2024


Adding:

event_route[E_UL_CONTACT_REFRESH]
{
    route(pm_send, $(param(uri){param.value,pn-provider}),
                   $(param(uri){param.value,pn-prid}),
                   $(param(uri){param.value,pn-param}));
#    $callid;
#    $param(callid);
}


#--
route [pm_send]
{
#    exec(marg.sh)
xlog(" -- ** --pn_send was called $ru\n");
xlog("pn_send: pn params:  $(param(uri){param.value,pn-provider}),
                   $(param(uri){param.value,pn-prid}),
                   $(param(uri){param.value,pn-param})\n");
$var(input) = "input mine three";
#async(exec("/root/marg.sh > effect", "this is my $var(input) for exec\n", , , $avp(env));
# async(exec("/root/marg.sh 5 6 7 > effect", $ru, $ru), resume_route);
 exit;
}

question: Does the route[pm_send] need to return any value? exit does not not return value does it?

does the [pm_send] acually need to send the push for the INVITE to be answered by 200 OK?

Regards, Ronald



March 9, 2024 at 2:46 PM, rvg at rvgeerligs.nl wrote:


> 
> Hi All,
> 
> I still have problems with opensips3.4 push notifications:
> 
> Somehow INVITEs keep looping and get rejected.
> 
> Code:
> ...
> route{
> 
> ...
> 
> if (has_totag()) {
> 
> ...
> 
> if (!is_method("ACK"))
>         async (pn_process_purr("location"), resume_route);
> 
> ...
> }
> 
> ...
> 
> # do lookup with method filtering
> 
> #--
>  lookup("location", "method-filtering");
>  $var(rc) = $retcode;
>  switch ($var(rc)) {
>  case 1:
>      # we found at least 1 non-PN contact!
>  xlog("L_INFO", "DBG: 1 contacts found non-PN ($var(rc))\n");
>      $var(do_relay) = true;
>      break;
>  case 2:
>      # success, but all contacts are PN-enabled, so we're
>      # sending PNs / awaiting re-registrations from them
>  xlog("L_INFO", "DBG: contacts found send PN? ($var(rc))\n");
>      $var(do_relay) = false;
>      #$avp(skip_relay) = true;
>      break;
>  default:
>      xlog("L_INFO", "DBG: no contacts found ($var(rc))\n");
>      t_reply(404, "Not Found");
>      exit;
>  }
> 
>  if ($var(do_relay) && !t_relay())
>     send_reply(500, "Internal Server Error");
> 
> ...
> 
> if($var(do_relay) == true) 
>  route(relay);
> }
> 
> ...
> 
> from log (looping log, it repeats):
> 
> DBG:core:parse_headers: this is the first via
> 2024-03-09T09:41:13.485706+00:00 xsp2 /usr/local/sbin/opensips[2061136]: DBG:core:_parse_to: end of header reached, state=10
> 2024-03-09T09:41:13.485748+00:00 xsp2 /usr/local/sbin/opensips[2061136]: DBG:core:_parse_to: display={}, ruri={sip:to at dummy.com}
> 2024-03-09T09:41:13.485807+00:00 xsp2 /usr/local/sbin/opensips[2061136]: DBG:core:get_hdr_field: <To> [20]; uri=[sip:to at dummy.com] 
> 2024-03-09T09:41:13.485854+00:00 xsp2 /usr/local/sbin/opensips[2061136]: DBG:core:get_hdr_field: to body [<sip:to at dummy.com>#015#012]
> 2024-03-09T09:41:13.485915+00:00 xsp2 /usr/local/sbin/opensips[2061136]: DBG:core:get_hdr_field: cseq <CSeq>: <1> 
> 
> 2024-03-09T09:41:13.485962+00:00 xsp2 /usr/local/sbin/opensips[2061136]: DBG:core:get_hdr_field: found end of header
> 2024-03-09T09:41:13.486040+00:00 xsp2 /usr/local/sbin/opensips[2061136]: DBG:core:parse_headers: flags=ffffffffffffffff
> 2024-03-09T09:41:13.486088+00:00 xsp2 /usr/local/sbin/opensips[2061136]: DBG:core:get_dummy_sip_msg: setting as static to 0xffffb1a612c0
> 2024-03-09T09:41:13.486145+00:00 xsp2 /usr/local/sbin/opensips[2061136]: DBG:core:evi_raise_event_msg: found subscriber E_UL_CONTACT_REFRESH
> 2024-03-09T09:41:13.486207+00:00 xsp2 /usr/local/sbin/opensips[2061136]: DBG:core:dup_ref_script_route_in_shm: dupping 0xffffaa264f60 [E_UL_CONTACT_REFRESH], idx 1, ver/cnt 1, to new 0xffffaa26d9e0 [E_UL_CONTACT_REFRESH], idx 1, ver/cnt 1
> 2024-03-09T09:41:13.486283+00:00 xsp2 /usr/local/sbin/opensips[2061136]: DBG:core:release_dummy_sip_msg: cleaning the static sip msg 0xffffb1a612c0
> 2024-03-09T09:41:13.486352+00:00 xsp2 /usr/local/sbin/opensips[2061136]: DBG:core:destroy_avp_list: destroying list (nil)
> 2024-03-09T09:41:13.486409+00:00 xsp2 /usr/local/sbin/opensips[2061136]: DBG:core:ipc_handle_job: received job type 0[RPC] from process 6
> 2024-03-09T09:41:13.486467+00:00 xsp2 /usr/local/sbin/opensips[2061136]: DBG:core:get_dummy_sip_msg: reusing the static sip msg 0xffffb1a612c0
> 2024-03-09T09:41:13.486533+00:00 xsp2 /usr/local/sbin/opensips[2061136]: DBG:core:parse_params: Parsing params for:[sip:rvg at 82.151.164.77:57775;pn-prid=F1B7F53A99A35254A55CCAE2EDF80C1FAE12F353592BB6ED203ADA0175E34AD9:voip;pn-provider=apns;pn-param=ABCD1234.cllkit.voip;pn-silent=1;pn-timeout=0;transport=udp]
> 2024-03-09T09:41:13.486571+00:00 xsp2 /usr/local/sbin/opensips[2061136]: ERROR: -- ** --pn_send was called sip:user at dummy.com
> 2024-03-09T09:41:13.486651+00:00 xsp2 /usr/local/sbin/opensips[2061136]: ERROR:core:route_param_get: route $param variable accepts only integer indexes
> 2024-03-09T09:41:13.486746+00:00 xsp2 /usr/local/sbin/opensips[2061136]: message repeated 2 times: [ ERROR:core:route_param_get: route $param variable accepts only integer indexes]
> 2024-03-09T09:41:13.486787+00:00 xsp2 /usr/local/sbin/opensips[2061136]: ERROR:pn params:  <null>,#012                   ,#012                   
> 
> 2024-03-09T09:41:13.486822+00:00 xsp2 /usr/local/sbin/opensips[2061136]: DBG:core:release_dummy_sip_msg: cleaning the static sip msg 0xffffb1a612c0
> 2024-03-09T09:41:13.486913+00:00 xsp2 /usr/local/sbin/opensips[2061136]: DBG:core:destroy_avp_list: destroying list (nil)
> 2024-03-09T09:41:13.697168+00:00 xsp2 /usr/local/sbin/opensips[2061135]: DBG:core:parse_msg: SIP Request:
> 
> Any advice appreciated, regards,
> 
> Ronald Geerligs
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20240309/5236e774/attachment-0001.html>


More information about the Users mailing list