Re: Could Any body suggest me an SIP programming interface please?
"becky mcelroy" <[email protected]> Tue, 4 Dec 2007 09:34:20 -0500
| Newsgroups | gmane.comp.voip.nist-sip,gmane.comp.java.woodstock.user |
|---|---|
| Message-ID | <[email protected]> |
--===============0161034890721885702==
Content-Type: multipart/alternative;
boundary="----=_Part_6146_18029854.1196778860802"
------=_Part_6146_18029854.1196778860802
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hi,
SipUnit might help you (http://www.cafesip.org/projects/sipunit/index.html).
You would have to learn and use the JAIN-SIP API to handle your customized
authentication messaging, but SipUnit would give you a ready-made framework
to execute your auth scheme at both sides - User Agent and Proxy Server -
running on the same or different machines. You'll need to use the low level
SipUnit methods on the SipSession class to do what you want. The download
contains examples.
For example, if you look at the TestNoProxy.java example code and see the
method testSendInviteWithRouteHeader() - it uses the low level SipUnit API
and the JAIN-SIP API to implement a SIP message exchange between two sides,
party A and party B (in your case it will be your special REGISTER instead
of INVITE and you may want to separate these endpoints and run them on
different machines).
public void setUp()
{
// creates stack instance
sipStack = new SipStack(testProtocol, myPort, properties);
// creates User A
ua = sipStack.createSipPhone(" sip:[email protected]");
}
public void testSendInviteWithRouteHeader()
{
...
// Lines of code where User A builds and sends an INVITE, checks
response:
AddressFactory addr_factory = ua.getParent
().getAddressFactory();
HeaderFactory hdr_factory = ua.getParent().getHeaderFactory();
Request invite = ua.getParent().getMessageFactory().createRe
quest(
"INVITE sip:[email protected] SIP/2.0 ");
invite.addHeader(ua.getParent
().getSipProvider().getNewCallId());
invite.addHeader(hdr_factory.createCSeqHeader((long)1,
Request.INVITE));
...
SipTransaction trans = ua.sendRequestWithTransaction(invite,
false,
null);
EventObject response_event = ua.waitResponse (trans, 10000);
// wait for response - this is a blocking call
// response received or timeout occurred:
assertNotNull(ua.format(), response_event);
assertFalse("Operation timed out",
response_event instanceof TimeoutEvent);
// a response was received, check for the right response
assertEquals("Should have received TRYING", Response.TRYING ,
((ResponseEvent) response_event).getResponse()
.getStatusCode());
// Lines of code where User B waits for a request from User A and sends a
standard response:
SipPhone ub = sipStack.createSipPhone("sip:[email protected]");
ub.listenRequestMessage();
RequestEvent inc_req = ub.waitRequest (30000);
// wait for request - this is a blocking call
// request received or timeout occurred:
assertNotNull(ub.format(), inc_req);
// request was received, send standard TRYING response
Response response = ub.getParent ().getMessageFactory()
.createResponse(Response.TRYING, inc_req.getRequest());
SipTransaction transb = ub.sendReply(inc_req, response);
assertNotNull(ub.format(), transb);
// trying was response sent
}
Hope this helps.
Becky
On Dec 3, 2007 1:19 PM, Samira Salam <[email protected]> wrote:
> Hi ,
> As a part of my MS project I proposed a 3-party authentication protocol
> which can be used in SIP too. for SIP. The proxy server utilizes this
> protocol to authenticate the UC's Invite,using the Registrar server. Now, I
> have to estimate the totoal overhead of the scheme on a normal SIP call. I
> searched dozens of SIP, UMTS, GSM related papers to find a simulator or
> emulator which could be used to to achive the goal but I couldn't get any
> solutions as I need to consider execution of the RSA,AES and SHA on the
> agent's processor, I also need the solution to answer me with not too much
> programming due to my time constraints. I browsed the Resirocate project
> docs but I don't think then can answer me in time. I am also not sure
> whether SIPp, MS LIve communication server and SERcan help me? Could you
> please suggest me any rapid solutions? Any simulation techniques?any
> piece of software or programmining interface? By the way I am a little
> familiar with opnet as I did a tiny project with it. Doest it help me?
>
> Thanks in advance.
> Samira.
>
> ------------------------------
> Never miss a thing. Make Yahoo your homepage.<http://us.rd.yahoo.com/evt=51438/*http://www.yahoo.com/r/hs>
>
> _______________________________________________
> nist-sip mailing list
> [email protected]
> http://www-x.antd.nist.gov/mailman/listinfo/nist-sip
>
>
------=_Part_6146_18029854.1196778860802
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Hi,<br><br>SipUnit might help you (<a href=3D"http://www.cafesip.org/projec=
ts/sipunit/index.html" target=3D"_blank">http://www.cafesip.org/projects/si=
punit/index.html</a>).
You would have to learn and use the JAIN-SIP API to handle your
customized authentication messaging, but SipUnit would give you a
ready-made framework to execute your auth scheme at both sides - User
Agent and Proxy Server - running on the same or different machines.
You'll need to use the low level SipUnit methods on the SipSession
class to do what you want. The download contains examples.
<br><br>For example, if you look at the TestNoProxy.java example code
and see the method testSendInviteWithRouteHeader() - it uses the low
level SipUnit API and the JAIN-SIP API to implement a SIP message
exchange between two sides, party A and party B (in your case it will
be your special REGISTER instead of INVITE and you may want to separate
these endpoints and run them on different machines). <br><br>public void se=
tUp()<br>{<br> // creates stack instance<br> sipSta=
ck =3D new SipStack(testProtocol, myPort, properties);<br><br> =
// creates User A<br> ua =3D=20
sipStack.createSipPhone("<a href=3D"mailto:sip:[email protected]" target=
=3D"_blank">
sip:[email protected]</a>");<br>}<br><br>public void testSendInviteWithRou=
teHeader()<br>{<br>...<br> // Lines of code where User A builds=
and sends an INVITE, checks response:<br><br>  =
; AddressFactory addr_factory =3D=20
ua.getParent().getAddressFactory();<br> =
HeaderFactory hdr_factory =3D ua.getParent()=
.getHeaderFactory();<br><br>  =
; Request invite =3D ua.getParent().getMessageFactory().c=
reateRe<div id=3D"1fwm" class=3D"ArwC7c ckChnd">
quest(<br>  =
; "INVITE=20
<a href=3D"mailto:sip:[email protected]" target=3D"_blank">sip:[email protected]<=
/a> SIP/2.0 ");<br><br>  =
; invite.addHeader(ua.getParent().getSipProvider().getNew=
CallId());<br> &=
nbsp; invite.addHeader(hdr_factory.createCSeqHeader((long)1,=20
Request.INVITE));<br> =
...<br><br> &nb=
sp; SipTransaction trans =3D ua.sendRequestWithTransaction(invi=
te, false,<br> &=
nbsp; null);<br>  =
; <br> &nb=
sp; EventObject response_event =
=3D ua.waitResponse
(trans, 10000);<br> &n=
bsp; // wait for response - this is a blocking call<br><br> &nbs=
p; // response receiv=
ed or timeout occurred:<br> =
assertNotNull(ua.format(), response_event);<br> &nb=
sp; assertFalse("=
;Operation timed out",
<br>  =
; response_event instanceof Timeo=
utEvent);<br><br> &nbs=
p; // a response was received, check for the right response<br> =
assertEquals(&=
quot;Should have received TRYING", Response.TRYING
,<br> &nbs=
p; ((ResponseEvent) response_even=
t).getResponse()<br> &=
nbsp; &nbs=
p; .getStatusCode());<br><br><br><br>// Lines=
of code where User B waits for a request from User A and sends a standard =
response:
<br><br> =
SipPhone ub =3D sipStack.createSipPhone("<a href=3D"mailto:sip:becky@n=
ist.gov" target=3D"_blank">sip:[email protected]</a>");<br><br> &nbs=
p; ub.listenRequestMe=
ssage(); <br> &n=
bsp; RequestEvent inc_req =3D=20
ub.waitRequest
(30000);<br>
// wait =
for request - this is a blocking call<br><br>
// reque=
st received or timeout occurred:<br> &nb=
sp; assertNotNull(ub.format(), inc_req);<br><br>&nb=
sp; // request =
was received, send standard TRYING response<br> &nbs=
p; Response response =3D ub.getParent
().getMessageFactory()<br> &=
nbsp; .createRe=
sponse(Response.TRYING, inc_req.getRequest());<br> &=
nbsp; SipTransaction transb =3D ub.send=
Reply(inc_req, response);<br> &nbs=
p; assertNotNull(ub.format(), transb);
<br> // t=
rying was response sent<br><br>}<br><br><br>Hope this helps.<br>Becky</div>=
<br><br><div class=3D"gmail_quote">On Dec 3, 2007 1:19 PM, Samira Salam <=
;<a href=3D"mailto:[email protected]">[email protected]
</a>> 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;=
">Hi ,<br>As a part of my MS project I proposed a 3-party authentication pr=
otocol which can be used in SIP too. for SIP. The proxy server utilizes thi=
s protocol to authenticate the UC's Invite,using the Registrar se=
rver. Now, I have to estimate the totoal overhead of the scheme on a normal=
SIP call. I searched dozens of SIP, UMTS, GSM related pa=
pers to find a simulator or emulator which could be used to to achive the g=
oal but I couldn't get any solutions as I need to consider execution of=
the RSA,AES and SHA on the agent's processor, I also need the solution=
to answer me with not too much programming due to my time constraints.&nbs=
p;I browsed the Resirocate project docs but I don't think t=
hen can answer me in time. I am also not sure whether SIPp, MS LIve communi=
cation server and SERcan help me? Could you please suggest =
me any rapid solutions? Any simulation techniques?any=
piece of software or
programmining interface? By the way I am a little familiar with opnet as I=
did a tiny project with it. Doest it help me?<br> <br>Thanks in advan=
ce.<br><font color=3D"#888888">Samira. </font><p></p><div class=3D"WgoR0d">=
=20
<hr size=3D"1">Never miss a thing. <a href=3D"http://us.rd.yahoo.com=
/evt=3D51438/*http://www.yahoo.com/r/hs" target=3D"_blank"> Make Yahoo your=
homepage.</a>
</div><br>_______________________________________________<br>nist-sip maili=
ng list<br><a href=3D"mailto:[email protected]">[email protected]=
</a><br><a href=3D"http://www-x.antd.nist.gov/mailman/listinfo/nist-sip" ta=
rget=3D"_blank">
http://www-x.antd.nist.gov/mailman/listinfo/nist-sip</a><br><br></blockquot=
e></div><br>
------=_Part_6146_18029854.1196778860802--
--===============0161034890721885702==
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
--===============0161034890721885702==--