Ronald Wiplinger wrote:
I tried something new:
From Eyebeam I called 00886228357765
In openser.cfg I have now:
route{
xlog("L_ERR", "request method: [$rm], from URI: [$fu], To URI:
[$tu]");
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit;
};
if (msg:len >= 4096 ) {
sl_send_reply("513", "Message too big");
exit;
};
# NAT detection
route(2);
# if you want to make ENUM work with numbers starting with "00",
# use the following to convert "00" it into a "+"
if (uri=~"^sip:00[1-9][0-9]*@") { #taipei\.elmit\.net") {
# strip leading "00"
# (change
example.net to your domainname or skip the stuff after
the "@")
strip(2);
# (adjust, if your international prefix is something else than "00")
prefix("+");
};
# check if request uri starts with an international phone
# number (+X.), if yes, try to ENUM resolve in e164.arpa.
# if no result, try in
nrenum.net
if (uri=~"sip:\+[0-9]+@") { # taipei\.elmit\.net")
{
if(!enum_query("e164.arpa.") &&
!enum_query("e164.org.") && !enum_query("e164.info.")
&&
!enum_query("enum.org."))
{
xlog("L_ERR", "Invalid enum? Route to
PSTN");
};
xlog("L_ERR","we matched just number");
route(1);
exit;
};
route[1] {
if (subst_uri('/(sip:.*);nat=yes/\1/')){
setflag(6);
};
if (isflagset(5)||isflagset(6)) {
route(3);
}
# send it out now; use stateful forwarding as it works reliably
# even for UDP2TCP
if (!t_relay()) {
sl_reply_error();
};
exit;
}
The log file shows:
Sep 30 15:33:35 taipei Taipei-openser[22244]: request method: [INVITE],
from URI: [sip:7311@59.124.210.41], To URI:
[sip:00886228357765@59.124.210.41]
Sep 30 15:33:35 taipei Taipei-openser[22244]: we matched just number
Sep 30 15:34:05 taipei Taipei-openser[22250]: request method: [ACK],
from URI: [sip:7311@59.124.210.41], To URI:
[sip:00886228357765@59.124.210.41]
Sep 30 15:34:05 taipei Taipei-openser[22250]: we matched just number
1. what is the result of the enum query? I want to print it as a message
into the log file.
I only see now that there is an answer!
2. How can I check that the leading 00 are replaced with a + ????
3. Is the logic correct? As I understand it now, it checks if it is an
enum, if not, it
gives me a message (invalid), than it falls into the rail of matching
and give me another message that it found a match
(I just verified that with a non-ENUM number)
and after that it goes to route(1). What should it do there, if the
number is not matching an enum.
bye
Ronald
I try to call an ENUM number. I use this settings for it:
mpath="/usr/local/lib64/openser/modules/"
loadmodule "enum.so"
# -- enum params --
modparam("enum", "domain_suffix", "e164.arpa.")
route{
#
-----------------------------------------------------------------
# initial sanity checks -- messages with
# max_forwards==0, or excessively long requests
#
-----------------------------------------------------------------
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit;
};
if (msg:len >= 4096 ) {
sl_send_reply("513", "Message too big");
exit;
};
#
-----------------------------------------------------------------
# NAT detection
#
-----------------------------------------------------------------
log("I am checking for NAT now\n");
route(2);
#
-----------------------------------------------------------------
# if you want to make ENUM work with numbers starting with "00",
# use the following to convert "00" it into a "+"
#
-----------------------------------------------------------------
log("I am checking for ENUM now\n");
if (uri=~"^sip:00[1-9][0-9]*@") { # tried before:
taipei\.elmit\.net") {
# strip leading "00"
# (change
example.net to your domainname or skip the stuff
after the "@")
strip(2);
# (adjust, if your international prefix is something else than
"00")
prefix("+");
};
# check if request uri starts with an international phone
# number (+X.), if yes, try to ENUM resolve in e164.arpa.
# if no result, try in
nrenum.net
if (uri=~"sip:\+[0-9]+@") { # tried before:
taipei\.elmit\.net") {
# (change
example.net to your domainname or skip the stuff
after the "@")
####if ( !enum_query("e164.arpa.") ) {
#### enum_query("nrenum.net.");
#### };
if (enum_query()) {
t_relay();
exit;
}
};
I tried to add some log statements, but I never see them in
/var/log/messages either.
Below is the ngrep output. It seems that it does not go anywhere in
route()
Any ideas how to track it down?
bye
Ronald
Content-Type: application/sdp.
User-Agent: eyeBeam release 1005g stamp 32576.
Content-Length: 809.
.
v=0.
o=- 2 2 IN IP4 192.168.250.108.
s=CounterPath eyeBeam 1.5.
c=IN IP4 192.168.250.108.
t=0 0.
m=audio 48702 RTP/AVP 107 100 106 6 0 105 18 3 5 101.
a=alt:1 2 : O5/HQNzE iLXVkGqH 5.32.86.166 48702.
a=alt:2 1 : ok7vH1EF jO6dCAlm 192.168.250.108 48702.
a=fmtp:18 annexb=yes.
a=fmtp:101 0-15.
a=rtpmap:107 BV32/16000.
a=rtpmap:100 SPEEX/16000.
a=rtpmap:106 SPEEX-FEC/16000.
a=rtpmap:105 SPEEX-FEC/8000.
a=rtpmap:18 G729/8000.
a=rtpmap:101 telephone-event/8000.
a=sendrecv.
a=x-rtp-session-id:E4797B0FC1A140648811BD63523C3B70.
m=video 40488 RTP/AVP 125.
a=alt:1 2 : urVBRqXw O9lI2kQp 5.32.86.166 40488.
a=alt:2 1 : LCXVKz4X nxDzxq4V 192.168.250.108 40488.
a=fmtp:125 profile-level-id=42e015; max-br=4000; max-mbps=19800.
a=rtpmap:125 H264/90000.
a=sendrecv.
a=x-rtp-session-id:B8E2EE0EA3944D6DA47E5D98AABCD52B.
#
U 2006/09/28 16:57:11.567171 192.168.250.41:5060 -> 192.168.250.108:40430
SIP/2.0 404 Not Found.
Via: SIP/2.0/UDP
192.168.250.108:40430;branch=z9hG4bK-d87543-0c396723de34cf5a-1--d87543-;rport=40430.
To:
"00886228357765"<sip:00886228357765@192.168.250.41>;tag=329cfeaa6ded039da25ff8cbb8668bd2.e6c9.
From: "Ronald-taipei @ video "<sip:7311@192.168.250.41>;tag=3f7a5072.
Call-ID: YmQ0YzNiYmU4MDJjMjQ4YzAyZjJjMjZiYzA3ZGYxYTk..
CSeq: 1 INVITE.
Server: OpenSer (1.1.0-notls (x86_64/linux)).
Content-Length: 0.
Warning: 392 192.168.250.41:5060 "Noisy feedback tells: pid=11197
req_src_ip=192.168.250.108 req_src_port=40430
in_uri=sip:00886228357765@192.168.250.41
out_uri=sip:+886228357765@192.168.250.41 via_cnt==1".
.
#
U 2006/09/28 16:57:11.569258 192.168.250.108:40430 -> 192.168.250.41:5060
ACK sip:00886228357765@192.168.250.41 SIP/2.0.
Via: SIP/2.0/UDP
192.168.250.108:40430;branch=z9hG4bK-d87543-0c396723de34cf5a-1--d87543-;rport.
To:
"00886228357765"<sip:00886228357765@192.168.250.41>;tag=329cfeaa6ded039da25ff8cbb8668bd2.e6c9.
From: "Ronald-taipei @ video "<sip:7311@192.168.250.41>;tag=3f7a5072.
Call-ID: YmQ0YzNiYmU4MDJjMjQ4YzAyZjJjMjZiYzA3ZGYxYTk..
CSeq: 1 ACK.
Content-Length: 0.
.
_______________________________________________
Users mailing list
Users(a)openser.org
http://openser.org/cgi-bin/mailman/listinfo/users
---
avast! Antivirus: Inbound message clean.
Virus Database (VPS): 0639-3, 2006/09/27
Tested on: 2006/9/28 ¤U¤È 05:07:49
avast! - copyright (c) 1988-2006 ALWIL Software.
http://www.avast.com
--
Ronald Wiplinger (CEO of ELMIT)
http://www.elmit.com http://voip.elmit.com http://e-paper.elmit.com
Tel. (M) +886.939.775.516 (O) +886.2.2835.7765 (ENUM) or FWD 511208
- I'm a SpamCon Foundation Member, #694, Verify it at
http://www.spamcon.org
PS: Spam prevention!
Our system is protected with a spam prevention program.
If you send us an e-mail, our system will send you a confirmation
message back. Just reply to this confirmation message please.
After receiving this confirmation message, our system will send the hold
message (one) and all future messages (after the received confirmation
message) to me without asking you again.