[Serusers] ROUTE to ANALOG FXO does not work

Ozan Blotter cosmocid at ispro.net.tr
Tue May 31 16:45:45 CEST 2005


What may be wrong with this ?

interface: eth0 (192.168.1.0/255.255.255.0)
filter: ip and ( port 5060 )
match: .
#
U 192.168.1.35:5060 -> 192.168.1.9:5060
  REGISTER sip:192.168.1.9:5060 SIP/2.0..From: <sip:201 at 192.168.1.9:5060> ;ta
  g=3a4fc965-c1a5a2e..To: <sip:201 at 192.168.1.9>..Call-ID: c0a80123-13c4-3a4fc
  962-1f6-5973..CSeq: 127 REGISTER..Via: SIP/2.0/UDP 192.168.1.35:5060 ;branc
  h=z9hG4bK-3a4fe27e-621634-49b0..Max-Forwards: 70..Contact: <sip:201 at 192.168
  .1.35:5060>..Expires: 60..Authorization: Digest username="201", realm="192.
  168.1.9", nonce="429c75d542b41a31c953e92a094347354d6ad422", uri="sip:192.16
  8.1.9:5060", response="2aa4ee1d66adff835b9de526ec1511a8", algorithm=MD5..Co
  ntent-Length:0....                                                         
#
U 192.168.1.9:5060 -> 192.168.1.35:5060
  SIP/2.0 100 Trying..From: <sip:201 at 192.168.1.9:5060> ;tag=3a4fc965-c1a5a2e.
  .To: <sip:201 at 192.168.1.9>..Call-ID: c0a80123-13c4-3a4fc962-1f6-5973..CSeq:
   127 REGISTER..Via: SIP/2.0/UDP 192.168.1.35:5060 ;branch=z9hG4bK-3a4fe27e-
  621634-49b0..Server: Sip EXpress router (0.9.2 (i386/linux))..Content-Lengt
  h: 0..Warning: 392 192.168.1.9:5060 "Noisy feedback tells:  pid=4355 req_sr
  c_ip=192.168.1.35 req_src_port=5060 in_uri=sip:192.168.1.9:5060 out_uri=sip
  :192.168.1.9:5060 via_cnt==1"....                                          
#
U 192.168.1.9:5060 -> 192.168.1.35:5060
  SIP/2.0 401 Unauthorized..From: <sip:201 at 192.168.1.9:5060> ;tag=3a4fc965-c1
  a5a2e..To: <sip:201 at 192.168.1.9>;tag=e35af7ff49e736750e6bc8e19f478153.5fa6.
  .Call-ID: c0a80123-13c4-3a4fc962-1f6-5973..CSeq: 127 REGISTER..Via: SIP/2.0
  /UDP 192.168.1.35:5060 ;branch=z9hG4bK-3a4fe27e-621634-49b0..WWW-Authentica
  te: Digest realm="192.168.1.9", nonce="429c7707dd0067d0c1c7197a673469b18a56
  38ba", stale=true..Server: Sip EXpress router (0.9.2 (i386/linux))..Content
  -Length: 0..Warning: 392 192.168.1.9:5060 "Noisy feedback tells:  pid=4355 
  req_src_ip=192.168.1.35 req_src_port=5060 in_uri=sip:192.168.1.9:5060 out_u
  ri=sip:192.168.1.9:5060 via_cnt==1"....                                    
#
U 192.168.1.35:5060 -> 192.168.1.9:5060
  REGISTER sip:192.168.1.9:5060 SIP/2.0..From: <sip:201 at 192.168.1.9:5060> ;ta
  g=3a4fc965-c1a5a2e..To: <sip:201 at 192.168.1.9>..Call-ID: c0a80123-13c4-3a4fc
  962-1f6-5973..CSeq: 128 REGISTER..Via: SIP/2.0/UDP 192.168.1.35:5060 ;branc
  h=z9hG4bK-3a4fe27f-621a24-3029..Max-Forwards: 70..Contact: <sip:201 at 192.168
  .1.35:5060>..Expires: 60..Authorization: Digest username="201", realm="192.
  168.1.9", nonce="429c7707dd0067d0c1c7197a673469b18a5638ba", uri="sip:192.16
  8.1.9:5060", response="e297c2b9f9a72418140486b9a5d0225e", algorithm=MD5..Co
  ntent-Length:0....                                                         
#
U 192.168.1.9:5060 -> 192.168.1.35:5060
  SIP/2.0 100 Trying..From: <sip:201 at 192.168.1.9:5060> ;tag=3a4fc965-c1a5a2e.
  .To: <sip:201 at 192.168.1.9>..Call-ID: c0a80123-13c4-3a4fc962-1f6-5973..CSeq:
   128 REGISTER..Via: SIP/2.0/UDP 192.168.1.35:5060 ;branch=z9hG4bK-3a4fe27f-
  621a24-3029..Server: Sip EXpress router (0.9.2 (i386/linux))..Content-Lengt
  h: 0..Warning: 392 192.168.1.9:5060 "Noisy feedback tells:  pid=4354 req_sr
  c_ip=192.168.1.35 req_src_port=5060 in_uri=sip:192.168.1.9:5060 out_uri=sip
  :192.168.1.9:5060 via_cnt==1"....                                          
