$regdb.recordnum
With the method in dial plan rule Matchin Patterns, you can get the number of registration records with the same user name.
Syntax:
$regdb.recordnum( SIP-URI ) $regdb.recordnum( username )
Returns:
A number of current registration records with the defined string in the method
Version Since:
3.1
Where the function can be used:
- Preliminary rules
- Regular rules
Example:
Ex1: check if the number of registration records with user name 222 is greater or equals to 1
[Matching Patterns] $request = ^REGISTER $regdb.recordnum( "222" ) = (.+) $math.ge("%1", "1") = true
Ex2: check if the number of registration records in REGISTER request To header’s URI is greater or equals to 1
[Matching Patterns] $request = ^REGISTER $regdb.recordnum( To ) = (.+) $math.ge("%1", "1") = true