04-01-2008 02:17 AM - edited 03-15-2019 09:46 AM
Hi
I need to block all calls except "77xxx"
Calling from 77xxx to 72xxx.
Here is my config:
----------------------------------------------
voice translation-rule 1
rule 1 /\(77...$\)/ /\1/
rule 2 reject //
voice translation-profile reject_test
translate calling 1
dial-peer voice 72 pots
preference 1
destination-pattern 72...
progress_ind setup enable 3
progress_ind alert enable 8
direct-inward-dial
port 1/1:15
prefix 72
dial-peer voice 77 voip
call-block translation-profile incoming reject_test
call-block disconnect-cause incoming call-reject
destination-pattern 77...
voice-class codec 1
session protocol sipv2
session target ipv4:192.168.255.247
dtmf-relay rtp-nte
no vad
---------------------------------------------
If I test this rule all works:
----------------------------------------------
7204#test voice translation-rule 1 77901
Matched with rule 1
Original number: 77901 Translated number: 77901
Original number type: none Translated number type: none
Original number plan: none Translated number plan: none
7204#test voice translation-rule 1 77901222222
77901222222 blocked on rule 2
7204#test voice translation-rule 1 333333333
333333333 blocked on rule 2
----------------------------------------------
But when I use this rules on dial-peer,all calls drops.When I delete " rule 2 reject //" calls pass true.
Here debug:
---------------------------------------------
Apr 1 08:47:20.162: //-1/12E8115EA3FA/RXRULE/regxrule_stack_pop_RegXruleNumInfo: stack=0x7D8FA04; count=1
Apr 1 08:47:20.162: //-1/12E8115EA3FA/RXRULE/regxrule_match: Matched a call block rule; number=77901 rule precedence=2
Apr 1 08:47:20.162: //-1/12E8115EA3FA/RXRULE/regxrule_profile_block_internal: Matched with rule 2 in ruleset 1
Apr 1 08:47:20.162: //-1/12E8115EA3FA/RXRULE/regxrule_stack_pop_RegXruleNumInfo: stack=0x7D8FA04; count=0
Apr 1 08:47:20.406: //-1/F7B46E599410/RXRULE/regxrule_stack_pop_RegXruleNumInfo: stack=0x7D92A40; count=2
Apr 1 08:47:20.634: //-1/808638C18B44/RXRULE/regxrule_stack_pop_RegXruleNumInfo: stack=0x7D8E7A4; count=2
---------------------------------------------
Can anybody help me to write correct "translation-rule" ?
Thanks
04-01-2008 03:59 AM
Hi, with voip DP and "call-block" you don't need to specify reject in rule.
Just build rules so that numbers to reject are matched.
eg
rule 1 /^[^7][^7]/ //
Hope this helps, please rate post if it does!
04-01-2008 04:50 AM
I fined this solution " rule 1 reject /^[^7]\.*/ "
Its allows only numbers begins with 7 and block all other .But I cant understand how to transform this example to allow only 77xxx .
04-01-2008 05:13 AM
Have you read my answer above ? reject is not need for "call-block" lists. It is used for rules applies to pots ports or DP.
04-01-2008 05:42 AM
If I write something like this:
rule 1 /^[^7]/ //
All numbers except 7 will be translate.
In this example all numbers except 7 will be drop.And this what I need.
rule 1 reject /^[^7]\.*/
7204#test voice translation-rule 1 7
7 Didn't match with any of rules
7204#test voice translation-rule 1 6
6 blocked on rule 1
7204#test voice translation-rule 1 8
8 blocked on rule 1
If you can write good example,write it.
04-01-2008 05:44 AM
I did wrote already, read above.
All what begins with 77 is passed unchanged.
The rest is rejected.
04-01-2008 06:09 AM
Ok ,maybe I dont understand something but your example dont work:
voice translation-rule 1
rule 1 /^[^7][^7]/ //
!
7204(cfg-translation-rule)#do test voice translation-rule 1 77001
77001 Didn't match with any of rules
7204(cfg-translation-rule)#do test voice translation-rule 1 770011
770011 Didn't match with any of rules
7204(cfg-translation-rule)#do test voice translation-rule 1 7700111
7700111 Didn't match with any of rules
7204(cfg-translation-rule)#do test voice translation-rule 1 66001
Matched with rule 1
Original number: 66001 Translated number: 001
Original number type: none Translated number type: none
Original number plan: none Translated number plan: none
7204(cfg-translation-rule)#
Why number 66001 translates to 001 ?
Once again I need to pass only 5 digit number begins with 77 (77xxx),all other drop.
In my example all calls except 7* drops.
04-01-2008 06:43 AM
As mentioned above, with call-block command, you don't have to worry translations, because there are no translations.
Again: numbers that matches a rule, are rejected.
All the others are sent not reject and not translated.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide