[OpenSIPS-Users] Each call sends multiple invites using DR module

Bogdan-Andrei Iancu bogdan at voice-system.ro
Mon Apr 12 17:13:47 CEST 2010


Hi Fernando,

Remove the "4" val from the routeID filed in GW table - that route is 
NOT INDENTED FOR DOING PROXY - it is just for simple processing. The 
proxying is done by script itself!

Regards,
Bogdan

Fernando Rios wrote:
> Hi all,
>
> I'm trying to configure my OpenSIPS according to doc, with DR module.
> The issue happen when I send a call (from a softphone), in the second 
> leg of the call I see several INVITES to TermGw.
>
> I'm new in OpenSIPS ( I'm experienced with Nextone ), I could do working 
> OpenSIPS routing just through opensips.cfg, but I need to have thousand 
> of routes, so keep updated that file would be a heavy task.
>
> Please your help to know what's the mistake, where I'm wrong ? What's it 
> is missed or omitted ??
>
> Or please give me a working example !! With that I have enough.
> When I find the working template I want to work in scripting tools in 
> order to handle thousand of routes easily, I'd share that with the 
> community.
>
>
>
> Softphone IP is 192.168.0.18
> OpenSIPS IP is 192.168.0.112
> TermGw is 192.168.0.250 (Asterisk)
>
> Here the tshark trace:
>
>    6.833804 192.168.0.18 -> 192.168.0.112 SIP/SDP Request: INVITE 
> sip:471254287223 at 192.168.0.112, with session descript
> ion
>    6.835459 192.168.0.112 -> 192.168.0.18 SIP Status: 100 Giving a try
>    6.835657 192.168.0.112 -> 192.168.0.250 SIP/SDP Request: INVITE 
> sip:954287223 at 192.168.0.250, with session descriptio
> n
>    6.836579 192.168.0.250 -> 192.168.0.112 SIP Status: 100 Trying
>    6.839673 192.168.0.112 -> 192.168.0.250 SIP/SDP Request: INVITE 
> sip:954287223 at 192.168.0.250, with session descriptio
> n
>    6.840750 192.168.0.250 -> 192.168.0.112 SIP Status: 100 Trying
>    6.844255 192.168.0.112 -> 192.168.0.250 SIP/SDP Request: INVITE 
> sip:954287223 at 192.168.0.250, with session 
> descriptio                                     n
>    6.844842 192.168.0.250 -> 192.168.0.112 SIP Status: 100 Trying
>    6.847648 192.168.0.112 -> 192.168.0.250 SIP/SDP Request: INVITE 
> sip:954287223 at 192.168.0.250, with session 
> descriptio                                     n
>    6.848220 192.168.0.250 -> 192.168.0.112 SIP Status: 100 Trying
>    6.851395 192.168.0.112 -> 192.168.0.250 SIP/SDP Request: INVITE 
> sip:954287223 at 192.168.0.250, with session 
> descriptio                                     n
>    6.852144 192.168.0.250 -> 192.168.0.112 SIP Status: 100 Trying
>    6.964467 192.168.0.250 -> 192.168.0.112 SIP/SDP Status: 183 Session 
> Progress, with session description
>    6.965185 192.168.0.112 -> 192.168.0.18 SIP/SDP Status: 183 Session 
> Progress, with session description
> --- After several secs I hang the call...
>   12.852208 192.168.0.18 -> 192.168.0.112 SIP Request: CANCEL 
> sip:471254287223 at 192.168.0.112
>   12.854316 192.168.0.112 -> 192.168.0.18 SIP Status: 200 canceling
>   12.855668 192.168.0.112 -> 192.168.0.250 SIP Request: CANCEL 
> sip:954287223 at 192.168.0.250
>   12.856157 192.168.0.250 -> 192.168.0.112 SIP Status: 487 Request 
> Terminated
>   12.856179 192.168.0.250 -> 192.168.0.112 SIP Status: 200 OK
>   12.856308 192.168.0.112 -> 192.168.0.250 SIP Request: ACK 
> sip:954287223 at 192.168.0.250
>   12.858402 192.168.0.112 -> 192.168.0.18 SIP Status: 487 Request Terminated
>   12.863562 192.168.0.18 -> 192.168.0.112 SIP Request: ACK 
> sip:471254287223 at 192.168.0.112
>
> These are my data config in the database:
> * dr_gateways
> "gwid"    "type"    "address"    "strip"    "pri_prefix"    "attrs"    
> "probe_mode"    "description"
> "2"    "2"    "192.168.0.250"    "4"    "9"    null    "0"    "mygw1"
>
> * dr_groups
> "id"    "username"    "domain"    "groupid"    "description"
> "1"    "9000"    "192.168.0.112"    "1"    "edeww"
> "2"    "1003"    "192.168.0.112"    "1"    "Fer"
>
> * dr_gw_lists
> "id"    "gwlist"    "description"
> "1"    "2"    "GatewaysLocales"
>
> * dr_rules
> "ruleid"    "groupid"    "prefix"    "timerec"    "priority"    
> "routeid"    "gwlist"    "description"
> "1"    "1"    "4712"    ""    "1"    "4"    "2"    "MyFirstRoute"
> "2"    "2"    "4712"    ""    "1"    "4"    "2"    "RouteFer"
>
> * subscriber
> "id"    "username"    "domain"    "password"    "email_address"    
> "ha1"    "ha1b"    "rpid"
> "6"    "1003"    "sip.rudy-test.com"    "12345"    
> "fernando.rios at hyettemail.com"    ""    ""    null
> "5"    "9000"    "sip.rudy-test.com"    "1234"    
> "xxxx at hyettemail.com"    ""    ""    null
>
> Config in opensips.cfg:
>
> route{
>         # Do Accounting on INVITE, CANCEL AND BYE
>          setflag(2);
>          setflag(3);
>          setflag(4);
>
>          if (!mf_process_maxfwd_header("10")) {
>                  sl_send_reply("483","Too Many Hops");
>                  exit;
>          };
>
>          if (msg:len >=  2048 ) {
>                  sl_send_reply("513", "Message too big");
>                  exit;
>          };
>
>          if (!method=="REGISTER")
>                  record_route();
>
>          if (loose_route()) {
>
>                 append_hf("P-hint: rr-enforced\r\n");
>                 route(1);
>
>          }
>
>
>          if (uri==myself) {
>
>                  if (method=="REGISTER") {
>                          setflag(6);
>                          force_rport();
>                          # Uncomment this if you want to use digest 
> authentication
>                          if (!www_authorize("192.168.0.112", 
> "subscriber")) {
>                                  www_challenge("192.168.0.112", "0");
>                                  exit;
>                          };
>
>                          save("location");
>                          exit;
>                  };
>
>                  lookup("aliases");
>                  if (!uri==myself) {
>                          append_hf("P-hint: outbound alias\r\n");
>
>                          route(1);
>                  };
>
>
>                  if (uri=~"^sip:4712+@*" ) {
>
>                          route(4);
>                          exit;
>                  }
>
> }
>
> route[1] {
>          # for INVITEs enable some additional helper routes
>          if (is_method("INVITE")) {
> #               t_on_branch("2");
>                  t_on_reply("2");
> #               t_on_failure("1");
>          }
>
>          if (!t_relay()) {
>                  sl_reply_error();
>          };
>          exit;
> }
>
>
> route[4] {
> #---- pSTN route ----#
>          if(!do_routing()){
>                  send_reply("503", "No rules found matching the given 
> URI prefix ");
>                  exit;
>          }
>
>           # flag 10 flag the transaction to handle the failure route
>           #setflag(10);
>           route(1);
> }
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>   


-- 
Bogdan-Andrei Iancu
www.voice-system.ro




More information about the Users mailing list