[Serusers] Nat incoming call

Barry Murphy barry at unix.co.nz
Sun Apr 10 07:13:30 CEST 2005


Ok I found the problem, i wasn;t including the module group.so, thats why i
receievd the below error.
 
This is my issue now:
budgetone with stun server set as fwd's , this phone works fine
All others behind nat are broken, cant even dial to the asterisk system.
If I use a live ip on a phone it works phone.
 
All i want to do is allow nat users to receive calls, i seem to be heading
round in circles.
 
My personal config allowed for nat users to call the asterisk pabx & live ip
phones, now the cfg 
from onsip allows only calls between live ip users.
 
When trying to call from my cisco 7940 which is behind nat i receive this
via ngrep:
 
U 202.150.105.150:5060 -> 203.167.185.23:50268
  SIP/2.0 401 Unauthorized..Via: SIP/2.0/UDP
10.23.19.154:5060;branch=z9hG4bK3ab93baf;rport=50268;received=203.167.185.23
.
  .From: sip:64273040757 at voip.fast.co.nz..To:
sip:64273040757 at voip.fast.co.nz;tag=18deaabfa18843cd727e04c65fce5192.da71..C
  all-ID: 0011219c-48830002-1e661ee5-7150bc32 at 10.23.19.154..CSeq: 106
REGISTER..WWW-Authenticate: Digest realm="voip.fast.
  co.nz", nonce="4258b6d3ce0fecbbc523351ad0735ad555100a30"..Server: Sip
EXpress router (0.9.1 (i386/freebsd))..Content-Len
  gth: 0..Warning: 392 202.150.105.150:5060 "Noisy feedback tells:  pid=5699
req_src_ip=203.167.185.23 req_src_port=50268
  in_uri=sip:voip.fast.co.nz out_uri=sip:voip.fast.co.nz via_cnt==1"....
#
U 202.150.105.150:5060 -> 203.167.185.23:5060
  SIP/2.0 200 OK..Via: SIP/2.0/UDP
10.23.19.154:5060;received=203.167.185.23;branch=z9hG4bK0d4fa640..Record-Rou
te: <sip:20
  2.150.105.150;ftag=0011219c488300030377e0ea-4b9af92f;lr=on>..From: "Barry
Murphy" <sip:64273040757 at voip.fast.co.nz>;tag=
  0011219c488300030377e0ea-4b9af92f..To:
<sip:04 at voip.fast.co.nz>;tag=as77998ba9..Call-ID:
0011219c-48830005-00bda4e9-5f27
  bdc3 at 10.23.19.154..CSeq: 101 INVITE..User-Agent: Asterisk PBX..Allow:
INVITE, ACK, CANCEL, OPTIONS, BYE, REFER..Contact:
   <sip:04 at 202.150.105.150:5070>..Content-Type:
application/sdp..Content-Length: 222....v=0..o=root 79264 79264 IN IP4 202
  .150.105.150..s=session..c=IN IP4 202.150.105.150..t=0 0..m=audio 19330
RTP/AVP 0 101..a=rtpmap:0 PCMU/8000..a=rtpmap:10
  1 telephone-event/8000..a=fmtp:101 0-16..a=silenceSupp:off - - - -..
#
U 203.167.185.23:50268 -> 202.150.105.150:5060
  INVITE sip:04 at voip.fast.co.nz SIP/2.0..Via: SIP/2.0/UDP
10.23.19.154:5060;branch=z9hG4bK0d4fa640..From: "Barry Murphy" <
 
sip:64273040757 at voip.fast.co.nz>;tag=0011219c488300030377e0ea-4b9af92f..To:
<sip:04 at voip.fast.co.nz>..Call-ID: 0011219c-
  48830005-00bda4e9-5f27bdc3 at 10.23.19.154..Date: Sun, 10 Apr 2005 05:12:06
GMT..CSeq: 101 INVITE..User-Agent: CSCO/7..Cont
  act: <sip:64273040757 at 10.23.19.154:5060>..Expires: 180..Content-Type:
application/sdp..Content-Length: 247..Accept: appl
  ication/sdp....v=0..o=Cisco-SIPUA 26488 12465 IN IP4 10.23.19.154..s=SIP
Call..c=IN IP4 10.23.19.154..t=0 0..m=audio 235
  72 RTP/AVP 0 8 18 101..a=rtpmap:0 PCMU/8000..a=rtpmap:8
PCMA/8000..a=rtpmap:18 G729/8000..a=rtpmap:101 telephone-event/8
  000..a=fmtp:101 0-15..
#
U 202.150.105.150:5060 -> 203.167.185.23:5060
  SIP/2.0 200 OK..Via: SIP/2.0/UDP
10.23.19.154:5060;received=203.167.185.23;branch=z9hG4bK0d4fa640..Record-Rou
te: <sip:20
  2.150.105.150;ftag=0011219c488300030377e0ea-4b9af92f;lr=on>..From: "Barry
Murphy" <sip:64273040757 at voip.fast.co.nz>;tag=
  0011219c488300030377e0ea-4b9af92f..To:
<sip:04 at voip.fast.co.nz>;tag=as77998ba9..Call-ID:
0011219c-48830005-00bda4e9-5f27
  bdc3 at 10.23.19.154..CSeq: 101 INVITE..User-Agent: Asterisk PBX..Allow:
INVITE, ACK, CANCEL, OPTIONS, BYE, REFER..Contact:
   <sip:04 at 202.150.105.150:5070>..Content-Type:
application/sdp..Content-Length: 222....v=0..o=root 79264 79264 IN IP4 202
  .150.105.150..s=session..c=IN IP4 202.150.105.150..t=0 0..m=audio 19330
RTP/AVP 0 101..a=rtpmap:0 PCMU/8000..a=rtpmap:10
  1 telephone-event/8000..a=fmtp:101 0-16..a=silenceSupp:off - - - -..
#
U 202.150.105.150:5060 -> 203.167.185.23:5060
  SIP/2.0 200 OK..Via: SIP/2.0/UDP
10.23.19.154:5060;received=203.167.185.23;branch=z9hG4bK0d4fa640..Record-Rou
te: <sip:20
  2.150.105.150;ftag=0011219c488300030377e0ea-4b9af92f;lr=on>..From: "Barry
Murphy" <sip:64273040757 at voip.fast.co.nz>;tag=
  0011219c488300030377e0ea-4b9af92f..To:
<sip:04 at voip.fast.co.nz>;tag=as77998ba9..Call-ID:
0011219c-48830005-00bda4e9-5f27
  bdc3 at 10.23.19.154..CSeq: 101 INVITE..User-Agent: Asterisk PBX..Allow:
INVITE, ACK, CANCEL, OPTIONS, BYE, REFER..Contact:
   <sip:04 at 202.150.105.150:5070>..Content-Type:
application/sdp..Content-Length: 222....v=0..o=root 79264 79264 IN IP4 202
  .150.105.150..s=session..c=IN IP4 202.150.105.150..t=0 0..m=audio 19330
RTP/AVP 0 101..a=rtpmap:0 PCMU/8000..a=rtpmap:10
  1 telephone-event/8000..a=fmtp:101 0-16..a=silenceSupp:off - - - -..
#
U 202.150.105.150:5060 -> 203.167.185.23:5060
  SIP/2.0 200 OK..Via: SIP/2.0/UDP
10.23.19.154:5060;received=203.167.185.23;branch=z9hG4bK0d4fa640..Record-Rou
te: <sip:20
  2.150.105.150;ftag=0011219c488300030377e0ea-4b9af92f;lr=on>..From: "Barry
Murphy" <sip:64273040757 at voip.fast.co.nz>;tag=
  0011219c488300030377e0ea-4b9af92f..To:
<sip:04 at voip.fast.co.nz>;tag=as77998ba9..Call-ID:
0011219c-48830005-00bda4e9-5f27
  bdc3 at 10.23.19.154..CSeq: 101 INVITE..User-Agent: Asterisk PBX..Allow:
INVITE, ACK, CANCEL, OPTIONS, BYE, REFER..Contact:
   <sip:04 at 202.150.105.150:5070>..Content-Type:
application/sdp..Content-Length: 222....v=0..o=root 79264 79264 IN IP4 202
  .150.105.150..s=session..c=IN IP4 202.150.105.150..t=0 0..m=audio 19330
RTP/AVP 0 101..a=rtpmap:0 PCMU/8000..a=rtpmap:10
  1 telephone-event/8000..a=fmtp:101 0-16..a=silenceSupp:off - - - -..
#
U 10.23.14.16:5060 -> 202.150.105.150:5060
  ..
#
U 203.167.185.23:50268 -> 202.150.105.150:5060
  INVITE sip:04 at voip.fast.co.nz SIP/2.0..Via: SIP/2.0/UDP
10.23.19.154:5060;branch=z9hG4bK0d4fa640..From: "Barry Murphy" <
 
sip:64273040757 at voip.fast.co.nz>;tag=0011219c488300030377e0ea-4b9af92f..To:
<sip:04 at voip.fast.co.nz>..Call-ID: 0011219c-
  48830005-00bda4e9-5f27bdc3 at 10.23.19.154..Date: Sun, 10 Apr 2005 05:12:06
GMT..CSeq: 101 INVITE..User-Agent: CSCO/7..Cont
  act: <sip:64273040757 at 10.23.19.154:5060>..Expires: 180..Content-Type:
application/sdp..Content-Length: 247..Accept: appl
  ication/sdp....v=0..o=Cisco-SIPUA 26488 12465 IN IP4 10.23.19.154..s=SIP
Call..c=IN IP4 10.23.19.154..t=0 0..m=audio 235
  72 RTP/AVP 0 8 18 101..a=rtpmap:0 PCMU/8000..a=rtpmap:8
PCMA/8000..a=rtpmap:18 G729/8000..a=rtpmap:101 telephone-event/8
  000..a=fmtp:101 0-15..
#
U 202.150.105.150:5060 -> 203.167.185.23:5060
  SIP/2.0 200 OK..Via: SIP/2.0/UDP
10.23.19.154:5060;received=203.167.185.23;branch=z9hG4bK0d4fa640..Record-Rou
te: <sip:20
  2.150.105.150;ftag=0011219c488300030377e0ea-4b9af92f;lr=on>..From: "Barry
Murphy" <sip:64273040757 at voip.fast.co.nz>;tag=
  0011219c488300030377e0ea-4b9af92f..To:
<sip:04 at voip.fast.co.nz>;tag=as77998ba9..Call-ID:
0011219c-48830005-00bda4e9-5f27
  bdc3 at 10.23.19.154..CSeq: 101 INVITE..User-Agent: Asterisk PBX..Allow:
INVITE, ACK, CANCEL, OPTIONS, BYE, REFER..Contact:
   <sip:04 at 202.150.105.150:5070>..Content-Type:
application/sdp..Content-Length: 222....v=0..o=root 79264 79264 IN IP4 202
  .150.105.150..s=session..c=IN IP4 202.150.105.150..t=0 0..m=audio 19330
RTP/AVP 0 101..a=rtpmap:0 PCMU/8000..a=rtpmap:10
  1 telephone-event/8000..a=fmtp:101 0-16..a=silenceSupp:off - - - -..
#
U 202.150.105.150:5060 -> 203.167.185.23:5060
  SIP/2.0 200 OK..Via: SIP/2.0/UDP
10.23.19.154:5060;received=203.167.185.23;branch=z9hG4bK0d4fa640..Record-Rou
te: <sip:20
  2.150.105.150;ftag=0011219c488300030377e0ea-4b9af92f;lr=on>..From: "Barry
Murphy" <sip:64273040757 at voip.fast.co.nz>;tag=
  0011219c488300030377e0ea-4b9af92f..To:
<sip:04 at voip.fast.co.nz>;tag=as77998ba9..Call-ID:
0011219c-48830005-00bda4e9-5f27
  bdc3 at 10.23.19.154..CSeq: 101 INVITE..User-Agent: Asterisk PBX..Allow:
INVITE, ACK, CANCEL, OPTIONS, BYE, REFER..Contact:
   <sip:04 at 202.150.105.150:5070>..Content-Type:
application/sdp..Content-Length: 222....v=0..o=root 79264 79264 IN IP4 202
  .150.105.150..s=session..c=IN IP4 202.150.105.150..t=0 0..m=audio 19330
RTP/AVP 0 101..a=rtpmap:0 PCMU/8000..a=rtpmap:10
  1 telephone-event/8000..a=fmtp:101 0-16..a=silenceSupp:off - - - -..
^Cexit
608 received, 0 dropped

 


  _____  

From: serusers-bounces at iptel.org [mailto:serusers-bounces at lists.iptel.org] On
Behalf Of Barry Murphy
Sent: Sunday, 10 April 2005 4:50 p.m.
To: 'Java Rockx'
Cc: serusers at lists.iptel.org
Subject: RE: [Serusers] Nat incoming call


Ok, so ser worked for a few minutes in the following way:
 
Me on live IP calling a nat user, their phone would ring, however me the A
party got no ring, after 20 seconds I received NU tone.
NAT user is able to call me with no problem.
Then things just died and now when I run ser I get the following:
 
ser at max:/home/icepick$ ser -Edddddd
 0(5134) read 244542925 from /dev/urandom
 0(5134) seeding PRNG with 1357656199
 0(5134) test random number 985922484
ERROR: bad config file (1 errors)
 
ser.cfg (as per onsip.org, exact copy of the rtpproxy.cfg with 2 additional
fields for linking asterisk)
 
debug=3
fork=yes
log_stderror=no
dns=no
rev_dns=no
fifo="/home/ser/ser_fifo"
fifo_db_url="mysql://asterisk:4ster1skrawk5@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/nathelper.so"
loadmodule "/usr/local/lib/ser/modules/textops.so"
loadmodule "/usr/local/lib/ser/modules/uri_db.so"
loadmodule "/usr/local/lib/ser/modules/uri.so"
loadmodule "/usr/local/lib/ser/modules/domain.so"
loadmodule "/usr/local/lib/ser/modules/acc.so"
 
modparam("acc|auth_db|usrloc|uri_db", "db_url",
"mysql://ser:ser@localhost/ser")
 
modparam("auth_db", "calculate_ha1", 1)
modparam("auth_db", "password_column", "password")
 
modparam("acc", "log_level", 2)
modparam("acc", "log_flag", 1 )
modparam("acc", "log_missed_flag", 2)
modparam("acc", "log_fmt", "cdfimorstup") modparam("acc",
"failed_transactions", 1) modparam("acc", "report_cancels", 1)
modparam("acc", "db_flag", 1) modparam("acc", "db_missed_flag", 2)
 
modparam("nathelper", "natping_interval", 30) 
modparam("nathelper", "ping_nated_only", 1)   
modparam("nathelper", "rtpproxy_sock", "unix:/var/run/rtpproxy.sock")
 
modparam("usrloc", "db_mode", 2)
 
modparam("registrar", "nat_flag", 6)
 
modparam("rr", "enable_full_lr", 1)
 
alias="voip.fast.co.nz"
alias=""
 
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();
 };
 
 if (method=="BYE" || method=="CANCEL") {
  unforce_rtp_proxy();
 } 
 
 # -----------------------------------------------------------------
 # Loose Route Section
 # -----------------------------------------------------------------
 if (loose_route()) {
 
  if (has_totag() && method=="INVITE") {
   if (nat_uac_test("19")) {
    setflag(6);
    force_rport();
    fix_nated_contact();
   };
                    force_rtp_proxy("l");
  };
    route(1);
  break;
 };
        # -----------------------------------------------------------------
        # send out 0 prefix to asterisk for IVR options
        # -----------------------------------------------------------------
        if (uri=~"^sip:0[1-9]*@voip.fast.co.nz") {
                setflag(1);
                rewritehostport("202.150.105.150:5070");
                log("free call");
          if (!t_relay()) {
                       sl_reply_error();
               };
                break;
        }
 
        # -----------------------------------------------------------------
        # send out 00 prefix to wholesale voip.fast.co.nz termination
        # -----------------------------------------------------------------
 if (uri=~"^sip:00[0-9].*@voip.fast.co.nz") {
         if (!is_user_in("From", "ld")) {
                 sl_send_reply("403", "Payment required");
               break;
 
               };
               setflag(1);
               rewritehostport("voip.fast.co.nz:5070");
               if (!t_relay()) {
                       sl_reply_error();
               };
               break;
        };
 


 # -----------------------------------------------------------------
 # Call Type Processing Section
 # -----------------------------------------------------------------
 if (uri==myself) {
  if (method=="INVITE") {
   route(3);
   break;
  } else  if (method=="REGISTER") {
   route(2);
   break;
  };
 
  if (!lookup("location")) {
   sl_send_reply("404", "User Not Found");
   break;
  };
 
  route(1);
 };
}
 
route[1] {
 
 # -----------------------------------------------------------------
 # Default Message Handler
 # -----------------------------------------------------------------
 
 t_on_reply("1");
 
 if (!t_relay()) {
  if (method=="INVITE" && isflagset(6)) {
    unforce_rtp_proxy();
  };
  sl_reply_error();
 };
}
 
route[2] {
 
 # -----------------------------------------------------------------
 # REGISTER Message Handler
 # ----------------------------------------------------------------
 
 if (!search("^Contact: \*") && nat_uac_test("19")) {
  setflag(6);
  fix_nated_register();
  force_rport();
 };
 
 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 (nat_uac_test("19")) {
  setflag(6);
     }
 
 if (!lookup("location")) {
  sl_send_reply("404", "User Not Found");
  break;
 };
 
 if (!proxy_authorize("voip.fast.co.nz","subscriber")) {
  proxy_challenge("voip.fast.co.nz","0");
  break;
 } else if (!check_from()) {
  sl_send_reply("403", "Use From=ID");
  break;
 };
 
     consume_credentials();
 
 if (isflagset(6)) {
  force_rport();
  fix_nated_contact();
  force_rtp_proxy();
 };
 
 t_on_reply("1");
 
 if (!t_relay()) {
  if(isflagset(6)) {
   unforce_rtp_proxy();
  }
  sl_reply_error();
 };
}
 
onreply_route[1] {
 
 if (isflagset(6) && status=~"(180)|(183)|2[0-9][0-9]") {
   if (!search("^Content-Length:\ 0")) {
   force_rtp_proxy();
  };
 } else if (nat_uac_test("1")) {
  fix_nated_contact();
 };
}
 
 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20050410/ad5c2e28/attachment.htm>


More information about the sr-users mailing list