Re: Jain Sip - duplicated messages

"brea C." <[email protected]> Thu, 8 May 2008 15:58:28 +0200
Newsgroups gmane.comp.voip.nist-sip
Message-ID <[email protected]>
--===============1440614361282534208==
Content-Type: multipart/alternative; 
	boundary="----=_Part_928_33147679.1210255108188"

------=_Part_928_33147679.1210255108188
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Thanks for your reply Jeroen!

 The problem is not the message type, in each dialog can see duplicated
ACKs, BYEs , INVITEs and 200s... and duplicated in both ways ( sides of the
proxy).

 I'm using wireshark in 192.168.1.40 where the proxy is. Following your
indications i trace with wireshark too in the caller pc. And its correct,
messages who are duplicated in proxy's wireshark, appears just one time in
the client's wireshark.

 Until today I believe in wireshark ;)

 Regards
 C=E9sar

On Wed, May 7, 2008 at 6:37 PM, Jeroen van Bemmel <[email protected]> wrote=
:

>  Cesar,
>
> Are you sure this is not some artifact of the tool you are using to captu=
re
> the traces? I've seen Ethereal/wireshark appearing to duplicate messages,
> possibly related to what IP addresses are being used. In your trace, the
> INVITE and 200 OK messages sent by 192.168.1.40 appear duplicated, while
> the ACK and BYE are not. The difference is that ACK and BYE are sent to t=
he
> Contact address from the 200 OK
>
> Try capturing the trace at a different machine (which machine did you use
> to trace, 192.168.1.40?)
>
> Regards,
> Jeroen
>
> brea C. wrote:
>
> 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 a=
nd
> responses ),  sent in statefull mode  with client or server Transaction,
> appears duplicated on the lan.  Its not because a expired timer, duplicat=
ed
> 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.getRequestUR=
I();
>                     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.
>
> ------------------------------
>
> _______________________________________________
> nist-sip mailing [email protected]://www-x.antd.nist.gov/mai=
lman/listinfo/nist-sip
>
>

------=_Part_928_33147679.1210255108188
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Thanks for your reply Jeroen!<br><br>&nbsp;The problem is not the message
type, in each dialog can see duplicated ACKs, BYEs , INVITEs and
200s... and duplicated in both ways ( sides of the proxy).<br><br>&nbsp;I&#=
39;m using wireshark in <a href=3D"http://192.168.1.40/" target=3D"_blank">=
192.168.1.40</a>
where the proxy is. Following your indications i trace with wireshark
too in the caller pc. And its correct, messages who are duplicated in
proxy&#39;s wireshark, appears just one time in the client&#39;s wireshark.=
<br>
<br>&nbsp;Until today I believe in wireshark ;)<br><br>&nbsp;Regards<br>&nb=
sp;C=E9sar<br><br><div class=3D"gmail_quote">On Wed, May 7, 2008 at 6:37 PM=
, Jeroen van Bemmel &lt;<a href=3D"mailto:[email protected]">jbemmel@zonnet=
.nl</a>&gt; wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, =
204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


 =20

<div bgcolor=3D"#ffffff" text=3D"#000000">
Cesar,<br>
<br>
Are you sure this is not some artifact of the tool you are using to
capture the traces? I&#39;ve seen Ethereal/wireshark appearing to duplicate
messages, possibly related to what IP addresses are being used. In your
trace, the INVITE and 200 OK messages sent by <a href=3D"http://192.168.1.4=
0" target=3D"_blank">192.168.1.40</a> appear
duplicated, while the ACK and BYE are not. The difference is that ACK
and BYE are sent to the Contact address from the 200 OK<br>
<br>
Try capturing the trace at a different machine (which machine did you
use to trace, <a href=3D"http://192.168.1.40" target=3D"_blank">192.168.1.4=
0</a>?)<br>
<br>
Regards,<br>
Jeroen<br>
<br>
brea C. wrote:
<blockquote type=3D"cite"><div><div></div><div class=3D"Wj3C7c">Hi! <br>
  <br>
I&#39;m currently developing a sip proxy solution using Jain sip reference
implementation (more exactly v1.2) and im having some issues that I
can&#39;t identify where it comes.<br>
  <br>
