opensips 常用的一些变量

首先要注意的是要这些变量是区分大小写的。

$ru - reference to request's URI

$ou - reference to request's original URI

$oU - reference to username in request's original URI

$fU - reference to username in URI of 'From' header

$fu - reference to URI of 'From' header

$si - reference to IP source address of the message

$rd - reference to domain in request's URI

 

更多:

http://www.opensips.org/Documentation/Script-CoreVar

 

常用用法:

1. 根据用户名来对主被叫做限制

if( $fU=="13100000000" && $oU == "13100000001" )

{

     //do something

}

 

2.根据主被叫的IP来做限制

if( $si == $rd )

{
   xlog("you're in same subnet!");

  //do something

}

posted @ 2015-01-12 22:18  从❤️开始  阅读(409)  评论(0编辑  收藏  举报