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 [2017/09/27 10:40]
miconda [$prid]
cookbooks:devel:pseudovariables [2018/04/10 15:07]
miconda [$si - Source IP address]
Line 1: Line 1:
 {{ :cookbooks:devel:pseudovariables.png?200|}} {{ :cookbooks:devel:pseudovariables.png?200|}}
-====== Kamailio SIP Server v5.1.x (devel): Pseudo-Variables ======+====== Kamailio SIP Server v5.2.x (devel): Pseudo-Variables ======
  
 ===== Introduction ===== ===== Introduction =====
Line 176: Line 176:
 ==== $csb - CSeq Header Body ==== ==== $csb - CSeq Header Body ====
  
-**$cs** - reference to the CSeq header body (number method).+**$csb** - reference to the CSeq header body (number method).
 ==== $ct - Contact header ==== ==== $ct - Contact header ====
  
Line 490: Line 490:
 **$Rut** - local socket where the SIP messages was received in URI format, always with transport parameter. **$Rut** - local socket where the SIP messages was received in URI format, always with transport parameter.
  
 +==== $sas - Source address in socket format ====
 +
 +**$sas** - get source address in socket format (proto:address:port).
 ==== $sbranch(attr) - Static Branch ==== ==== $sbranch(attr) - Static Branch ====
  
Line 519: Line 522:
 **$si** - reference to IP source address of the message - see also $siz **$si** - reference to IP source address of the message - see also $siz
  
 +==== $sid - Server ID ====
 +
 +**$sid** - the value for server id (server_id parameter)
 ==== $siz - Source IP address ==== ==== $siz - Source IP address ====
  
Line 1981: Line 1987:
   * 0x000 - HEP attribute 0x000   * 0x000 - HEP attribute 0x000
   * 0x999 - HEP attribute 0x999   * 0x999 - HEP attribute 0x999
 +
 +===== $phn(rid=>key) - Phonenum Variables =====
 +
 +$phn(rid=>key) - rid is an identifier for this query result; it is designated by the second parameter of phonenum_match(). The key can be one of the following:
 +
 +  * number - phone number that is matched
 +  * valid - 1 if the matched number has a valid result; 0 otherwise
 +  * normalized - normalized phone number
 +  * cctel - country code for phone number
 +  * ltype - local network type
 +  * ndesc - phone number description
 +  * error - error string if phone number matching fails.
 +
 +<code c>
 +if(phonenum_match("1-484-555-8888", "src")) {
 +    if($phn(src=>valid)==1) {
 +        xlog("number normalized to: $phn(src=>normalized)\n");
 +    } else {
 +        xlog("number normalization error: $phn(src=>error)\n");
 +    }
 +}
 +</code>
  
 ===== $C(xy) - Foreground and background colors ===== ===== $C(xy) - Foreground and background colors =====
cookbooks/devel/pseudovariables.txt ยท Last modified: 2022/04/11 15:24 by henningw