[OpenSIPS-Users] do_routing() sending several invites per call
Magnus Burman
magnus.burman at adamo.es
Wed Jan 20 17:09:20 CET 2010
What happend was that do_routing in secret makes a call to route[1] before
overwriting RURI. I changed all references to route[1] to route[111] instead
(%s/route(1)/route(111)/g) and modified route[1] to do in essence nothing.
Below is the new code as well as the syslog. Calls are now forwarded
correctly, but it worries me that route[1] is still called somehow, without
*any* references to it anywhere in the config file.
route[1] {
xlog("route-1: ru=$ru; du=$du; rd=$rd");
exit;
}
route[10] {
# pre-processing with strips/prefixes etc
...
xlog("Before routing: ru=$ru; du=$du; rd=$rd");
if(do_routing("0")) {
xlog("After routing: ru=$ru; du=$du; rd=$rd");
route(111);
exit;
}
exit;
}
route[111] {
setflag(1);
$avp(s:can_uri) = $ru;
xlog("route-111: ru=$ru; du=$du; rd=$rd");
if (!t_relay()) {
sl_reply_error();
};
exit;
}
SYSLOG:
Jan 20 16:24:19 sbc2 /usr/sbin/opensips[1109]: Before routing:
ru=sip:34615122... at opensips; du=<null>; rd=opensips
Jan 20 16:24:19 sbc2 /usr/sbin/opensips[1109]: route-1:
ru=sip:34615122... at opensips; du=<null>; rd=opensips
Jan 20 16:24:19 sbc2 /usr/sbin/opensips[1109]: After routing:
ru=sip:34615122... at TRUNK; du=<null>; rd=TRUNK
Jan 20 16:24:19 sbc2 /usr/sbin/opensips[1109]: route-111:
ru=sip:34615122... at TRUNK; du=<null>; rd=TRUNK
2010/1/19 Magnus Burman <magnus.burman at adamo.es>
> Hi,
>
> I'm moving from Opensips 1.4 to 1.6.1 currently and I'm getting some
> strange behavior from droute. After it sends the INVITE, it resends it, and
> again, for a total of 8 times, each time adding the opensips ip to
> record-route and Via. Each invite gets its own record in radacct.
>
> Anyone with an idea where I'm going wrong?
>
> Below is the "relevant" part of my config:
>
> route[1] {
> setflag(1);
> $avp(s:can_uri) = $ru;
> if (!t_relay()) {
> sl_reply_error();
> };
> exit;
> }
>
> route[10] {
> # pre-processing with strips/prefixes etc
> ...
> if(do_routing("0")) {
> xlog("Regular routing");
> route(1);
> exit;
> }
> exit;
> }
>
> Below is the first INVITE sent out by Opensips. IP:s have been changed to
> protect the innocent; they're all public, no NAT:
>
> U 2010/01/19 17:29:19.825093 111.111.114.120:5060 -> 222.222.222.222:5060
> INVITE sip:34610100100 at 222.222.222.222 <sip%3A34610100100 at 222.222.222.222>SIP/2.0.
> Record-Route:
> <sip:111.111.114.120;lr=on;ftag=fd1f3a1d6bcfabebo0;vsf=AAAAAF5VXlZBQ2ZEXUNEAAAAAAAAAAAAAAAAAAAA;did=01.aa2219f7>.
> Via: SIP/2.0/UDP 111.111.114.120;branch=z9hG4bK3eea.5d650714.1.
> Via: SIP/2.0/UDP 111.111.115.122:5060;branch=z9hG4bK-4fddec66.
> From: "34620200200" <sip:34620200200 at 111.111.114.120<sip%3A34620200200 at 111.111.114.120>
> >;tag=fd1f3a1d6bcfabebo0.
> To: <sip:610100100 at 111.111.114.120 <sip%3A610100100 at 111.111.114.120>>.
> Call-ID: 6bf71385-646761a3 at 111.111.115.122.
> CSeq: 101 INVITE.
> Max-Forwards: 69.
> Contact: "Magnus" <sip:magnus_test at 111.111.115.122:5060>.
> Expires: 240.
> User-Agent: Linksys/SPA921-5.1.8.
> Content-Length: 208.
> Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER.
> Supported: replaces.
> Content-Type: application/sdp.
> P-hint: inbound->inbound .
> .
> v=0.
> o=- 13541 13541 IN IP4 111.111.115.122.
> s=-.
> c=IN IP4 111.111.115.122.
> t=0 0.
> m=audio 16408 RTP/AVP 8 101.
> a=rtpmap:8 PCMA/8000.
> a=rtpmap:101 telephone-event/8000.
> a=fmtp:101 0-15.
> a=ptime:30.
> a=sendrecv.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20100120/afe34db7/attachment.htm
More information about the Users
mailing list