Re: [OpenSIPS-Users] Problem NAT RTPproxy

2012-04-03 Thread Bogdan-Andrei Iancu
The relevant one should be INVITE leaving you opensips - to see if 
RTPproxy was inserted in the SDP.


Regards,
Bogdan

On 04/02/2012 11:41 PM, magnusadil...@gmail.com wrote:

In ngrep traffic check no active rdp-session-id

but do not know how to solve


#
U +3.135110 IP-ASTERISK:5060 - IP_OPENSIPS:5060
INVITE sip:100@ IP_OPENSIPS SIP/2.0
Via: SIP/2.0/UDP IP-ASTERISK:5060;branch=z9hG4bK3e684698;rport
Max-Forwards: 70
From: 3414741468 sip:TRK00253-001@IP-ASTERISK;tag=as33306c2a
To: sip:100@IP_OPENSIPS
Contact: sip:TRK00253-001@IP-ASTERISK
Call-ID: 46ea6e9819e3583c59479d9304cc2b4f@IP-ASTERISK
CSeq: 102 INVITE
User-Agent: Asterisk PBX 1.6.2.20
Date: Mon, 26 Mar 2012 16:29:17 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 333

v=0
o=root 1324806659 1324806659 IN IP4 IP-ASTERISK
s=Asterisk PBX 1.6.2.20
c=IN IP4 IP-ASTERISK
t=0 0
m=audio 10788 RTP/AVP 0 18 8 3 101
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv



tanks





Bogdan-Andrei Iancu wrote:

Well, you know, one is what we want to do , another we actually get.

I was rather asking if, making a sip capture (with ngrep) you see in 
your call the RTPproxy insertion - check it in traffic, not in script.


Regards,
Bogdan

On 04/02/2012 10:05 PM, magnusadil...@gmail.com wrote:

hi, yes, rtpproxy is active in invite 200

onreply_route[3] {
if ((isflagset(5) || isbflagset(0))  status =~ 
(183)|(2[0-9][0-9])  has_body(application/sdp)) {

if (rtpproxy_answer()) {
log(L_INFO: rtpproxy_answer NAT);
}
}
if (!subst_uri('/(sip:.*);nat=yes/\1/')) {
search_append('Contact:.*sip:[^[:cntrl:]]*', ';nat=yes');
}
exit;
}


But i'm implemented this in invite route

