开发者

SIP UAS asks for OPTIONS

开发者 https://www.devze.com 2023-01-01 22:05 出处:网络
I have UAC that registers to a UAS, after registration the UAS sends me an OPTIONS request, what should I answer it?

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:310@hostName.hn 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:Unknown@xx.xx.xx.xx>;tag=as66cf26df
To: <sip:310@hostName.hn>
Contact: <sip:Unknown@xx.xx.xx.xx>
Call-ID: 28803f304694e9ac61f6455a0b71795e@xx.xx.xx.xx
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:Unknown@xx.xx.xx.xx>;tag=as66cf26df
To: <sip:310@hostName.hn>
CSeq: 102 OPTIONS
Call-ID: 28803f304694e9ac61f6455a0b71795e@xx.xx.xx.xx
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.


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号