Re: [SR-Users] Problem with resuming suspended transacation

2018-04-16 Thread Arik Halperin
I had a bug, I was resuming the wrong transaction indeed. I created a new 
transaction for the purpose of http async in a different route and this was 
causing the issue.

Actually managed to solve it after I posted this question.


> On 13 Apr 2018, at 9:55, Kjeld Flarup  wrote:
> 
> You are suspending in [6039] and resuming in [6092], does these two processes 
> share memory?
> 
>   Kjeld
> 
> 2018-04-12 11:52 GMT+02:00 Arik Halperin  >:
> Hello,
> 
>  
> 
> I’m trying to resume a suspended transaction, but keep getting this error:
> 
>  
> 
> WARNING: tm [t_suspend.c:193]: t_continue(): transaction is not suspended 
> [20608:1256194941]
> 
> WARNING: tmx [tmx_mod.c:686]: w_t_continue(): resuming the processing of 
> transaction [20608:1256194941] failed
> 
> WARNING: tm [t_lookup.c:1483]: t_unref(): script writer didn't release 
> transaction
> 
>  
> 
>  
> 
> I’m implementing push handling, in INVITE I do the following:
> 
>  
> 
> route[INVITE] {
> 
>   if (!lookup("location"))
> 
>   {
> 
>  
> 
>send_reply("100", "Trying");
> 
> record_route();
> 
> route(SUSPEND);
> 
>   }
> 
>   else
> 
>   {
> 
>  # NAT detection
> 
>  route(NATMANAGE);
> 
>  if(!t_is_set("onreply_route")) t_on_reply("MANAGE_REPLY");
> 
> record_route();
> 
>  t_relay();
> 
>  ts_store();
> 
>  $sht(vtp=>stored::$rU) = 1;
> 
> }
> 
> route(SENDPUSH);
> 
> }
> 
>  
> 
> # suspend the transaction
> 
> route[SUSPEND] {
> 
>  
> 
> if(!t_suspend()) //Transaction is suspended!
> 
> {
> 
>   exit;
> 
> }
> 
> $sht(vtp=>join::$rU) = "" + $T(id_index) + ":" +$T(id_label);
> 
> }
> 
>  
> 
> In Register I call the PUSHJOIN route:
> 
>  
> 
> # append branches or resume the transaction
> 
> route[PUSHJOIN] {
> 
> $var(hjoin) = 0;
> 
> lock("$tU");
> 
> $var(hjoin) = $sht(vtp=>join::$tU);
> 
> $var(hstored) = $sht(vtp=>stored::$tU);
> 
> $sht(vtp=>join::$tU) = $null;
> 
> unlock("$tU");
> 
> if ($var(hjoin)==0)
> 
> {
> 
> if ($var(hstored))
> 
> ts_append("location", "$tu");
> 
> return;
> 
> }
> 
> $var(id_index) = $(var(hjoin){s.select,0,:}{s.int });
> 
> $var(id_label) = $(var(hjoin){s.select,1,:}{s.int });
> 
> ($var(hjoin))\n");
> 
>  t_continue("$var(id_index)", "$var(id_label)", "INVRESUME");
> 
> }
> 
>  
> 
>  
> 
> For some reason I keep getting:
> 
>  
> 
> Apr 12 12:37:11 kamprod /usr/local/sbin/kamailio[6039]: ERROR: 

Re: [SR-Users] Problem with resuming suspended transacation

2018-04-13 Thread Kjeld Flarup
You are suspending in [6039] and resuming in [6092], does these two
processes share memory?

  Kjeld

2018-04-12 11:52 GMT+02:00 Arik Halperin :

> Hello,
>
>
>
> I’m trying to resume a suspended transaction, but keep getting this error:
>
>
>
> WARNING: tm [t_suspend.c:193]: t_continue(): transaction is not suspended
> [20608:1256194941]
>
> WARNING: tmx [tmx_mod.c:686]: w_t_continue(): resuming the processing of
> transaction [20608:1256194941] failed
>
> WARNING: tm [t_lookup.c:1483]: t_unref(): script writer didn't release
> transaction
>
>
>
>
>
> I’m implementing push handling, in INVITE I do the following:
>
>
>
> route[INVITE] {
>
>   *if (!lookup("location"))*
>
>   {
>
>
>
>send_reply("100", "Trying");
>
> record_route();
>
> *route(SUSPEND);*
>
>   }
>
>   else
>
>   {
>
>  # NAT detection
>
>  route(NATMANAGE);
>
>  if(!t_is_set("onreply_route")) t_on_reply("MANAGE_REPLY");
>
> record_route();
>
>  t_relay();
>
>  ts_store();
>
>  $sht(vtp=>stored::$rU) = 1;
>
> }
>
> route(SENDPUSH);
>
> }
>
>
>
> # suspend the transaction
>
> route[SUSPEND] {
>
>
>
> *if(!t_suspend()) *//Transaction is suspended!
>
> {
>
>   exit;
>
> }
>
> $sht(vtp=>join::$rU) = "" + $T(id_index) + ":" +$T(id_label);
>
> }
>
>
>
> In Register I call the PUSHJOIN route:
>
>
>
> # append branches or resume the transaction
>
> route[PUSHJOIN] {
>
> $var(hjoin) = 0;
>
> lock("$tU");
>
> $var(hjoin) = $sht(vtp=>join::$tU);
>
> $var(hstored) = $sht(vtp=>stored::$tU);
>
> $sht(vtp=>join::$tU) = $null;
>
> unlock("$tU");
>
> if ($var(hjoin)==0)
>
> {
>
> if ($var(hstored))
>
> ts_append("location", "$tu");
>
> return;
>
> }
>
> $var(id_index) = $(var(hjoin){s.select,0,:}{s.int});
>
> $var(id_label) = $(var(hjoin){s.select,1,:}{s.int});
>
> ($var(hjoin))\n");
>
> * t_continue("$var(id_index)", "$var(id_label)", "INVRESUME");*
>
> }
>
>
>
>
>
> For some reason I keep getting:
>
>
>
> Apr 12 12:37:11 kamprod /usr/local/sbin/kamailio[6039]: ERROR: 

[SR-Users] Problem with resuming suspended transacation

2018-04-13 Thread Arik Halperin
Hello,

I’m trying to resume a suspended transaction, but keep getting this error:

WARNING: tm [t_suspend.c:193]: t_continue(): transaction is not suspended 
[20608:1256194941]
WARNING: tmx [tmx_mod.c:686]: w_t_continue(): resuming the processing of 
transaction [20608:1256194941] failed
WARNING: tm [t_lookup.c:1483]: t_unref(): script writer didn't release 
transaction


I’m implementing push handling, in INVITE I do the following:

route[INVITE] {
  if (!lookup("location"))
  {

   send_reply("100", "Trying");
record_route();
route(SUSPEND);
  }
  else
  {
 # NAT detection
 route(NATMANAGE);
 if(!t_is_set("onreply_route")) t_on_reply("MANAGE_REPLY");
record_route();
 t_relay();
 ts_store();
 $sht(vtp=>stored::$rU) = 1;
}
route(SENDPUSH);
}

# suspend the transaction
route[SUSPEND] {

if(!t_suspend()) //Transaction is suspended!
{
  exit;
}
$sht(vtp=>join::$rU) = "" + $T(id_index) + ":" +$T(id_label);
}

In Register I call the PUSHJOIN route:

# append branches or resume the transaction
route[PUSHJOIN] {
$var(hjoin) = 0;
lock("$tU");
$var(hjoin) = $sht(vtp=>join::$tU);
$var(hstored) = $sht(vtp=>stored::$tU);
$sht(vtp=>join::$tU) = $null;
unlock("$tU");
if ($var(hjoin)==0)
{
if ($var(hstored))
ts_append("location", "$tu");
return;
}
$var(id_index) = $(var(hjoin){s.select,0,:}{s.int});
$var(id_label) = $(var(hjoin){s.select,1,:}{s.int});
($var(hjoin))\n");
 t_continue("$var(id_index)", "$var(id_label)", "INVRESUME");
}


For some reason I keep getting:

Apr 12 12:37:11 kamprod /usr/local/sbin/kamailio[6039]: ERROR: