[asterisk-users] get SIP extension status without calling it

Raj Jain rj2807 at gmail.com
Sun Dec 2 15:33:04 CST 2007


In theory, UAs that respond to OPTIONS and INVITE differently are "broken".
Below is a quote from section 11.2 of RFC 3261.

   The response to an OPTIONS is constructed using the standard rules
   for a SIP response as discussed in Section 8.2.6.  The response code
   chosen MUST be the same that would have been chosen had the request
   been an INVITE.  That is, a 200 (OK) would be returned if the UAS is
   ready to accept a call, a 486 (Busy Here) would be returned if the
   UAS is busy, etc.  This allows an OPTIONS request to be used to
   determine the basic state of a UAS, which can be an indication of
   whether the UAS will accept an INVITE request.

In practice, as you're seeing it yourself most UA implementations treat
OPTIONS as a health-check and capability discovery mechanism. 
 
- Raj


> -----Original Message-----
> From: asterisk-users-bounces at lists.digium.com 
> [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Vieri
> Sent: Sunday, December 02, 2007 12:57 PM
> To: Asterisk Users Mailing List - Non-Commercial Discussion
> Subject: Re: [asterisk-users] get SIP extension status 
> without calling it
> 
> I tried another popular user agent: X-Lite.
> 
> I dialed *78 which in */FreePBX turns DND on AND I pushed the 
> DND button on the softphone.
> 
> # asterisk -vvvr
> CLI> database show dnd
> /DND/4053                                         :
> YES
> 
> Despite all this when I send an OPTIONS request I always get 
> a "200 ok" reply.
> 
> Is X-Lite also "broken" with respect to the SIP RFC?
> Or am I doing things wrong?
> 
> # ./options -1 -a --method OPTIONS
> sip:4053 at 10.215.147.240:6486
> SIP/2.0 200 OK
> Via: SIP/2.0/UDP
> 10.215.144.27:38102;branch=z9hG4bKZDm0j0KD5BSBQ
> Contact: <sip:10.215.147.240:6486>
> To: <sip:4053 at 10.215.147.240>;tag=681c6278
> From: <sip:10.215.144.27>;tag=Z1QHmBt52Dp1Q
> Call-ID: 6b9f7f35-1ba1-122b-d4b7-00c09f10e472
> CSeq: 92190473 OPTIONS
> Accept: application/sdp
> Accept-Language: en
> Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, 
> MESSAGE, SUBSCRIBE, INFO
> User-Agent: X-Lite release 1011s stamp 41150
> Content-Length: 0
> 
> 
> CLI> sip show peer 4053
> INF-VOIP*CLI>
> 
>   * Name       : 4053
>   Secret       : <Set>
>   MD5Secret    : <Not set>
>   Context      : from-internal
>   Subscr.Cont. : <Not set>
>   Language     : es
>   AMA flags    : Unknown
>   CallingPres  : Presentation Allowed, Not Screened
>   Callgroup    : 2
>   Pickupgroup  : 2
>   Mailbox      : 4053 at device
>   VM Extension : asterisk
>   LastMsgsSent : 0/0
>   Call limit   : 0
>   Dynamic      : Yes
>   Callerid     : "device" <4053>
>   Expire       : 3597
>   Insecure     : no
>   Nat          : Always
>   ACL          : No
>   CanReinvite  : No
>   PromiscRedir : No
>   User=Phone   : No
>   Trust RPID   : No
>   Send RPID    : No
>   DTMFmode     : rfc2833
>   LastMsg      : 0
>   ToHost       :
>   Addr->IP     : 10.215.147.240 Port 6486
>   Defaddr->IP  : 0.0.0.0 Port 5060
>   Def. Username: 4053
>   SIP Options  : (none)
>   Codecs       : 0x400 (ilbc)
>   Codec Order  : (ilbc)
>   Status       : OK (169 ms)
>   Useragent    : X-Lite release 1011s stamp 41150
>   Reg. Contact :
> sip:4053 at 10.215.147.240:6486;rinstance=ff64e47c4f35bdef
> 
> 
> 
>      
> ______________________________________________________________
> ______________________
> Never miss a thing.  Make Yahoo your home page. 
> http://www.yahoo.com/r/hs
> 
> 
>       
> ______________________________________________________________
> ______________________
> Be a better pen pal. 
> Text or chat with friends inside Yahoo! Mail. See how.  
> http://overview.mail.yahoo.com/
> 
> _______________________________________________
> --Bandwidth and Colocation Provided by http://www.api-digital.com--
> 
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users




More information about the asterisk-users mailing list