tags:

views:

89

answers:

2

Hey,

I have UAC that registers to a UAS, after registration the UAS sends me an OPTIONS request, what should I answer it?

only the audio media streams?

Update I:

Allow me to explain myself better... if I want to invite someone to a session I USE the INVITE method and negotiate the media then, for that specific session. But once I register to the server, and it asks me for OPTIONS, then what should I supply, everything my client supports? once I answer it would it deduce that every INVITE I would request from now on would use these medias? or would I need to supply new media with every request?

Update II:

Hi Wiz, I was in the process of building a negotiation system, so i tried it out and replied the UAS here is the sort dialog we had:

OPTIONS sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP xx.xx.xx.xx:5060;branch=z9hG4bK45b197cb;rport=5060;received=xx.xx.xx.xx
From: "Unknown" <sip:[email protected]>;tag=as66cf26df
To: <sip:[email protected]>
Contact: <sip:[email protected]>
Call-ID: [email protected]
CSeq: 102 OPTIONS
User-Agent: Freeswitch 1.2.3
Max-Forwards: 70
Date: Sat, 05 Jun 2010 12:06:43 GMT
Allow: INVITE,ACK,CANCEL,OPTIONS,BYE,REFER,SUBSCRIBE,NOTIFY,INFO
Supported: replaces
Content-Length: 0

OPTIONS In Response To 102:

SIP/2.0 200 OK
Via: SIP/2.0/UDP xx.xx.xx.xx:5060;branch=z9hG4bK45b197cb;rport=5060;received=xx.xx.xx.xx
From: "Unknown" <sip:[email protected]>;tag=as66cf26df
To: <sip:[email protected]>
CSeq: 102 OPTIONS
Call-ID: [email protected]
Allow: INVITE,CANCEL,ACK,BYE,OPTIONS
Content-Type: application/sdp
Content-Length: 248

v=0
o=310 4515233118481497946 4515233118481497946 IN IP4 10.0.0.1
s=-
i=Nu-Art Software - TacB0sS VoIP information
c=IN IP4 10.0.0.1
m=audio 40000 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000

This response caused the server to stop sending me the options request, does this means I can only use these parameters with the server now? or as you said, it does not matter?

Thanks, Adam.

+2  A: 

You should return the same status as you would for an invite.

Besides your SDP (again same as an invite would) you should use Allow, Accept, Accept-Encoding, Accept-Language, and Supported header fields.

Read more: http://www.faqs.org/rfcs/rfc3261.html#ixzz0pnjJjKfl

stimpie
Ok, that I could get from the RFC's but I was wondering if I 3 types of media that my client support, audio video and fax... should I supply them all? and if I have a 100 media types, supply them all, or just the ones for the session (90 of them)?
TacB0sS
Yes. Return all those types of media you'd prefer to accept. So if you have 100, and you really like 10, return those 10. (By the way, why no support for text? RFC 5194)
Frank Shearar
I designed it in a way that the negotiation is an interface, and each media I would like to transfer must implement it, so adding new features should be relatively simple. Thank you for bringing this to my attention by the way, are there other things I could transfer over IP?
TacB0sS
Well, you don't transfer anything over SIP - it's a signalling protocol - but you can use it for pretty much anything. There're RFCs around file transfer, for instance. Text over IP's just close to my heart, because it's been the primary focus of my job for the last several years.
Frank Shearar
+1  A: 

An OPTIONS request can be used to query a SIP device for capabilities so yes by the letter of the law you should return all supported codecs in the OPTIONS response SDP.

One thing to keep in mind is that some user agents, particularly Asterisk, use OPTIONS requests as a keep-alive mechanism and they don't actually care about the response and in fact simply drop it. If processing an OPTIONS request is going to to cost you a bit of processing time keep that fact in mind.

On my own SIP Proxy I return a 405 Method Not Supported for OPTIONS requests and have never had any side effects.

sipwiz
You see, I was wondering just that... I receive 5 OPTIONS requests every couple of seconds. exactly 5...I'll try what you suggested.
TacB0sS