if (is_method(INVITE) {
 if ($si == IP ASTERISK  is_method(INVITE)) {
fix_nated_contact();
fix_nated_sdp(1);
xlog(L_INFO, NAT detected3 PSTN for SIP);
setflag(5);
return;
}
  }

and worked, but I think it is not correct

tansk


Bogdan-Andrei Iancu wrote:

Hi Magnus,

attaching cfg files is useless, as no one will debug the script, 
but we will help you to debug your script.


So, for the non-working case (PSTN to SIP) does your script force 
RTPproxy in INVITE and 200 OK ?


Regards,
Bogdan

On 03/29/2012 01:52 AM, magnusadil...@gmail.com wrote:
I have phones (some behind NAT) connecting to Opensips server an 
Asterisk and an rtpproxy as seen below:


rtpproxy started with
ps -aux | grep rtpproxy
root 15666  0.0  0.0  14472   920 ?Ssl  Mar23   0:05 
./rtpproxy -F -l 189.254.2.19 -s udp:* 7890 -d DBUG LOG_LOCAL3




UAC1 username = 
100Firewall/routerOpensips 
1.7-- RTP PROXYAsterisk 1.6
192.168.1.10192.168.1.1
65.254.63.212  189.254.2.19   190.61.201.89

  external ip dinamic 169.254.2.2


- Calls between UAC are OK (both SIP and RTP).
- Calls UAC for PSTN is OK.
- Did numbers is received in Asterisk, and destination for UAC 
registered in opensips, but no work audio .
(EX User call cellphone for DID 54115368566, call is received in 
asterisk, and destination for user 100, registered in opensips)


--
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Problem NAT RTPproxy

2012-04-02 Thread Bogdan-Andrei Iancu

Hi Magnus,

attaching cfg files is useless, as no one will debug the script, but we 
will help you to debug your script.


So, for the non-working case (PSTN to SIP) does your script force 
RTPproxy in INVITE and 200 OK ?


Regards,
Bogdan

On 03/29/2012 01:52 AM, magnusadil...@gmail.com wrote:
I have phones (some behind NAT) connecting to Opensips server an 
Asterisk and an rtpproxy as seen below:


rtpproxy started with
ps -aux | grep rtpproxy
root 15666  0.0  0.0  14472   920 ?Ssl  Mar23   0:05 
./rtpproxy -F -l 189.254.2.19 -s udp:* 7890 -d DBUG LOG_LOCAL3




UAC1 username = 
100Firewall/routerOpensips 
1.7-- RTP PROXYAsterisk 1.6
192.168.1.10192.168.1.1
65.254.63.212  189.254.2.19   190.61.201.89

  external ip dinamic 169.254.2.2


- Calls between UAC are OK (both SIP and RTP).
- Calls UAC for PSTN is OK.
- Did numbers is received in Asterisk, and destination for UAC 
registered in opensips, but no work audio .
(EX User call cellphone for DID 54115368566, call is received in 
asterisk, and destination for user 100, registered in opensips)





___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



--
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Problem NAT RTPproxy

2012-04-02 Thread magnusadil...@gmail.com

  
  
hi, yes, rtpproxy is active in invite 200

onreply_route[3] {
 if ((isflagset(5) || isbflagset(0))  status =~
"(183)|(2[0-9][0-9])"  has_body("application/sdp")) {
 if (rtpproxy_answer()) {
 log("L_INFO: rtpproxy_answer NAT");
 }
 }
 if (!subst_uri('/(sip:.*);nat=yes/\1/'))
{
 search_append('Contact:.*sip:[^[:cntrl:]]*',
';nat=yes');
 }
 exit;
}


But i'm implemented this in invite route

if (is_method("INVITE") {
 if ($si == "IP ASTERISK"  is_method("INVITE")) {
 fix_nated_contact();
 fix_nated_sdp("1");
 xlog("L_INFO", "NAT detected3 PSTN for SIP");
 setflag(5);
 return;
 }
 }

and
  worked, but I think it
  is not correct

tansk


Bogdan-Andrei Iancu wrote:

  
  Hi Magnus,
  
  attaching cfg files is useless, as no one will debug the script,
  but we will help you to debug your script.
  
  So, for the non-working case (PSTN to SIP) does your script force
  RTPproxy in INVITE and 200 OK ?
  
  Regards,
  Bogdan
  
  On 03/29/2012 01:52 AM, magnusadil...@gmail.com
  wrote:
  

I have phones (some behind NAT) connecting to Opensips server an
Asterisk and an rtpproxy as seen below:

rtpproxy started with
ps -aux | grep rtpproxy
root 15666 0.0 0.0 14472 920 ? Ssl Mar23 0:05
./rtpproxy -F -l 189.254.2.19 -s udp:* 7890 -d DBUG LOG_LOCAL3

 
 
 
UAC1 username =
100Firewall/routerOpensips
1.7-- RTP PROXYAsterisk 1.6
192.168.1.10 192.168.1.1
65.254.63.212 189.254.2.19 190.61.201.89
 external ip dinamic 169.254.2.2


- Calls between UAC are OK (both SIP and RTP).
- Calls UAC for PSTN is OK.
- Did numbers is received in Asterisk, and destination for UAC
registered in opensips, but no work audio .
(EX User call cellphone for DID 54115368566, call is received in
asterisk, and destination for user 100, registered in opensips)

 
 

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

  
  
  
  -- 
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com


  


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Problem NAT RTPproxy

2012-04-02 Thread Bogdan-Andrei Iancu

Well, you know, one is what we want to do , another we actually get.

I was rather asking if, making a sip capture (with ngrep) you see in 
your call the RTPproxy insertion - check it in traffic, not in script.


Regards,
Bogdan

On 04/02/2012 10:05 PM, magnusadil...@gmail.com wrote:

hi, yes, rtpproxy is active in invite 200

onreply_route[3] {
if ((isflagset(5) || isbflagset(0))  status =~ 
(183)|(2[0-9][0-9])  has_body(application/sdp)) {

if (rtpproxy_answer()) {
log(L_INFO: rtpproxy_answer NAT);
}
}
if (!subst_uri('/(sip:.*);nat=yes/\1/')) {
search_append('Contact:.*sip:[^[:cntrl:]]*', ';nat=yes');
}
exit;
}


But i'm implemented this in invite route

if (is_method(INVITE) {
 if ($si == IP ASTERISK  is_method(INVITE)) {
fix_nated_contact();
fix_nated_sdp(1);
xlog(L_INFO, NAT detected3 PSTN for SIP);
setflag(5);
return;
}
  }

and worked, but I think it is not correct

tansk


Bogdan-Andrei Iancu wrote:

Hi Magnus,

attaching cfg files is useless, as no one will debug the script, but 
we will help you to debug your script.


So, for the non-working case (PSTN to SIP) does your script force 
RTPproxy in INVITE and 200 OK ?


Regards,
Bogdan

On 03/29/2012 01:52 AM, magnusadil...@gmail.com wrote:
I have phones (some behind NAT) connecting to Opensips server an 
Asterisk and an rtpproxy as seen below:


rtpproxy started with
ps -aux | grep rtpproxy
root 15666  0.0  0.0  14472   920 ?Ssl  Mar23   0:05 
./rtpproxy -F -l 189.254.2.19 -s udp:* 7890 -d DBUG LOG_LOCAL3




UAC1 username = 
100Firewall/routerOpensips 
1.7-- RTP PROXYAsterisk 1.6
192.168.1.10192.168.1.1
65.254.63.212  189.254.2.19   190.61.201.89

  external ip dinamic 169.254.2.2


- Calls between UAC are OK (both SIP and RTP).
- Calls UAC for PSTN is OK.
- Did numbers is received in Asterisk, and destination for UAC 
registered in opensips, but no work audio .
(EX User call cellphone for DID 54115368566, call is received in 
asterisk, and destination for user 100, registered in opensips)





___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



--
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



--
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Problem NAT RTPproxy

2012-04-02 Thread magnusadil...@gmail.com

  
  
In ngrep traffic check no active rdp-session-id

but do not know how to solve


#
U +3.135110 IP-ASTERISK:5060 - IP_OPENSIPS:5060
INVITE sip:100@ IP_OPENSIPS SIP/2.0 
Via: SIP/2.0/UDP IP-ASTERISK:5060;branch=z9hG4bK3e684698;rport 
Max-Forwards: 70 
From: "3414741468"
sip:TRK00253-001@IP-ASTERISK;tag=as33306c2a 
To: sip:100@IP_OPENSIPS 
Contact: sip:TRK00253-001@IP-ASTERISK 
Call-ID: 46ea6e9819e3583c59479d9304cc2b4f@IP-ASTERISK
CSeq: 102 INVITE 
User-Agent: Asterisk PBX 1.6.2.20 
Date: Mon, 26 Mar 2012 16:29:17 GMT 
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY,
INFO 
Supported: replaces, timer 
Content-Type: application/sdp 
Content-Length: 333 

v=0 
o=root 1324806659 1324806659 IN IP4 IP-ASTERISK 
s=Asterisk PBX 1.6.2.20 
c=IN IP4 IP-ASTERISK
t=0 0 
m=audio 10788 RTP/AVP 0 18 8 3 101 
a=rtpmap:0 PCMU/8000 
a=rtpmap:18 G729/8000 
a=fmtp:18 annexb=no 
a=rtpmap:8 PCMA/8000 
a=rtpmap:3 GSM/8000 
a=rtpmap:101 telephone-event/8000 
a=fmtp:101 0-16 
a=ptime:20 
a=sendrecv 



tanks 





Bogdan-Andrei Iancu wrote:

  
  Well, you know, one is what we want to do , another we actually
  get.
  
  I was rather asking if, making a sip capture (with ngrep) you see
  in your call the RTPproxy insertion - check it in traffic, not in
  script.
  
  Regards,
  Bogdan
  
  On 04/02/2012 10:05 PM, magnusadil...@gmail.com
  wrote:
  

hi, yes, rtpproxy is active in invite 200

onreply_route[3] {
 if ((isflagset(5) || isbflagset(0))  status =~
"(183)|(2[0-9][0-9])"  has_body("application/sdp")) {
 if (rtpproxy_answer()) {
 log("L_INFO: rtpproxy_answer NAT");
 }
 }
 if (!subst_uri('/(sip:.*);nat=yes/\1/'))


{
 search_append('Contact:.*sip:[^[:cntrl:]]*',
';nat=yes');
 }
 exit;
}


But i'm implemented this in invite route

if (is_method("INVITE") {
 if ($si == "IP ASTERISK"  is_method("INVITE")) {
 fix_nated_contact();
 fix_nated_sdp("1");
 xlog("L_INFO", "NAT detected3 PSTN for SIP");
 setflag(5);
 return;
 }
 }

and worked, but

I think it is not correct

tansk


Bogdan-Andrei Iancu wrote:

  
  Hi Magnus,
  
  attaching cfg files is useless, as no one will debug the
  script, but we will help you to debug your script.
  
  So, for the non-working case (PSTN to SIP) does your script
  force RTPproxy in INVITE and 200 OK ?
  
  Regards,
  Bogdan
  
  On 03/29/2012 01:52 AM, magnusadil...@gmail.com
  wrote:
  

I have phones (some behind NAT) connecting to Opensips
server an Asterisk and an rtpproxy as seen below:

rtpproxy started with
ps -aux | grep rtpproxy
root 15666 0.0 0.0 14472 920 ? Ssl Mar23
0:05 ./rtpproxy -F -l 189.254.2.19 -s udp:* 7890 -d DBUG
LOG_LOCAL3 
 
 
 
UAC1 username =
100Firewall/routerOpensips
1.7-- RTP PROXYAsterisk 1.6
192.168.1.10
192.168.1.1 65.254.63.212
189.254.2.19 190.61.201.89
 external ip dinamic 169.254.2.2


- Calls between UAC are OK (both SIP and RTP).
- Calls UAC for PSTN is OK.
- Did numbers is received in Asterisk, and destination for
UAC registered in opensips, but no work audio .
(EX User call cellphone for DID 54115368566, call is
received in asterisk, and destination for user 100,
registered in opensips)

 
 

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

  
  
  
  -- 
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

  
  
  
  -- 
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com


  


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] Problem NAT RTPproxy

2012-03-28 Thread magnusadil...@gmail.com

  
  
I have phones (some behind NAT) connecting to Opensips server an
Asterisk and an rtpproxy as seen below:

rtpproxy started with
ps -aux | grep rtpproxy
root 15666 0.0 0.0 14472 920 ? Ssl Mar23 0:05
./rtpproxy -F -l 189.254.2.19 -s udp:* 7890 -d DBUG LOG_LOCAL3 
 
 
 
UAC1 username =
100Firewall/routerOpensips
1.7-- RTP PROXYAsterisk 1.6
192.168.1.10 192.168.1.1
65.254.63.212 189.254.2.19 190.61.201.89
 external ip dinamic 169.254.2.2


- Calls between UAC are OK (both SIP and RTP).
- Calls UAC for PSTN is OK.
- Did numbers is received in Asterisk, and destination for UAC
registered in opensips, but no work audio .
(EX User call cellphone for DID 54115368566, call is received in
asterisk, and destination for user 100, registered in opensips)




loadmodule "db_mysql.so"
loadmodule "signaling.so"
loadmodule "sl.so"
loadmodule "tm.so"
loadmodule "rr.so"
loadmodule "maxfwd.so"
loadmodule "usrloc.so"
loadmodule "registrar.so"
loadmodule "textops.so"
loadmodule "mi_fifo.so"
loadmodule "uri.so"
loadmodule "acc.so"
loadmodule "dialog.so"
loadmodule "load_balancer.so"
loadmodule "nathelper.so"
loadmodule "siptrace.so"
loadmodule "rtpproxy.so"
loadmodule "auth.so"
loadmodule "auth_db.so"
loadmodule "domain.so"

modparam("load_balancer", "db_url",
"mysql://opensips:opensips@localhost/opensips")

modparam("siptrace", "db_url",
"mysql://opensips:opensips@localhost/opensips")
modparam("siptrace", "trace_flag", 22)
modparam("siptrace", "trace_on", 1)
modparam("siptrace", "enable_ack_trace", 1)


modparam("rtpproxy", "rtpproxy_sock","udp:189.254.2.19:7890")


modparam("dialog", "db_mode", 1)
modparam("dialog", "db_url",
"mysql://opensips:opensips@localhost/opensips")


modparam("nathelper", "natping_interval", 10)
modparam("nathelper", "natping_processes", 3)
modparam("nathelper", "natping_socket", "189.254.2.19:5006")
modparam("nathelper", "received_avp", "$avp(42)")
modparam("nathelper", "force_socket", "189.254.2.19:3")
modparam("nathelper", "sipping_from", "sip:pinger@65.254.63.212")
modparam("nathelper", "sipping_method", "INFO")

modparam("nathelper", "sipping_bflag", 7)

modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")

modparam("rr","enable_double_rr",1)
modparam("rr","append_fromtag",1)

modparam("registrar", "max_contacts", 10)

modparam("usrloc", "db_mode", 2)

modparam("usrloc",
"db_url","mysql://opensips:opensips@localhost/opensips")

modparam("acc", "early_media", 1)
modparam("acc", "report_cancels", 1)
modparam("acc", "detect_direction", 0)
modparam("acc", "failed_transaction_flag", 3)
modparam("acc", "log_flag", 1)
modparam("acc", "log_missed_flag", 2)
modparam("acc", "db_flag", 1)
modparam("acc", "db_missed_flag", 2)

modparam("auth_db", "password_column", "password")
modparam("auth_db", "password_column_2", "ha1b")
modparam("auth_db", "calculate_ha1", 1)
modparam("auth_db",
"db_url","mysql://opensips:opensips@localhost/opensips")
modparam("auth_db", "load_credentials", "")
modparam("auth_db", "skip_version_check", 1)

modparam("domain",
"db_url","mysql://opensips:opensips@localhost/opensips")
modparam("domain", "db_mode", 1) # Use caching

modparam("auth_db|usrloc|uri", "use_domain", 0)

route {
 if (!mf_process_maxfwd_header("256")) {
 if (method != "ACK") {
 sl_send_reply("483", "Too Many Hops");
 }
 return;
 }

 if (msg:len  max_len) {
 if (method != "ACK") {
 sl_send_reply("513", "Message Overflow");
 } 
 return;
 }


 if (status == "482") { #loop detection
 xlog("L_INFO", "Webur: $mi $rm $fu - $ru status 482 Loop
Detected\n");
 return;
 }

 if (!mf_process_maxfwd_header("3")) {
 sl_send_reply("483", "looping");
 exit;
 }


 if (has_totag()) {
 loose_route();
 t_relay();
 exit;
 }

 if (method == "INVITE") {
 route(3);
 return;
 } else
 if (method == "ACK") {
 route(9);
 return;
 } else
 if (method == "BYE" || method == "CANCEL") {
 route(5);
 return;
 } else
 if (method == "REGISTER" || method == "MESSAGE") {
 route(1);
 return;
 } else
 if (method == "PUBLISH" || method ==
"SUBSCRIBE") {
 sl_send_reply("200", "Understood");
 #route(2);
 return;
 } else
 if (method == "NOTIFY") {
 sl_send_reply("200", "Understood");
 return;
 } else
 if (method == "OPTIONS") {
 sl_send_reply("200", "Got it");
 return;
 }
}

route[1] {
 if