Dear Friends,
This is fifth or tenth times writing to list but
still no way :(
REGISTERED USERS (12345 and 54321 are ATAs, 201 is Analog FXO's Port
0)
[root@localhost ser]# serctl ul show
Dumping all contacts may take
long: are you sure you want to proceed? [Y|N] y
===Domain
list===
---Domain---
name : 'location'
size : 512
table:
0xf50cb0f8
d_ll {
n :
3
first: 0xf50cd108
last :
0xf50cd388
}
...Record(0xf50cd108)...
domain: 'location'
aor :
'12345'
~~~Contact(0xf50cd168)~~~
domain :
'location'
aor :
'12345'
Contact :
'sip:12345@192.168.1.200:5060'
Expires :
33
q :
Call-ID
:
'410D1B912D91111@192.168.1.200'CSeq
: 7962
User-Agent: 'Unknown'
received :
''
State : CS_NEW
Flags :
0
next :
(nil)
prev :
(nil)
~~~/Contact~~~~
.../Record...
...Record(0xf50cd248)...
domain:
'location'
aor :
'54321'
~~~Contact(0xf50cd2a8)~~~
domain :
'location'
aor :
'54321'
Contact :
'sip:54321@192.168.1.201:5060'
Expires :
34
q :
Call-ID
:
'379D1B912DA1111@192.168.1.201'CSeq
: 7955
User-Agent: 'Unknown'
received :
''
State : CS_NEW
Flags :
0
next :
(nil)
prev :
(nil)
~~~/Contact~~~~
.../Record...
...Record(0xf50cd388)...
domain:
'location'
aor :
'201'
~~~Contact(0xf50cd3e8)~~~
domain :
'location'
aor :
'201'
Contact :
'sip:201@192.168.1.35:5060'
Expires :
37
q :
Call-ID
: 'c0a80123-13c4-3a570cf4-1f6-5973'
CSeq :
184
User-Agent: 'Unknown'
received :
''
State : CS_NEW
Flags :
0
next :
(nil)
prev :
(nil)
~~~/Contact~~~~
.../Record...
---/Domain---
---Domain---
name : 'aliases'
size : 512
table:
0xf50c9068
d_ll {
n :
0
first: (nil)
last :
(nil)
}
---/Domain---
===/Domain list===
(Basic SER.CFG , I want to it to route any 053XXXXXXXX Calls to
192.168.1.35 [Analog FXO Gateway] by adding 201 Prefix so it dials a Cellular.
Nearly same thing worked for Brekeke's Ondo SIP Proxy but why id does not work
in SER)
debug=3
fork=yes
log_stderror=no
listen=192.168.1.10
# put your server IP address here
port=5060
children=4
dns=no
rev_dns=no
fifo="/tmp/ser_fifo"
loadmodule "/usr/local/lib/ser/modules/sl.so"
loadmodule
"/usr/local/lib/ser/modules/tm.so"
loadmodule
"/usr/local/lib/ser/modules/rr.so"
loadmodule
"/usr/local/lib/ser/modules/maxfwd.so"
loadmodule
"/usr/local/lib/ser/modules/usrloc.so"
loadmodule
"/usr/local/lib/ser/modules/registrar.so"
modparam("usrloc", "db_mode", 0)
modparam("rr",
"enable_full_lr", 1)
route {
#
------------------------------------------------------------------------
# Sanity Check Section
#
------------------------------------------------------------------------
if (!mf_process_maxfwd_header("12"))
{
sl_send_reply("483", "Too Many
Hops");
break;
};
if (msg:len > max_len)
{
sl_send_reply("513", "Message
Overflow");
break;
};
#
------------------------------------------------------------------------
# Record Route Section
#
------------------------------------------------------------------------
if (method!="REGISTER")
{
record_route();
};
#
------------------------------------------------------------------------
# Loose Route Section
#
------------------------------------------------------------------------
if (loose_route())
{
route(1);
break;
};
#
------------------------------------------------------------------------
# Call Type Processing Section
#
------------------------------------------------------------------------
if (uri!=myself)
{
route(1);
break;
};
if (uri==myself) {
if (method=="REGISTER")
{
route(2);
break;
};
lookup("aliases");
if (uri!=myself)
{
route(1);
break;
};
if (uri=~"^sip:053[0-9]*@.*")
{
prefix("201");
rewritehostport
("192.168.1.35:5060");
# forward
("192.168.1.35:5060");
#
t_relay_to_udp("192.168.1.35","5060");
break;
};
if (!lookup("location"))
{
sl_send_reply("404", "User Not
Found");
break;
};
route(1);
};
}
route[1] {
#
------------------------------------------------------------------------
# Default Message Handler
#
------------------------------------------------------------------------
if (!t_relay())
{
sl_reply_error();
};
}
route[2] {
#
------------------------------------------------------------------------
# REGISTER Message Handler
#
------------------------------------------------------------------------
if (!save("location"))
{
sl_reply_error();
};
}
SIPSAK RESULTS (Too Many Hops and User Not Found Errors)
[root@localhost ser]# sipsak -T -s
sip:20105353490056@192.168.1.10
warning: IP extract from warning activated to
be more informational
0: 192.168.1.10 (0.098 ms) SIP/2.0 483 Too Many
Hops
1: 192.168.1.10 (0.244 ms) SIP/2.0 404 User Not
Found
without Contact
header
[root@localhost ser]# sipsak -T -s sip:12345@192.168.1.10
warning:
IP extract from warning activated to be more informational
0: 192.168.1.10
(0.084 ms) SIP/2.0 483 Too Many Hops
1: ?? (13.000 ms) SIP/2.0 200
OK
Contact:
<sip:12345@192.168.1.200:5060>
[root@localhost ser]# sipsak -T -s
sip:54321@192.168.1.10
warning: IP extract from warning activated to be more
informational
0: 192.168.1.10 (0.079 ms) SIP/2.0 483 Too Many Hops
1: ??
(13.020 ms) SIP/2.0 200 OK
Contact: <sip:54321@192.168.1.201:5060>
[root@localhost
ser]#