03-18-2022 03:59 AM
Hello,
I try to block some calls on the incoming dial-peer but have to translate 1 special number.
!!!
Here is my config
dial-peer voice 1 voip
description PROVIDER
translation-profile incoming SIP-IN
voice translation-profile SIP-IN
translate called 901
voice translation-rule 901
rule 1 /\+4930123450$/ /+493012345999/ type any unknown
rule 2 reject /\+4930123450.*$/
rule 3 reject /\+493012345..$/
rule 4 reject /\+493012345.$/
!!!
A "test voice translation-rule" works fine.
test voice translation-rule 901 +49301234510
+49301234510 blocked on rule 3
!!!
But a call to one of these numbers to be rejected and "debug voip translation" leads to
...
Mar 18 10:29:05: //-1/B09D1E8291E6/RXRULE/regxrule_profile_translate_internal: number=+49301234510 type=unknown plan=unknown numbertype=called
Mar 18 10:29:05: //-1/B09D1E8291E6/RXRULE/regxrule_match: No match; number=+49301234510 rule precedence=1
Mar 18 10:29:05: //-1/B09D1E8291E6/RXRULE/regxrule_match: No match; number=+49301234510 rule precedence=2
Mar 18 10:29:05: //-1/B09D1E8291E6/RXRULE/regxrule_match: Skipping a call block rule; number=+49301234510 rule precedence=3
Mar 18 10:29:05: //-1/B09D1E8291E6/RXRULE/regxrule_match: No match; number=+49301234510 rule precedence=4
Mar 18 10:29:05: //-1/B09D1E8291E6/RXRULE/regxrule_profile_match_internal: No match found
Mar 18 10:29:05: //-1/B09D1E8291E6/RXRULE/regxrule_profile_translate_internal: No match: number=+49301234510 type=unknown plan=unknown
...
!!!
Is it a problem to have translate and reject rules in the same translation-ruleset ?
I tried to use a "call-block translation-profile incoming" but the translation ("0" => "999") should be first.
Any ideas how can I solve this?
Thanks.
Stefan
03-18-2022 04:33 AM - edited 03-18-2022 06:27 AM
AFAIK you can not have regular translations and blocks calls in the same rule set. Try with this configuration.
voice translation-rule 901 rule 1 /\+4930123450$/ /+493012345999/ type any unknown voice translation-rule 100 rule 1 reject /\+4930123450.*/ rule 2 reject /\+493012345..$/ rule 3 reject /\+493012345.$/ voice translation-profile SIP-IN translate called 901 voice translation-profile CALL-BLOCK-IN translate called 100 dial-peer voice 1 voip description PROVIDER translation-profile incoming SIP-IN call-block translation-profile incoming CALL-BLOCK-IN call-block disconnect-cause incoming call-reject
03-18-2022 06:22 AM
I was under the impression that you can have translations and rejects in the same inbound voice translation profile. I do this in my lab for classes (based on a PSTN config provided by Cisco for the older v10.x classes). But this is on an ISDN circuit an not VoIP, which may make a difference. I have been unable to determine if that is the case and can't find documentation either way. Do you have a source for this?
voice translation-rule 11 rule 1 /^112$/ /11&/ type unknown unknown rule 2 /^[1-9][0-9][0-9].......$/ /11C&/ type international international rule 3 /^[1-9][0-9][0-9]....$/ /11C&/ type international international rule 4 /^[2-9][0-9][0-9].......$/ /11B&/ type national national rule 5 /^0[2-9][0-9][0-9].......$/ /11B&/ type unknown unknown rule 6 /^[2-9][0-9][0-9]....$/ /11A&/ rule 7 /^00.*$/ /11C&/ type unknown unknown rule 8 /^[1-9].*$/ /11C&/ type international international rule 9 reject /^.*$/
That said, I think the config you posted should work fine.
Maren
03-18-2022 06:35 AM - edited 03-18-2022 06:53 AM
What do you know, I stand corrected, you're perfectly right. I had a look at my probably all time most refenced document and it does actually state that it is possible to mix these in the same rule set. This document could also be helpful for how voice translation rules operate. That said I have never done this, I always split these apart into different rule sets as in my suggestion.
03-18-2022 06:37 AM
+5 and another +5 for the docs. I have both of those, and also reference them frequently! -- Maren
03-18-2022 07:45 AM
Thanks for your answers.
@Maren Mahoney: "...the config ... should work fine." But it doesn't, unfortunately. I get "No match; number=+49301234510" and "Skipping a call block rule". And the call is not rejected.
@Roger Kallberg: I tried with "call-block translation-profile incoming" but, unfortunately again, the call-block (reject /\+493012345.$/) matches first and never comes to the translation (/\+4930123450$/ /+493012345999/).
But as I undestand, it is possible to have translate and rejects in the same ruleset, right?
Stefan
03-18-2022 08:10 AM - edited 03-19-2022 12:07 AM
Please read my answer again. In my configuration I suggested that you split the modification and blocking into two rule sets and assign them to the inbound dial peer via two different configuration commands.
Please remember that rules sets are top-down processing and as soon as there is a hit no more rules will be evaluated. With this the order of the rules in the set are important, if not crucial even.
Apart from this @Maren Mahoney comment on that the configuration should work was I think directed to me as she answered my post. The community is threaded and you can see the post in the relation to others.
03-21-2022 01:55 AM
Hello @Roger Kallberg
sorry I wasn't quite correct.
Of course I configured an incoming translation-profile AND an incoming call-block in the incoming dial-peer.
But still the call-block matches first and the translation never happens.
Unfortunately it overlaps - "0" should be translated to "999" but "01","02"... should be rejected.
Now I tried this config - it seems to do the trick. Now "0" and "01","02"... are translated to "999" but it is acceptable for us.
Every other 1- or 2-digit number is rejected. 3-digit numbers are not processed (as expected).
voice translation-rule 401
rule 1 /\+4930123450.*/ /+493012345999/
!
voice translation-rule 409
rule 1 reject /\+493012345[1-9]$/
rule 2 reject /\+493012345[1-9].$/
voice translation-profile PROVIDER-IN
translate called 401
voice translation-profile PROVIDER-BLOCK-IN
translate called 409
dial-peer voice 401 voip
description ===========================IN-from-PROVIDER
translation-profile incoming PROVIDER-IN
call-block translation-profile incoming PROVIDER-BLOCK-IN
call-block disconnect-cause incoming unassigned-number
Thanks for your help.
Stefan
03-21-2022 02:24 AM
Hi Stefan,
Glad that you managed to solve it. The order of operation for the two independent parts, blocking and translating, would per what you noticed first hand be that the blocking takes place first and then the translation. So it you have an overlap between the match statements in the two the blocking would take precedence based on the order of operation.
What messes this up for you somewhat is the German dial-plan that allows variable length for the called number inbound from the service provider, aka over-lap signaling. This is IMHO an abomination of thing to have, as it makes this type of configuration quite troublesome, but I know from first hand experience that this is a thing in Germany and also Austria.
03-21-2022 02:33 AM - edited 03-21-2022 02:34 AM
Btw have you tested with this for the translation part?
voice translation-rule 401
rule 1 /^\+4930123450$/ /+493012345999/
or
voice translation-rule 401 rule 1 /^\(\+493012345\)0$/ /\1999/
Neither of these should from what I can tell overlap with the blocking rules that you shared in your last response as neither of them matches a 0 (zero) after the 5.
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