[Home]

Summary:ASTERISK-19839: Not all hints are displaying status correctly
Reporter:uros gaber (urosh)Labels:
Date Opened:2012-05-04 03:17:11Date Closed:2012-05-04 08:48:31
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/Subscriptions
Versions:10.3.1 Frequency of
Occurrence
Frequent
Related
Issues:
Environment:Distributor ID: Ubuntu Description: Ubuntu 12.04 LTS Release: 12.04 Codename: precise Attachments:
Description:I noticed that for some phones hints are not correctly set. Here is example from extensions.conf:
####################
[BLF]
exten => 218,hint,SIP/218&SIP/2181
exten => 301,hint,SIP/301
####################
Asterisk shows this statuses:
*CLI > core show hints

   -= Registered Asterisk Dial Plan Hints =-
                   218@BLF                 : SIP/218&SIP/2181      State:Idle            Watchers  0
                   301@BLF                 : SIP/301               State:Idle            Watchers  0
----------------
- 2 hints registered
####################
But extension 301 is actually unreachable.
*CLI> sip show peer 301


 * Name       : 301
 Description  :
 Realtime peer: Yes, cached
 Secret       : <Set>
 MD5Secret    : <Not set>
 Remote Secret: <Not set>
 Context      : company_internal
 Subscr.Cont. : BLF
 Language     : si
 AMA flags    : Unknown
 Transfer mode: open
 CallingPres  : Presentation Allowed, Not Screened
 Callgroup    : 3
 Pickupgroup  : 3
 MOH Suggest  : default
 Mailbox      : 301@voicebox
 VM Extension : asterisk
 Call limit   : 100
 Max forwards : 0
 Dynamic      : Yes
 Callerid     : "Some One" <301>
 MaxCallBR    : 384 kbps
 Expire       : -1
 Insecure     : no
 Force rport  : No
 ACL          : No
 DirectMedACL : No
 T.38 support : No
 T.38 EC mode : Unknown
 T.38 MaxDtgrm: -1
 DirectMedia  : No
 PromiscRedir : No
 User=Phone   : No
 Video Support: Yes
 Text Support : No
 Ign SDP ver  : No
 Trust RPID   : No
 Send RPID    : Yes
 Subscriptions: Yes
 Overlap dial : No
 DTMFmode     : auto
 Timer T1     : 500
 Timer B      : 32000
 ToHost       :
 Addr->IP     : (null)
 Defaddr->IP  : (null)
 Prim.Transp. : UDP
 Allowed.Trsp : TCP,UDP
 Def. Username: 301
 SIP Options  : (none)
 Codecs       : (gsm|alaw|g729)
 Codec Order  : (alaw:20,g729:20,gsm:20)
 Auto-Framing :  No
 Status       : UNREACHABLE
 Useragent    :
 Reg. Contact :
 Qualify Freq : 60000 ms
 Sess-Timers  : Accept
 Sess-Refresh : uas
 Sess-Expires : 21600 secs
 Min-Sess     : 90 secs
 RTP Engine   : asterisk
 Parkinglot   :
 Use Reason   : No
 Encryption   : No
###########
In asterisk manager for phone 301 shows status correctly (4->Unavailable)
action: ExtensionState
Exten: 301
Context: BLF
ActionID: 1

Response: Success
ActionID: 1
Message: Extension Status
Exten: 301
Context: BLF
Hint: SIP/301
Status: 4

For some extensions asterisk manager shows correct stats for some not.
###########
The same settings in were working OK in asterisk 1.6.2.9.

Thank you.
Comments:By: Michael L. Young (elguero) 2012-05-04 08:22:46.546-0500

I am not quite understanding the issue.  Based on what you posted, it looks like the hint is working for 301.

What is it that is being expected?

By: uros gaber (urosh) 2012-05-04 08:30:49.900-0500

Extension 301 is unreachable, but Asterisk hint for that extension is set to Idle.
This behavior is happening to some of the extensions not all. I cannot find any connection for extension 301 that would explain this wrong behavior.
Expected behavior is if extension is unreachable that the hint for that extension is also set to unreachable.
I hope this is more understandable.

By: Matt Jordan (mjordan) 2012-05-04 08:47:51.276-0500

There are two definitions of 'status' at play here.

From the perspective of the SIP channel driver, 'status' refers to whether or not the peer in question can be contacted by any SIP message request.  This results in five possible states:
* UNREACHABLE - we cannot contact the peer
* LAGGED - we can contact the peer, but the response time is greater then the maximum allowed (defined in sip.conf)
* OK - we can contact the peer, and the response time is within the allowed tolerance
* UNKNOWN - either no contact has occurred yet, or we simply don't know the status
* Unmonitored - no monitoring is occurring of the peer

In this particular case, we're determining whether or not we can contact the peer.  That is not the same as an ExtensionState.  ExtensionState is protocol agnostic, which means that the concept of a SIP peer - and whether or not it can be 'contacted' - doesn't apply.  Hence why the mapping between the two values is not necessarily identical or 1 to 1.

By: Michael L. Young (elguero) 2012-05-04 08:48:33.420-0500

That is a bit clearer.

So, you are saying that "core show hints" doesn't display the proper state.  Is Asterisk Manager always correct?

Also, it looks like you are using realtime, correct?

By: uros gaber (urosh) 2012-05-07 02:38:23.203-0500

Hi. Yes, I am using realtime sip users, hints are in extensions.conf.
I noticed one more thing. When I restart asterisk this always happens. Hint is set correctly when I call extension.
Example:
;;;;;;;;;;Asterisk sip show peer ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
CLI> sip show peer 301
Peer 301 not found.

;;;;;;;;;;;Asterisk core show hint 301 WRONG STATUS it should be Unavailable ;;;;;;;
*CLI> core show hint 301
                   301@BLF                 : SIP/301               State:Idle            Watchers  0
1 hint matching extension 301

;;;;;;;;;;; Asterisk manager WRONG STATUS it should be Status: 4 ;;;;;;;;;;;;;;;;;;;
Asterisk Manager:
action: ExtensionState    
Exten: 301                
Context: BLF              
ActionID: 1              
                         
Response: Success        
ActionID: 1              
Message: Extension Status
Exten: 301                
Context: BLF
Hint: SIP/301
Status: 0
;;;;;;;; When I call extension 301 asterisk manager status is set correctly:;;;
Executing [****301@company_internal:1] Dial("SIP/219-0000003f", "SIP/301,30,m") in new stack [May  7 09:29:57] WARNING[31792]: app_dial.c:2218 dial_exec_full: Unable to create channel of type 'SIP' (cause 20 - Unknown)
== Everyone is busy/congested at this time (1:0/0/1)
-- Executing [****301@company_internal:2] Hangup("SIP/219-0000003f", "") in new stack
;;;;;;;;;;;;;sip show peer now as expected ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
CLI> sip show peer 301


 * Name       : 301
 Description  :
 Realtime peer: Yes, cached
 Secret       : <Set>
 MD5Secret    : <Not set>
 Remote Secret: <Not set>
 Context      : company_internal
 Subscr.Cont. : BLF
 Language     : si
 AMA flags    : Unknown
 Transfer mode: open
 CallingPres  : Presentation Allowed, Not Screened
 Callgroup    : 3
 Pickupgroup  : 3
 MOH Suggest  : default
 Mailbox      : 301@voicebox
 VM Extension : asterisk
 Call limit   : 100
 Max forwards : 0
 Dynamic      : Yes
 Callerid     : "User" <301>
 MaxCallBR    : 384 kbps
 Expire       : -1
 Insecure     : no
 Force rport  : No
 ACL          : No
 DirectMedACL : No
 T.38 support : No
 T.38 EC mode : Unknown
 T.38 MaxDtgrm: -1
 DirectMedia  : No
 PromiscRedir : No
 User=Phone   : No
 Video Support: Yes
 Text Support : No
 Ign SDP ver  : No
 Trust RPID   : No
 Send RPID    : Yes
 Subscriptions: Yes
 Overlap dial : No
 DTMFmode     : auto
 Timer T1     : 500
 Timer B      : 32000
 ToHost       :
 Addr->IP     : (null)
 Defaddr->IP  : (null)
 Prim.Transp. : UDP
 Allowed.Trsp : TCP,UDP
 Def. Username: 301
 SIP Options  : (none)
 Codecs       : (gsm|alaw|g729)
 Codec Order  : (alaw:20,g729:20,gsm:20)
 Auto-Framing :  No
 Status       : UNREACHABLE
 Useragent    :
 Reg. Contact :
 Qualify Freq : 60000 ms
 Sess-Timers  : Accept
 Sess-Refresh : uas
 Sess-Expires : 21600 secs
 Min-Sess     : 90 secs
 RTP Engine   : asterisk
 Parkinglot   :
 Use Reason   : No
 Encryption   : No
;;;;;;;;;;Asterisk hints WRONG STATUS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
CLI> core show hint 301
301@BLF                 : SIP/301               State:Idle            Watchers  0
1 hint matching extension 301
;;;;;;;;;;Asterisk manager CORRECT STATUS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
action: ExtensionState  
Exten: 301              
Context: BLF            
ActionID: 1              
                       
Response: Success        
ActionID: 1              
Message: Extension Status
Exten: 301              
Context: BLF            
Hint: SIP/301            
Status: 4                




By: uros gaber (urosh) 2012-05-09 06:16:57.114-0500

Hello again. I found the what is causing problem with hints and i think that this bug shouldn't be closed.
I use realtime sip peers and wrong hint statuses were been shown for phones that had "ipaddr" column in sip table set to 0.0.0.0 . When I deleted 0.0.0.0 or update table with "UPDATE voip.conf_sip set ipaddr='' where ipaddr='0.0.0.0';" problem went away.
:)