[OpenSIPS-Users] B2BUA on OpenWRT router

Ovidiu Sas osas at voipembedded.com
Fri Jan 13 20:37:33 CET 2012


You should listen on both interfaces (public and private).
Take a look at mhomed parameter:
http://www.opensips.org/Resources/DocsCoreFcn17#toc63

Also, you will need to understand how loose routing works in SIP
(reading the rfc a few times will help).
You should not modify Route, Record-Route and Via headers unless you
know exactly what are you doing.


Regards,
Ovidiu Sas

On Fri, Jan 13, 2012 at 2:02 AM, Andrew Radke
<andrew.radke at yuruga.com.au> wrote:
> Hi all,
>
> I've added advertised_address="203.31.111.19" to my config which has
> corrected the Via header but it hasn't corrected my problem.
>
> I also have added
> record_route_preset("203.31.111.19");
> when it gets an INVITE and this has helped but not fixed the problem. With
> it in place and using the following code:
> if ( ! t_check_trans() ) {
> xlog("ERROR: NOT in a transaction:\n");
> xlog("$mb");
> }
>
> When the remote party hangs up first I get lots of these until the ITSP
> gives up:
>
> ERROR: NOT in a transaction:
> BYE sip:216 at 203.31.111.19:5060;x-sipX-nonat SIP/2.0
> Via: SIP/2.0/UDP
> 202.85.243.105:5060;branch=z9hG4bK-d8754z-6bb3100741714e15-1---d8754z-;rport
> Via: SIP/2.0/UDP
> 202.85.243.105:5072;rport=5072;branch=z9hG4bK-pjbredljvrzl3poi
> Max-Forwards: 69
> Route: <sip:203.31.111.19;lr;ftag2c4cf9fc77f3c062o0>
> Route:
> <sip:192.168.52.31:5060;lr;sipXecs-CallDestLD;sipXecs-rs%2Aauth%7E.%2Afrom%7EMmM0Y2Y5ZmM3N2YzYzA2Mm8w.900_ntap%2Aid%7EMTAzNDAtNTQ1%21983392f1a7d0a0b6b8db8e7faf804b07>
> Contact: "Anonymous"<sip:202.85.243.105:5072>
> To: "Andrew Radke"<sip:216 at voip.yuruga.com.au>;tag=2c4cf9fc77f3c062o0
> From: <sip:60432790807 at voip.yuruga.com.au>;tag=lobq7uinzugnfuvq.i
> Call-ID: 76aaa584-7ae2ca7a at 192.168.52.158
> CSeq: 849 BYE
> User-Agent: Sippy
> h323-conf-id: 394797210-1035080161-2573706426-3679368262
> cisco-GUID: 394797210-1035080161-2573706426-3679368262
> Content-Length: 0
>
> So it seems that opensips has lost track of the transaction at this point
> and doesn't know where to send this on to.
>
> Regards,
> Andrew Radke
>
> On 13/01/2012, at 1:40 PM, Andrew Radke wrote:
>
> Hi all,
>
> I think I have this all quite good now. I do have the issue though that when
> the remote party hangs up a call we aren't sent the BYE. I'm guessing this
> is something to do with either the Record-Route or a Via header.
>
> I don't think it's the Via because the responses from our ITSP come back
> with something like this for the opensips line:
> Via: SIP/2.0/UDP
> 192.168.52.1;branch=z9hG4bKcd53.5599c4a7.0;received=203.31.111.19;rport=5060
> indicating that they are dealing with it. And I've tried changing the Via
> header for opensips with this code but I think it is created late in the
> process as it is never triggered:
>         if ( search("Via: SIP/2\.0/UDP 192\.168\.52\.1;") ) {
>                 xlog("Correcting router's Via header...\n");
>                 replace_all("Via: SIP/2\.0/UDP 192\.168\.52\.1;", "Via:
> SIP/2.0/UDP 203.31.111.19;")
>         }
>
> If I try to use record_route() it breaks everything as then opensips seems
> to loose track of the session and doesn't even respond to the ACKs when the
> session is created and then our ITSP hangs up 30 seconds later.
>
> So again, any pointers greatly appreciated. And here is our config file as
> it currently stands:
>
> debug=3
> log_stderror=no
> log_facility=LOG_LOCAL0
>
> fork=yes
> children=4
>
> /* uncomment the following lines to enable debugging */
> #debug=6
> fork=no
> log_stderror=yes
>
> disable_tcp=yes
>
> #disable_dns_blacklist=no
> #dns_try_ipv6=yes
> auto_aliases=no
>
>
> port=5060
> listen=udp:192.168.52.1:5060
>
>
> ####### Modules Section ########
>
> #set module path
> mpath="/usr/lib/opensips/modules/"
>
> loadmodule "rr.so"
> loadmodule "tm.so"
> loadmodule "uac.so"
> loadmodule "xlog.so"
> loadmodule "textops.so"
>
>
> # ----------------- setting module-specific parameters ---------------
>
>
> # ----- uac params -----
>
> modparam("uac", "credential", "<userid>:sip.pennytel.com:<password>")
> modparam("uac","from_restore_mode","none")
>
>
>
> ####### Routing Logic ########
>
> # main request routing logic
>
> route{
> t_on_failure("1");
> if ( is_method("INVITE") ) {
> xlog("$fU ($fn) Calling $oU\n");
> #record_route();
> }
>         if ( search("Via: SIP/2\.0/UDP 192\.168\.52\.1;") ) {
>                 xlog("Correcting router's Via header...\n");
>                 replace_all("Via: SIP/2\.0/UDP 192\.168\.52\.1;", "Via:
> SIP/2.0/UDP 203.31.111.19;")
>         }
>
>
> if ( has_body("application/sdp") ) {
> if ( search_body("a=rtpmap:. PCM.\/.*\n") ) {
> xlog("Removing g711 codecs...\n");
> replace_body_all("a=rtpmap:. PCM.\/.*\n", "");
> }
> if ( search_body("192\.168\.52\..*") ) {
> xlog("Correcting RTP IP address...\n");
> replace_body_all("192\.168\.52\..*", "203.31.111.19");
> }
> }
> if ( uri=~"sip:.+ at 192.168.52.1" ) {
> rewritehost("sip.pennytel.com");
> #remove_credentials();
> remove_hf("Proxy-Authorization");
> remove_hf("User-Agent");
>
> uac_replace_from("Yuruga Nursery","sip:0740933826 at 203.31.111.19");
> t_relay("udp:sip.pennytel.com:5060");
> };
>
> route(1);
> }
>
>
> route[1] {
> exit;
> }
>
> failure_route[1] {
> if (t_check_status("40[17]")) {
> xlog("Authentication requested\n");
> if (uac_auth()) {
> xlog("Authentication successfull\n");
> t_relay("udp:sip.pennytel.com:5060");
> }
> }
> }
>
>
> Regards,
> Andrew Radke
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>



-- 
VoIP Embedded, Inc.
http://www.voipembedded.com



More information about the Users mailing list