Jain Sip - duplicated messages
"brea C." <[email protected]> Wed, 7 May 2008 12:23:23 +0200
| Newsgroups | gmane.comp.voip.nist-sip |
|---|---|
| Message-ID | <[email protected]> |
------=_Part_6710_28225651.1210155804198
Content-Type: multipart/alternative;
boundary="----=_Part_6711_6376101.1210155804199"
------=_Part_6711_6376101.1210155804199
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Hi!
I'm currently developing a sip proxy solution using Jain sip reference
implementation (more exactly v1.2) and im having some issues that I can't
identify where it comes.
The problem is that mostly sip messages who are proxied ( both requests and
responses ), sent in statefull mode with client or server Transaction,
appears duplicated on the lan. Its not because a expired timer, duplicated
messages are sent simultaneously in just milliseconds.
Here is attached a graph about this.
And the code is no more complex than:
---------------------------------------------------------------------------=
----------------------------------------------------------
public void processInvite(RequestEvent requestEvent)
{
try {
Request request =3D requestEvent.getRequest();
ServerTransaction st =3D requestEvent.getServerTransaction();
if (st =3D=3D null) {
st =3D sipProvider.getNewServerTransaction(request);
}
Request newRequest =3D (Request) request.clone();
SipURI requestURI =3D (SipURI)newRequest.getRequestURI(=
);
requestURI =3D
ProtocolObjects.addressFactory.createSipURI("annc",cmsAddress);
requestURI.setParameter("play",ad);
newRequest.setRequestURI(requestURI);
// Record Route
SipURI sipURI =3D
ProtocolObjects.addressFactory.createSipURI("Proxy",host);
sipURI.setPort(port);
Address address =3D
ProtocolObjects.addressFactory.createAddress("Proxy",sipURI);
RecordRouteHeader recordRoute =3D
ProtocolObjects.headerFactory.createRecordRouteHeader(address);
newRequest.addHeader(recordRoute);
// Via Header
ViaHeader viaHeader =3D
ProtocolObjects.headerFactory.createViaHeader(host, port, transport, null);
newRequest.addFirst(viaHeader);
ClientTransaction ct =3D
sipProvider.getNewClientTransaction(newRequest);
log.info(">>> Client Transaction Created state "+ct.getState()+=
"
ct: "+ ct);
ct.setApplicationData(st);
ct.sendRequest();
} catch (Exception ex) {
ex.printStackTrace();
System.exit(0);
}
}
public void response(ResponseEvent evt) {
Response response =3D evt.getResponse();
ClientTransaction ct =3D evt.getClientTransaction();
if ( response.getStatusCode() !=3D 100 ) {
if ( ct !=3D null ) {
try {
ServerTransaction st =3D (ServerTransaction)
ct.getApplicationData();
Response newResp =3D (Response) response.clone();
newResp.removeFirst(ViaHeader.NAME);
st.sendResponse(newResp);
} catch (Exception e){
e.printStackTrace();
}
} else {
System.out.println("Warning: responseInvite and ct =3D=3D null,
nothing done");
}
}
}
---------------------------------------------------------------------------=
------------------------------------------------------
I have no idea about a possible solution, so any help will be very
apreciated.
Regards
C=E9sar.
------=_Part_6711_6376101.1210155804199
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Hi! <br><br>I'm currently developing a sip proxy solution using Jain si=
p reference implementation (more exactly v1.2) and im having some issues th=
at I can't identify where it comes.<br><br>The problem is that mostly s=
ip messages who are proxied ( both requests and responses ), sent in =
statefull mode with client or server Transaction, appears duplicated =
on the lan. Its not because a expired timer, duplicated messages are =
sent simultaneously in just milliseconds. <br>
<br>Here is attached a graph about this.<br><br>And the code is no more com=
plex than:<br><br>---------------------------------------------------------=
---------------------------------------------------------------------------=
-<br>
public void processInvite(RequestEvent requestEvent)<br>=
{<br> try {<br>&nbs=
p; =
Request request =3D requestEvent.getRequest();<br=
> ServerTransaction=
st =3D requestEvent.getServerTransaction();<br>
<br> if (st =3D=3D =
null) {<br> &=
nbsp; st =3D sipProvider.getNewServerTransaction(request);<br> &=
nbsp; }<br> &=
nbsp; <br><br> =
=
Request newRequest =3D (Request) request.clone();<br> &nbs=
p; =
SipURI requestURI =3D (SipURI)newRequest.getRequestURI();<br>
&=
nbsp; requestURI =3D ProtocolObjects.addressFactory=
.createSipURI("annc",cmsAddress);<br> &nbs=
p; =
requestURI.setParameter("play",ad);<br> &=
nbsp; &nb=
sp; newRequest.setRequestURI(requestURI);<br>
<br><br> // Record =
Route<br> SipURI si=
pURI =3D ProtocolObjects.addressFactory.createSipURI("Proxy",host=
);<br> sipURI.setPo=
rt(port);<br> Addre=
ss address =3D ProtocolObjects.addressFactory.createAddress("Proxy&quo=
t;,sipURI);<br>
RecordRouteHeader =
recordRoute =3D ProtocolObjects.headerFactory.createRecordRouteHeader(addre=
ss);<br> newRequest=
.addHeader(recordRoute);<br><br>  =
; // Via Header<br> =
ViaHeader viaHeader =3D ProtocolObjects.headerFactory.createVi=
aHeader(host, port, transport, null);<br>
newRequest.addFirs=
t(viaHeader);<br><br> &nbs=
p; ClientTransaction ct =3D sipProvider.getNewClientTransaction(newRequest)=
;<br> log.info(&quo=
t;>>> Client Transaction Created state "+ct.getState()+"=
ct: "+ ct);<br>
<br> ct.setApplicat=
ionData(st);<br> ct=
.sendRequest();<br><br> &n=
bsp; <br> =
} catch (Exception ex) {<br> &nbs=
p; &=
nbsp; ex.printStackTrace();<br> &n=
bsp;  =
; System.exit(0);<br>
&nb=
sp; }<br> }<br><br> public =
void response(ResponseEvent evt) {<br> =
Response response =3D evt.getResponse();<br>  =
; ClientTransaction ct =3D evt.getClientTransaction();<br><br> &=
nbsp; if ( response.getStatusCode() !=3D 100 ) { <=
br>
if ( ct !=3D null ) {<br> =
try {<br> &n=
bsp; ServerTransaction st =3D (ServerTransac=
tion) ct.getApplicationData();<br> &nb=
sp; Response newResp =3D (Response) response.clone();<br> =
newResp.removeFirst(ViaH=
eader.NAME);<br>
<br> st.sendRespons=
e(newResp);<br><br> =
} catch (Exception e){<br> &nbs=
p; e.printStackTrace();<br>  =
; }<br>  =
; } else {<br> System.out=
.println("Warning: responseInvite and ct =3D=3D null, nothing done&quo=
t;); <br>
}<br><br> &nb=
sp; }<br> }<br>------------------------------------=
---------------------------------------------------------------------------=
------------------<br><br> I have no idea about a possible solution, s=
o any help will be very apreciated.<br>
<br> Regards<br><br> C=E9sar.<br>
------=_Part_6711_6376101.1210155804199--
------=_Part_6710_28225651.1210155804198
Content-Type: text/plain; name=graph.txt
Content-Transfer-Encoding: base64
X-Attachment-Id: f_ffxre1ts0
Content-Disposition: attachment; filename=graph.txt
fFRpbWUgICAgIHwgMTkyLjE2OC4xLjQ0ICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAxOTIu
MTY4LjEuNDAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgMTkyLjE2OC4xLjE2Cnw4NSw3NTYg
ICB8ICAgICAgICAgSU5WSVRFIFNEUCAoIHRlbGVwaG9uZS1ldmVudCkgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgIAp8ICAgICAgICAg
fCg1MDYwKSAgIC0tLS0tLS0tLS0tLS0tLS0tLT4gICg1MDYwKSAgICB8ICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgIAp8ODUsNzYzICAg
fCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgSU5WSVRF
IFNEUCAoIHRlbGVwaG9uZS1ldmVudCkgICAgICAgICAgCnwgICAgICAgICB8ICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwoNTA2MCkgICAtLS0tLS0tLS0tLS0tLS0tLS0+
ICAoNTA2MCkgICB8Cnw4NSw3NjMgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgIHwgICAgICAgICBJTlZJVEUgU0RQICggdGVsZXBob25lLWV2ZW50KSAgICAgICAgICAK
fCAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCg1MDYw
KSAgIC0tLS0tLS0tLS0tLS0tLS0tLT4gICg1MDYwKSAgIHwKfDg1LDc2OCAgIHwgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgIDEwMCBUcnlpbmd8ICAgICAg
ICAgICAgICAgICAgIHwKfCAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgfCg1MDYwKSAgIDwtLS0tLS0tLS0tLS0tLS0tLS0gICg1MDYwKSAgIHwKfDg1LDc2
OCAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgIDIw
MCBPSyBTRFAgKCB0ZWxlcGhvbmUtZXZlbnQpICAgICAgICAgIAp8ICAgICAgICAgfCAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8KDUwNjApICAgPC0tLS0tLS0tLS0tLS0t
LS0tLSAgKDUwNjApICAgfAp8ODUsNzc4ICAgfCAgICAgICAgIDIwMCBPSyBTRFAgKCB0ZWxlcGhv
bmUtZXZlbnQpICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAp8ICAg
ICAgICAgfCg1MDYwKSAgIDwtLS0tLS0tLS0tLS0tLS0tLS0gICg1MDYwKSAgICB8ICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAp8ODUsNzc4ICAgfCAgICAgICAgIDIwMCBP
SyBTRFAgKCB0ZWxlcGhvbmUtZXZlbnQpICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgfAp8ICAgICAgICAgfCg1MDYwKSAgIDwtLS0tLS0tLS0tLS0tLS0tLS0gICg1MDYw
KSAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAp8ODUsNzkyICAg
fCAgICAgICAgIEFDSyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgIAp8ICAgICAgICAgfCg1
MDYwKSAgIC0tLS0tLS0tLS0tLS0tLS0tLT4gICg1MDYwKSAgICB8ICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgfAp8ODUsNzk4ICAgfCAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICB8ICAgICAgICAgQUNLICAgICAgICAgICAgICAgICAgICAgICAgICAg
fAp8ICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8KDUw
NjApICAgLS0tLS0tLS0tLS0tLS0tLS0tPiAgKDUwNjApICAgfAp8ODUsODQ0ICAgfCAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgQllFICAgICAgICAgICAg
ICAgICAgICAgICAgICAgfAp8ICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICB8KDUwNjApICAgPC0tLS0tLS0tLS0tLS0tLS0tLSAgKDUwNjApICAgfAp8ODUs
ODQ3ICAgfCAgICAgICAgIEJZRSAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAp8ICAgICAgICAgfCg1MDYwKSAgIDwtLS0t
LS0tLS0tLS0tLS0tLS0gICg1MDYwKSAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgfAp8ODUsODUxICAgfCAgICAgICAgIDIwMCBPSyAgICAgICAgICAgICAgICAgICAg
ICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAp8ICAgICAgICAg
fCg1MDYwKSAgIC0tLS0tLS0tLS0tLS0tLS0tLT4gICg1MDYwKSAgICB8ICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgfAp8ODUsODUzICAgfCAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgMjAwIE9LICAgICAgICAgICAgICAgICAgICAg
ICAgfAp8ICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8
KDUwNjApICAgLS0tLS0tLS0tLS0tLS0tLS0tPiAgKDUwNjApICAgfAo=
------=_Part_6710_28225651.1210155804198
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
nist-sip mailing list
[email protected]
http://www-x.antd.nist.gov/mailman/listinfo/nist-sip
------=_Part_6710_28225651.1210155804198--