Hi
I am having a little difficulty in setting up enum lookups.
When a call comes in for a number prefixed with 00, for enum i would really have to replace this with a + prefix since enum requires that, however if this is done then I have problems with the lcr table and my prefixes, since they all are without + sign hence if no enum found I need to strip the plus off again before I pass it on to my pstn gateway.
I was attempting to do something like this..would it be correct
if (uri=~"^sip:00[0-9]*@") { strip(2); prefix("+");
}; # So now we have the + sign in front
if (uri=~"^sip:+[0-9]*@") { log(1, "+ International number detected\n");
if (!enum_query("e164.arpa") || !enum_query("e164.info")) { strip(1); route (8); # normal pstn };
else { route(1); # e164 result };
Problem is, whatif results were present in both trees, would that be a problem. Also if the e164 message works, I guess then you dont really need to do anything since its just goes out on SIP.
Iqbal
Iqbal wrote:
Hi
I am having a little difficulty in setting up enum lookups.
When a call comes in for a number prefixed with 00, for enum i would really have to replace this with a + prefix since enum requires that, however if this is done then I have problems with the lcr table and my prefixes, since they all are without + sign hence if no enum found I need to strip the plus off again before I pass it on to my pstn gateway.
I was attempting to do something like this..would it be correct
if (uri=~"^sip:00[0-9]*@") { strip(2); prefix("+");
}; # So now we have the + sign in front
if (uri=~"^sip:+[0-9]*@") { log(1, "+ International number detected\n");
if (!enum_query("e164.arpa") || !enum_query("e164.info")) {
One of the enum queries will always be FALSE, thus the condition is always true! Try instead:
if (enum_query("e164.arpa")) { log(1,"ENUM found in public ENUM"); route(IP) } else if (enum_query("e164.info")) { log(1,"ENUM found in private ENUM"); route(IP) } else if (enum_query("freenum.org")) { log(1,"ENUM found in freenum"); route(IP) } else { log(1,"No ENUM, route to PSTN"); route(PSTN) }
strip(1); route (8); # normal pstn };
else { route(1); # e164 result };
Problem is, whatif results were present in both trees, would that be a problem. Also if the e164 message works, I guess then you dont really need to do anything since its just goes out on SIP.
Iqbal
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Hi
I was trying to set this up and realised I dont have a IP route :-) its the default one, never really thought of having a IP route , hence what would logix like this work
if (!enum_query("e164.arpa") && !enum_query("e164.info") && !enum_query("freenum.org")) { route(PSTN) }
This seems to say that if its not present in any goto pstn...although I have got my logix mixed up in the past ;-)
Iqbal Klaus Darilion wrote:
Iqbal wrote:
Hi
I am having a little difficulty in setting up enum lookups.
When a call comes in for a number prefixed with 00, for enum i would really have to replace this with a + prefix since enum requires that, however if this is done then I have problems with the lcr table and my prefixes, since they all are without + sign hence if no enum found I need to strip the plus off again before I pass it on to my pstn gateway.
I was attempting to do something like this..would it be correct
if (uri=~"^sip:00[0-9]*@") { strip(2); prefix("+");
}; # So now we have the + sign in front
if (uri=~"^sip:+[0-9]*@") { log(1, "+ International number detected\n");
if (!enum_query("e164.arpa") || !enum_query("e164.info")) {
One of the enum queries will always be FALSE, thus the condition is always true! Try instead:
if (enum_query("e164.arpa")) { log(1,"ENUM found in public ENUM"); route(IP) } else if (enum_query("e164.info")) { log(1,"ENUM found in private ENUM"); route(IP) } else if (enum_query("freenum.org")) { log(1,"ENUM found in freenum"); route(IP) } else { log(1,"No ENUM, route to PSTN"); route(PSTN) }
strip(1); route (8); # normal pstn };
else { route(1); # e164 result };
Problem is, whatif results were present in both trees, would that be a problem. Also if the e164 message works, I guess then you dont really need to do anything since its just goes out on SIP.
Iqbal
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
.
Iqbal wrote:
Hi
I was trying to set this up and realised I dont have a IP route :-) its the default one, never really thought of having a IP route , hence what would logix like this work
if (!enum_query("e164.arpa") && !enum_query("e164.info") && !enum_query("freenum.org")) { route(PSTN) }
This may cause unpredictable behaviour, as you never know how the if statement is processed internally. (which lookup will be the first one)
regards, klaus
regards, klaus
This seems to say that if its not present in any goto pstn...although I have got my logix mixed up in the past ;-)
Iqbal Klaus Darilion wrote:
Iqbal wrote:
Hi
I am having a little difficulty in setting up enum lookups.
When a call comes in for a number prefixed with 00, for enum i would really have to replace this with a + prefix since enum requires that, however if this is done then I have problems with the lcr table and my prefixes, since they all are without + sign hence if no enum found I need to strip the plus off again before I pass it on to my pstn gateway.
I was attempting to do something like this..would it be correct
if (uri=~"^sip:00[0-9]*@") { strip(2); prefix("+");
}; # So now we have the + sign in front
if (uri=~"^sip:+[0-9]*@") { log(1, "+ International number detected\n");
if (!enum_query("e164.arpa") || !enum_query("e164.info")) {
One of the enum queries will always be FALSE, thus the condition is always true! Try instead:
if (enum_query("e164.arpa")) { log(1,"ENUM found in public ENUM"); route(IP) } else if (enum_query("e164.info")) { log(1,"ENUM found in private ENUM"); route(IP) } else if (enum_query("freenum.org")) { log(1,"ENUM found in freenum"); route(IP) } else { log(1,"No ENUM, route to PSTN"); route(PSTN) }
strip(1); route (8); # normal pstn };
else { route(1); # e164 result };
Problem is, whatif results were present in both trees, would that be a problem. Also if the e164 message works, I guess then you dont really need to do anything since its just goes out on SIP.
Iqbal
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
.
Klaus Darilion writes:
if (!enum_query("e164.arpa") && !enum_query("e164.info") && !enum_query("freenum.org")) { route(PSTN) }
This may cause unpredictable behaviour, as you never know how the if statement is processed internally. (which lookup will be the first one)
this is news to me. i have always thought that && in ser.cfg has same semantics as in C, i.e., that operands are evaluated from left to right. is it really true that they can be evaluated in any order?
-- juha
I'm glad someone else said that b4 me, cause my C is useless, but I was under the impression that it would follow a logical route, I mean it should...shouldn't it
Iqbal
Juha Heinanen wrote:
Klaus Darilion writes:
if (!enum_query("e164.arpa") && !enum_query("e164.info") && !enum_query("freenum.org")) { route(PSTN) }
This may cause unpredictable behaviour, as you never know how the if statement is processed internally. (which lookup will be the first one)
this is news to me. i have always thought that && in ser.cfg has same semantics as in C, i.e., that operands are evaluated from left to right. is it really true that they can be evaluated in any order?
-- juha
.
Juha Heinanen wrote:
Klaus Darilion writes:
if (!enum_query("e164.arpa") && !enum_query("e164.info") && !enum_query("freenum.org")) { route(PSTN) }
This may cause unpredictable behaviour, as you never know how the if statement is processed internally. (which lookup will be the first one)
this is news to me. i have always thought that && in ser.cfg has same semantics as in C, i.e., that operands are evaluated from left to right. is it really true that they can be evaluated in any order?
I've never found this somewhere written down, thus I avoided such constructs. If the behaviour is specified, then it is save to use.
regards, klaus
indeed, the if statements are evaluated exactly as in C = left to right, stop when overall result found.
bogdan
Juha Heinanen wrote:
Klaus Darilion writes:
if (!enum_query("e164.arpa") && !enum_query("e164.info") && !enum_query("freenum.org")) { route(PSTN) }
This may cause unpredictable behaviour, as you never know how the if statement is processed internally. (which lookup will be the first one)
this is news to me. i have always thought that && in ser.cfg has same semantics as in C, i.e., that operands are evaluated from left to right. is it really true that they can be evaluated in any order?
-- juha
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
cheers guys, makes the config look nicer :-)
Iqbal
Bogdan-Andrei Iancu wrote:
indeed, the if statements are evaluated exactly as in C = left to right, stop when overall result found.
bogdan
Juha Heinanen wrote:
Klaus Darilion writes:
if (!enum_query("e164.arpa") && !enum_query("e164.info") && > >
!enum_query("freenum.org")) {
route(PSTN) } This may cause unpredictable behaviour, as you never know how the
if > statement is processed internally. (which lookup will be the first
one)
this is news to me. i have always thought that && in ser.cfg has same semantics as in C, i.e., that operands are evaluated from left to right. is it really true that they can be evaluated in any order?
-- juha
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers
.