#
U 192.168.1.9:5060 -> 192.168.1.35:5060
  SIP/2.0 200 OK..From: <sip:201 at 192.168.1.9:5060> ;tag=3a4fc965-c1a5a2e..To:
   <sip:201 at 192.168.1.9>;tag=e35af7ff49e736750e6bc8e19f478153.95cd..Call-ID: 
  c0a80123-13c4-3a4fc962-1f6-5973..CSeq: 128 REGISTER..Via: SIP/2.0/UDP 192.1
  68.1.35:5060 ;branch=z9hG4bK-3a4fe27f-621a24-3029..Contact: <sip:201 at 192.16
  8.1.35:5060>;expires=60..Server: Sip EXpress router (0.9.2 (i386/linux))..C
  ontent-Length: 0..Warning: 392 192.168.1.9:5060 "Noisy feedback tells:  pid
  =4354 req_src_ip=192.168.1.35 req_src_port=5060 in_uri=sip:192.168.1.9:5060
   out_uri=sip:192.168.1.9:5060 via_cnt==1"....                              

[4]+  Stopped                 ngrep . port 5060
]0;root at localhost:/usr/local/etc/ser[root at 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: 0xf50b60f8
d_ll {
    n    : 3
    first: 0xf50b8248
    last : 0xf50b8108
}

...Record(0xf50b8248)...
domain: 'location'
aor   : '54321'
~~~Contact(0xf50b82a8)~~~
domain    : 'location'
aor       : '54321'
Contact   : 'sip:54321 at 192.168.1.201:5060'
Expires   : 58
q         : 
Call-ID   : '1386D1B912DA1212 at 192.168.1.201'
CSeq      : 967
User-Agent: 'Unknown'
received  : ''
State     : CS_DIRTY
Flags     : 0
next      : (nil)
prev      : (nil)
~~~/Contact~~~~
.../Record...
...Record(0xf50b8388)...
domain: 'location'
aor   : '12345'
~~~Contact(0xf50b83e8)~~~
domain    : 'location'
aor       : '12345'
Contact   : 'sip:12345 at 192.168.1.200:5060'
Expires   : 35
q         : 
Call-ID   : '1442D1B912D91212 at 192.168.1.200'
CSeq      : 965
User-Agent: 'Unknown'
received  : ''
State     : CS_DIRTY
Flags     : 0
next      : (nil)
prev      : (nil)
~~~/Contact~~~~
.../Record...
...Record(0xf50b8108)...
domain: 'location'
aor   : '201'
~~~Contact(0xf50bbaa8)~~~
domain    : 'location'
aor       : '201'
Contact   : 'sip:201 at 192.168.1.35:5060'
Expires   : 45
q         : 
Call-ID   : 'c0a80123-13c4-3a4fc962-1f6-5973'
CSeq      : 128
User-Agent: 'Unknown'
received  : ''
State     : CS_DIRTY
Flags     : 0
next      : (nil)
prev      : (nil)
~~~/Contact~~~~
.../Record...

---/Domain---
---Domain---
name : 'aliases'
size : 512
table: 0xf50b4068
d_ll {
    n    : 0
    first: (nil)
    last : (nil)
}
---/Domain---
===/Domain list===
]0;root at localhost:/usr/local/etc/ser[root at localhost ser]# cat. ser.cfg
debug=3
fork=yes
log_stderror=no

listen=192.168.1.9
port=5060
children=4

dns=no
rev_dns=no

fifo="/tmp/ser_fifo"
fifo_db_url="mysql://ser:heslo@localhost/ser"

loadmodule "/usr/local/lib/ser/modules/mysql.so"
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"
loadmodule "/usr/local/lib/ser/modules/auth.so"
loadmodule "/usr/local/lib/ser/modules/auth_db.so"
loadmodule "/usr/local/lib/ser/modules/uri_db.so"

modparam("auth_db|uri_db|usrloc", "db_url", "mysql://ser:heslo@localhost/ser")
modparam("auth_db", "calculate_ha1", 1)
modparam("auth_db", "password_column", "password")
modparam("usrloc", "db_mode", 2)
modparam("rr", "enable_full_lr", 1)

route {

 # -----------------------------------------------------------------
 # Sanity Check Section
 # -----------------------------------------------------------------
 if (!mf_process_maxfwd_header("10")) {
  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 ((method=="BYE" || method=="CANCEL") && !(uri=~"^sip:833*@*")) {
  setflag(1);
 }

 if (loose_route()) {
  route(1);
  break;
 };

 # -----------------------------------------------------------------
 # Call Type Processing Section
 # -----------------------------------------------------------------
 if (uri!=myself) {
  route(1);
  break;
 };

 if (uri==myself) {
  if (method=="INVITE") {
   route(3);
   break;
  } else  if (method=="REGISTER") {
   route(2);
   break;
  };

  lookup("aliases");
  if (uri!=myself) {
   route(1);
   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
 # ----------------------------------------------------------------
 sl_send_reply("100", "Trying");
 

 if (!www_authorize("","subscriber")) {
  www_challenge("","0");
  break;
 };

 if (!check_to()) {
  sl_send_reply("401", "Unauthorized");
  break;
 };

 consume_credentials();

 if (!save("location")) {
  sl_reply_error();
 };
}

route[3] {
 # -----------------------------------------------------------------
 # INVITE Message Handler
 # -----------------------------------------------------------------
 if (!proxy_authorize("localhost","subscriber")) {
  proxy_challenge("localhost","0");
  break;
 }

 if (uri=~"^sip:053[0-9]*@") {
  # prefix("201");
  rewritehostport("192.168.1.35:5060");
  t_relay_to_udp("192.168.1.35","5060");
  break;
 }
  
 else if (!check_from()) {
  sl_send_reply("403", "Use From=ID");
  break;
 };

  consume_credentials();

 lookup("aliases");
 if (uri!=myself) {
  route(1);
  break;
 };

 if (!lookup("location")) {
  sl_send_reply("404", "User Not Found");
  break;
 };

 route(1);
}]0;root at localhost:/usr/local/etc/ser[root at localhost ser]# 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20050531/0a996b36/attachment.htm>


More information about the sr-users mailing list