The problem is that mostly sip messages who are proxied ( both requests
and responses ),&nbsp; sent in statefull mode&nbsp; with client or server
Transaction, appears duplicated on the lan.&nbsp; 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 complex than:<br>
  <br>
---------------------------------------------------------------------------=
----------------------------------------------------------<br>
&nbsp;&nbsp;&nbsp; public void processInvite(RequestEvent requestEvent)<br>
&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&n=
bsp;&nbsp; &nbsp;&nbsp;&nbsp; Request request =3D requestEvent.getRequest()=
;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ServerTransaction =
st =3D requestEvent.getServerTransaction();<br>
  <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if (st =3D=3D null=
) {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=
 st =3D sipProvider.getNewServerTransaction(request);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Request newRequest =3D (Request) request.clon=
e();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; SipURI requestURI =3D
(SipURI)newRequest.getRequestURI();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp; requestURI =3D
ProtocolObjects.addressFactory.createSipURI(&quot;annc&quot;,cmsAddress);<b=
r>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; requestURI.setParameter(&quot;play&quot;=
,ad);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; newRequest.setRequestURI(re=
questURI);<br>
  <br>
  <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Record Route<br=
>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; SipURI sipURI =3D
ProtocolObjects.addressFactory.createSipURI(&quot;Proxy&quot;,host);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; sipURI.setPort(por=
t);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Address address =
=3D
ProtocolObjects.addressFactory.createAddress(&quot;Proxy&quot;,sipURI);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; RecordRouteHeader =
recordRoute =3D
ProtocolObjects.headerFactory.createRecordRouteHeader(address);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; newRequest.addHead=
er(recordRoute);<br>
  <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // Via Header<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ViaHeader viaHeade=
r =3D
ProtocolObjects.headerFactory.createViaHeader(host, port, transport,
null);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; newRequest.addFirs=
t(viaHeader);<br>
  <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ClientTransaction =
ct =3D
sipProvider.getNewClientTransaction(newRequest);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <a href=3D"http://=
log.info" target=3D"_blank">log.info</a>(&quot;&gt;&gt;&gt; Client Transact=
ion Created state
&quot;+ct.getState()+&quot; ct: &quot;+ ct);<br>
  <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ct.setApplicationD=
ata(st);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ct.sendRequest();<=
br>
  <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp; } catch (Exception ex) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ex.printSta=
ckTrace();<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.exit=
(0);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; }<br>
  <br>
&nbsp;&nbsp;&nbsp; public void response(ResponseEvent evt) {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Response response =3D evt.getResponse=
();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ClientTransaction ct =3D evt.getClien=
tTransaction();<br>
  <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if ( response.getStatusCode() !=3D 10=
0 ) { <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; if ( ct !=3D null ) {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; try {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ServerTransaction =
st =3D (ServerTransaction)
ct.getApplicationData();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Response newResp =
=3D (Response) response.clone();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; newResp.removeFirs=
t(ViaHeader.NAME);<br>
  <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; st.sendResponse(ne=
wResp);<br>
  <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } catch (Exception=
 e){<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=
&nbsp; e.printStackTrace();<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; } else {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; System.out.println(&quot;Warni=
ng: responseInvite and ct =3D=3D null,
nothing done&quot;);&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
  <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; }<br>
---------------------------------------------------------------------------=
------------------------------------------------------<br>
  <br>
&nbsp;I have no idea about a possible solution, so any help will be very
apreciated.<br>
  <br>
&nbsp;Regards<br>
  <br>
&nbsp;C=E9sar.<br>
  </div></div><pre><pre><hr size=3D"4" width=3D"90%">
_______________________________________________
nist-sip mailing list
<a href=3D"mailto:[email protected]" target=3D"_blank">[email protected]=
ist.gov</a>
<a href=3D"http://www-x.antd.nist.gov/mailman/listinfo/nist-sip" target=3D"=
_blank">http://www-x.antd.nist.gov/mailman/listinfo/nist-sip</a>
</pre></pre>
</blockquote>
</div>

</blockquote></div><br>

------=_Part_928_33147679.1210255108188--

--===============1440614361282534208==
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

--===============1440614361282534208==--