[reSIProcate] I hope some people are still around to read this.
List developers,
I'm working on a document called "Getting started with resip". I have
part of
it written right now, but it reflects a sample of the things I propose
will make
the resip stack a lot more useful to a lot more people.
I want to post this to the list for several reasons... 1) it gives
an alternate
approach to using resip. 2) it is more Mac based. 3) it shows the
call sequence
and how to put the SIP objects together. Something the WIKI just doesn't
have.
I have only REGISTER command documented. I need help in how to use the
handlers, is anyone willing to work with me on this?
First off, I'm using X-Lite to help me analyse what a SIP client really
should do. So this information is based on what X-Lite does, but I need
to do exactly the same.
Here are things I need to know... when I first try to register with our
SIP server, I get back a 401 error... this is because ALWAYS on the first
try, we cannot know in advance what session key to use, so we first make
our first attempt to register. But, in the 401 error message we get back,
we are getting additional information. IE:
WWW-Authenticate: Digest algorithm=MD5, realm="whitephone.com",
nonce="43151c9242d68c90", opaque="01c3900243d79c92"
Content-Length: 0
It is this information we now use with our 2nd REGISTER command. X-Lite
somehow then
adds these fields to the 2nd REGISTER message...
Authorization: Digest
username="u354",realm="whitephone.com",nonce="43151c9242d68c90",response="e97163ae2810dd4e701938834ed3bc13",uri="sip:whitephone.com",algorithm=MD5,opaque="01c3900243d79c92"
My first question, which of these handlers get called when I get the
401 error as returned?
Is it: onRequestRetry, or onFailure?
The 2nd question... I assume that in one of these callbacks, I'm
supposed to put in code that
creates the "Authorization:" header field which I use in my 2nd attempt
to register. Is that
correct? or does the resip automatically do this by itself? And if
it doesn't, then could
someone write just a few simple lines of example code, showing me how
to "create" and
"add" the "Authorization:" digest and set the digest variables like what
you see above...
IE: I need to add a "nonce" parameter, and put in it's value....
how do I do that?
Same for the rest....
I think someone should also "map" the 4XX error codes into the specific
handlers that
are supposed to deal with them. Ie:
Register:
401 ---> onFailure (or whatever it really is)
200 ---> onSuccess
and do this for ALL applicable handlers. There is NO WAY anyone could
make any kind of
connection like this?
John