⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 routing.sgml

📁 H.323网守实现
💻 SGML
📖 第 1 页 / 共 2 页
字号:
<label id="clirewrite"><p>This section contains a set of rewrite rules for ANI/CLI numbers (caller id).The rewrite process is done at two stages - inbound rewrite and outbound rewrite.The inbound rewrite is done before any other Q.931 Setup message processing(like inbound GWRewrite, authentication, accounting, ...) and it will havevisible effect inside auth/acct modules, as it affects Calling-Station-Id.The outbound rewrite takes place just before the Setup message is to be forwardedand its effect is visible only to the callee.<p>An inbound rewrite rule can be matched by a caller's IP and a dialed numberor an original CLI/ANI.An outbound rewrite rule can be matched by a caller's IP, callee's IP anda dialed number or a destination number (the dialed number after rewrite)or a CLI/ANI (after inbound rewrite).<p>This module also provides CLIR (Calling Line Identification Restriction)feature that can be configured for each endpoint (rule).<itemize><item><tt/ProcessSourceInfo=1/<newline>Default: <tt/1/<p>In addition to rewritting a Calling-Party-Number IE also a sourceInfoelement of a H.225.0 Setup message can be rewritten, so both containconsistent information.<item><tt/RemoveH323Id=1/<newline>Default: <tt/1/<p>When a sourceInfo element of an H.225.0 Setup message is rewritten,aliases of type H323_ID, email_ID and url_ID can be left untouchedif this option is disabled.<item><tt/CLIRPolicy=apply/<newline>Default: <tt>N/A</tt><p>Here a global presentation indicator processing policy can be set up.This policy will be applied to all CLI rewrite rules that do not override it.Possible choices are <tt/forward/ - just forward the received PI as is,<tt/apply/ - examine the received PI and hide CLI if it is set to "presentationrestricted" and <tt/applyforterminals/ - similar to <tt/apply/ except that the numberis removed only when the call is send to a terminal, not a gateway.</itemize><descrip><tag/Format for an inbound rule:/<tt>in:CALLER_IP=[pi=[allow|restrict][,forward|apply|applyforterminals]] [cli:|dno:]number_prefix(=|*=|~=)NEW_CLI[,NEW_CLI]...</tt><p>The <tt/in:/ prefix tells that this is an inbound rule and the <tt/CALLER_IP/will be used to match the rule (it can be a single IP or a whole subnet).<newline>The optional <tt/pi=/ parameter controls CLIR (Calling Line Identification Restriction)features. Specifying either <tt/allow/ or <tt/restrict/ forces presentation indicatorto be set to "presentation allowed" or "presentation restricted". <tt/forward/, <tt/apply/and <tt/applyforterminals/ controls how the received (if any) presentation indicatoris processed by the gatekeeper. <tt/forward/ means just to forward it to the callee as is,<tt/apply/ means hiding CLI if the PI is set to "presentation restricted", <tt/applyforterminals/is similar to <tt/apply/, except that CLI is hidden only when sending the call to a terminal,not a gateway.<newline>The prefix <tt/cli:/ or <tt/dno:/ (the default) selects what number will be usedto match the <tt/number_prefix/ - a caller id (CLI/ANI) or a dialed number.Number matching/rewritting can be done in three ways:<itemize><item><tt/=/ - a <tt/cli/ or <tt/dno/ number will be matched using a prefix               match against <tt/number_prefix/ and, if the match is found,               CLI will be replaced with NEW_CLI,<item><tt/~=/ - a <tt/cli/ or <tt/dno/ number will be matched using an identity               match against <tt/number_prefix/ and, if both numbers are the same,               CLI will be replaced with NEW_CLI,<item><tt/*=/ - (VALID ONLY FOR <tt/cli/) a <tt/cli/ number will be matched using               a prefix match against <tt/number_prefix/ and, if the match is found,               the matched CLI prefix (<tt/number_prefix/) will be replaced			   with a NEW_CLI prefix.</itemize>After the equality (=/~=/*=) sign, there follows a list of new CLI values to be used.If more than one value is specified, a one will be choosen on a random basis.It's possible to specify whole number ranges, like 49173600000-49173699999.There is a special string constant "any", that can be used in placeof the <tt/CALLER_IP/ or the <tt/number_prefix/. To enable <tt/CLIR/ for this rule,use a special string constant <tt/"hide"/ instead of the list of new CLI values.Note that CLIR is far more useful for outbound rules.<tag/Example 1:/<tscreen><verb>[RewriteCLI]in:192.168.1.1=dno:5551=3003in:192.168.1.1=cli:1001=2222in:192.168.1.1=any=1111</verb></tscreen><p>These rules tell that for calls from the IP 192.168.1.1:1) if the user dialed a number beginning with 5551, set CLI to 3003,2) if the call is from user with CLI beginning with 1001, set CLI to 2222,3) for other calls from this IP, set CLI to 1111.<tag/Example 2:/<tscreen><verb>[RewriteCLI]in:192.168.1.0/24=any=18001111in:192.168.2.0/24=any=18002222in:any=any=0</verb></tscreen><p>These rules tell that:1) for calls from the network 192.168.1.0/24, set CLI to 18001111,2) for calls from the network 192.168.2.0/24, set CLI to 18002222,3) for other calls, set CLI to 0.<tag/Example 3:/<tscreen><verb>[RewriteCLI]%r1% in:192.168.1.0/24=0048*=48%r2% in:192.168.1.0/24=0*=48in:any=100.~=48900900900</verb></tscreen><p>These rules tell that:1) for calls from the network 192.168.1.0/24, rewrite 0048 to 48 (example - 0048900900900 => 48900900900),2) for other calls from the network 192.168.1.0/24, rewrite 0 to 48 (example - 0900900900 => 48900900900),3) for other calls, if CLI is 4 digits and starts with 100, set it to 48900900900.<tag/Example 4 (CLIR):/<tscreen><verb>[RewriteCLI]in:192.168.1.0/24=any=hide</verb></tscreen><p>This example causes caller's number to be removed from Setup messagesoriginating from the 192.168.1.0/24 network. It also causes proper presentationand screening indicators to be set in Setup messages.</descrip><descrip><tag/Format for an outbound rule:/<tt>out:CALLER_IP=CALLEE_IP [pi=[allow|restrict][,forward|apply|applyforterminals]] [cli:|dno:|cno:]number_prefix(=|~=|*=)NEW_CLI[,NEW_CLI]...</tt><p>The <tt/out:/ prefix tells that this is an outbound rule, the <tt/CALLER_IP/and the <tt/CALLEE_IP/ will be used to match the rule and can be a single IPor a whole network address.<newline>The optional <tt/pi=/ parameter controls CLIR (Calling Line Identification Restriction)features. Specifying either <tt/allow/ or <tt/restrict/ forces presentation indicatorto be set to "presentation allowed" or "presentation restricted". <tt/forward/, <tt/apply/and <tt/applyforterminals/ controls how the received (if any) presentation indicatoris processed by the gatekeeper. <tt/forward/ means just to forward it to the callee as is,<tt/apply/ means hiding CLI if the PI is set to "presentation restricted", <tt/applyforterminals/is similar to <tt/apply/, except that CLI is hidden only when sending the call to a terminal,not a gateway.<newline>The prefix <tt/cli:/, <tt/dno:/ (the default) or <tt/cno:/ selects what numberwill be used to match the <tt/number_prefix/ - a caller id (CLI/ANI),a dialed number or a destination/called number (the dialed number after rewrite).Number matching/rewritting can be done in three ways:<itemize><item><tt/=/ - a <tt/cli/ or <tt/dno/ number will be matched using a prefix               match against <tt/number_prefix/ and, if the match is found,               CLI will be replaced with NEW_CLI,<item><tt/~=/ - a <tt/cli/ or <tt/dno/ number will be matched using an identity               match against <tt/number_prefix/ and, if both numbers are the same,               CLI will be replaced with NEW_CLI,<item><tt/*=/ - (VALID ONLY FOR <tt/cli/) a <tt/cli/ number will be matched using               a prefix match against <tt/number_prefix/ and, if the match is found,               the matched CLI prefix (<tt/number_prefix/) will be replaced			   with a NEW_CLI prefix.</itemize>After the equality sign (=/~=/*=), a list of new CLI values to be used follows.If more than one value is specified, a one will be choosen on a random basis.It's possible to specify whole number ranges, like 49173600000-49173699999.There is a special string constant "any", that can be used in placeof the <tt/CALLER_IP/, the <tt/CALLEE_IP/ or the <tt/number_prefix/. To enable <tt/CLIR/ for this rule, se a special string constant <tt/"hide"/or <tt/"hidefromterminals"/ instead of the list of new CLI values.<tag/Example 1:/<tscreen><verb>[RewriteCLI]out:any=192.168.1.1 any=1001out:any=192.168.1.2 any=1002</verb></tscreen><p>These rules set a fixed ANI/CLI for each terminating IP:1) present myself with ANI 1001, when sending calls to IP 192.168.1.1,2) present myself with ANI 1002, when sending calls to IP 192.168.1.2.<tag/Example 2:/<tscreen><verb>[RewriteCLI]out:any=192.168.1.1 any=1001-1999,3001-3999</verb></tscreen><p>This rule randomly selects ANI/CLI from range 1001-1999, 3001-3999for calls sent to 192.168.1.1.<tag/Example 3 (CLIR):/<tscreen><verb>[RewriteCLI]out:any=any any=hidefromterminalsout:192.168.1.1=any any=hide</verb></tscreen><p>In this example each subscriber has enabled CLIR. So all calls to terminalswill have a caller's number removed and presentation/screening indicators set.Calls to gateways will have only a presentation indicator set to "presention restricted"and the caller's number will not be removed to allow proper call routing and numberremoval at the destination equipment.<newline>One exception to these rules are calls from 192.168.1.1 which will have a caller's numberalways removed, no matter whether calling a terminal or a gateway.<tag/Example 4 (CLIP):/<tscreen><verb>[RewriteCLI]out:any=192.168.1.1 any=hide</verb></tscreen><p>In this example CLIP (Calling Line Identification Presentation) featureis disabled for the user 192.168.1.1.<tag/Example 5 (CLIR):/<tscreen><verb>[RewriteCLI]out:192.168.1.1=any pi=restrict,apply cli:.*=.out:any=any pi=allow cli:.*=.</verb></tscreen><p>These rules do not change CLI (.*=.) and:1) enable CLIR for an endpoint 192.168.1.1. <tt/apply/ tells the gatekeeper   to not only set the PI, but also to hide the number actually,2) force CLI presentation for other endpoints.</descrip><p>Rule matching process has a strictly defined order:<enum><item>the closest caller's IP match is determined (closest means with the longestnetwork mask - single IPs have the highest priority, "any" has the lowestpriority),<item>(outbound rules) the closest callee's IP match is determined,<item>the longest matching prefix/number is searched for the given IP/IP pairin the following order:<enum><item><tt/dno:/ type (dialed number) rules are searched,<item><tt/cno:/ type (destination/called number) rules are searched,<item><tt/cli:/ type (caller id) rules are searched.</enum></enum>After a match for caller's/caller's IP is found, no more rulesare checked, even if no prefix/number is matched inside the set of rulesfor these IPs.<p>On Windows platform, there is a problem with duplicated configkeys, so there is a workaround for this restriction. This examplewill not work because of the same key (<tt/in:192.168.1.1/):<tscreen><verb>[RewriteCLI]in:192.168.1.1=1001=2001in:192.168.1.1=any=2000</verb></tscreen>As the workaround, you can use a string with percent signs (%) at the beginningand at the end before the key. This prefix will be automatically strippedfrom the key name before loading rules:<tscreen><verb>[RewriteCLI]%r1% in:192.168.1.1=1001=2001%r2% in:192.168.1.1=any=2000</verb></tscreen>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -