User Tools

Site Tools


cookbooks:devel:pseudovariables

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
cookbooks:devel:pseudovariables [2021/03/25 13:03]
miconda [$T_branch_idx]
cookbooks:devel:pseudovariables [2021/04/27 09:36]
miconda
Line 1: Line 1:
-{{ :cookbooks:devel:pseudovariables.png?200|}} 
 ====== Pseudo-Variables ====== ====== Pseudo-Variables ======
  
-Version: Kamailio SIP Server v5.5.x (devel)+Version: Kamailio SIP Server v5.6.x (devel) 
 + 
 +{{ :cookbooks:devel:pseudovariables.png?200|}}
  
 ===== Introduction ===== ===== Introduction =====
Line 437: Line 438:
 **$retcode** - same as **$rc** **$retcode** - same as **$rc**
  
 +Note that the value of $rc is overwritten by each new function call.
 +
 +Example of use:
 +
 +<code c>
 + lookup("location");
 + $var(rc) = $rc;
 + if ($var(rc) < 0) {
 + t_newtran();
 + switch ($var(rc)) {
 + case -1:
 + case -3:
 + send_reply("404", "Not Found");
 + exit;
 + case -2:
 + send_reply("405", "Method Not Allowed");
 + exit;
 + }
 + }
 +
 +</code>
 ==== $rd - Domain in R-URI ==== ==== $rd - Domain in R-URI ====
  
cookbooks/devel/pseudovariables.txt · Last modified: 2022/04/11 15:24 by henningw