[asterisk-bugs] [Asterisk 0015624]: res_ais, communication ok, but wrong state send and receive.

Asterisk Bug Tracker noreply at bugs.digium.com
Fri Jul 31 09:33:05 CDT 2009


The following issue has been SUBMITTED. 
====================================================================== 
https://issues.asterisk.org/view.php?id=15624 
====================================================================== 
Reported By:                ffossard
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   15624
Category:                   Resources/General
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
Asterisk Version:           1.6.1.1 
Regression:                 No 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2009-07-31 09:33 CDT
Last Modified:              2009-07-31 09:33 CDT
====================================================================== 
Summary:                    res_ais, communication ok, but wrong state send and
receive.
Description: 
I try to use res_ais for sharing devstate between two Asterisk.
Servers communicate, but the devstate don’t change on « other »
server, because the first server sends a wrong state.


There is two identical test servers, vm-test1 and vm-test2.

Configuration files :

vm-test1:~# cat /etc/asterisk/ais.conf
[device_state]
type=event_channel
publish_event=device_state
subscribe_event=device_state

vm-test2:~# cat /etc/asterisk/ais.conf
[device_state]
type=event_channel
publish_event=device_state
subscribe_event=device_state
 

vm-test1:~# cat /etc/asterisk/extensions.conf
[general]
static=yes
writeprotect=no
autofallthrough=yes
clearglobalvars=no
language=fr

[globals]

[devstate_test]
exten => 1234,hint,Custom:mystate

exten => set_inuse,1,Set(DEVICE_STATE(Custom:mystate)=INUSE)
exten => set_not_inuse,1,Set(DEVICE_STATE(Custom:mystate)=NOT_INUSE)
exten => check,1,NoOp(Custom:mystate is ${DEVICE_STATE(Custom:mystate)})

 

vm-test2:~# cat /etc/asterisk/extensions.conf
[general]
static=yes
writeprotect=no
autofallthrough=yes
clearglobalvars=no
language=fr

[globals]

[devstate_test]
exten => 1234,hint,Custom:mystate
 
exten => set_inuse,1,Set(DEVICE_STATE(Custom:mystate)=INUSE)
exten => set_not_inuse,1,Set(DEVICE_STATE(Custom:mystate)=NOT_INUSE)
exten => check,1,NoOp(Custom:mystate is ${DEVICE_STATE(Custom:mystate)})
 


After, I verify « connection » between servers :

vm-test1:~# asterisk -vvvvvvvvvvvvvr
vm-test1*CLI> ais clm show members
vm-test1*CLI>
=============================================================
=== Cluster Members =========================================
=============================================================
===
=== ---------------------------------------------------------
=== Node Name: 10.78.99.253
=== ==> ID: 0xfd634e0a
=== ==> Address: 10.78.99.253
=== ==> Member: Yes
=== ---------------------------------------------------------
===
=== ---------------------------------------------------------
=== Node Name: 10.78.99.252
=== ==> ID: 0xfc634e0a
=== ==> Address: 10.78.99.252
=== ==> Member: Yes
=== ---------------------------------------------------------
===
=============================================================
 

vm-test1*CLI> ais evt show event channels
vm-test1*CLI>
=============================================================
=== Event Channels ==========================================
=============================================================
===
=== ---------------------------------------------------------
=== Event Channel Name: device_state
=== ==> Publishing Event Type: device_state
=== ==> Subscribing to Event Type: device_state
=== ---------------------------------------------------------
===
=============================================================

vm-test1*CLI> core show settings
Entity ID:                   00:0c:29:ef:e5:63

 
 

vm-test2:~# asterisk -vvvvvvvvvvvvvr
vm-test2*CLI> ais clm show members
vm-test2*CLI>
=============================================================
=== Cluster Members =========================================
=============================================================
===
=== ---------------------------------------------------------
=== Node Name: 10.78.99.252
=== ==> ID: 0xfc634e0a
=== ==> Address: 10.78.99.252
=== ==> Member: Yes
=== ---------------------------------------------------------
===
=== ---------------------------------------------------------
=== Node Name: 10.78.99.253
=== ==> ID: 0xfd634e0a
=== ==> Address: 10.78.99.253
=== ==> Member: Yes
=== ---------------------------------------------------------
===
=============================================================
 
 
 
vm-test2*CLI> ais evt show event channels
vm-test2*CLI>
=============================================================
=== Event Channels ==========================================
=============================================================
===
=== ---------------------------------------------------------
=== Event Channel Name: device_state
=== ==> Publishing Event Type: device_state
=== ==> Subscribing to Event Type: device_state
=== ---------------------------------------------------------
===
=============================================================
 
vm-test2*CLI> core show settings
Entity ID:                   00:0c:29:e9:1b:81
 
 


vm-test1*CLI> core show hints
vm-test1*CLI>
    -= Registered Asterisk Dial Plan Hints =-
                   1234 at devstate_test       : Custom:mystate       
State:Idle     Watchers  0
----------------
1 hints registered

 

vm-test2*CLI> core show hints
vm-test2*CLI>
    -= Registered Asterisk Dial Plan Hints =-
                   1234 at devstate_test       : Custom:mystate     
State:Idle     Watchers  0
----------------
1 hints registered

 
Same devstate in same state, ok.

I modify the devstate on first server:

vm-test1*CLI> console dial set_inuse at devstate_test
[Jul 23 17:39:56] WARNING[3112]: chan_oss.c:492 setformat: Unable to
re-open DSP device /dev/dsp: No such file or directory
[Jul 23 17:39:56] DEBUG[3119]: pbx.c:3179 pbx_extension_helper: Launching
'Set'
    -- Executing [set_inuse at devstate_test:1] Set("Console/dsp",
"DEVICE_STATE(Custom:mystate)=INUSE") in new stack
[Jul 23 17:39:56] NOTICE[3112]: console_video.c:133 console_video_start:
voice only, console video support not present
    -- Auto fallthrough, channel 'Console/dsp' status is 'UNKNOWN'
[Jul 23 17:39:56] DEBUG[3119]: channel.c:1549 ast_softhangup_nolock:
Soft-Hanging up channel 'Console/dsp'
[Jul 23 17:39:56] DEBUG[3119]: channel.c:1644 ast_hangup: Hanging up
channel 'Console/dsp'
 << Hangup on console >>
[Jul 23 17:39:56] DEBUG[3087]: devicestate.c:680 handle_devstate_change:
Processing device state change for 'Custom:mystate'
[Jul 23 17:39:56] DEBUG[3087]: devicestate.c:637 process_collection:
Aggregate devstate result is 1
[Jul 23 17:39:56] DEBUG[3087]: devicestate.c:659 process_collection:
Aggregate state for device 'Custom:mystate' has changed to 'Not in use'
[Jul 23 17:39:56] DEBUG[3066]: ais/evt.c:184 ast_event_cb: Got an event to
forward
[Jul 23 17:39:56] DEBUG[3066]: ais/evt.c:239 ast_event_cb: Returning here
(event_free)
[Jul 23 17:39:56] DEBUG[3066]: ais/evt.c:184 ast_event_cb: Got an event to
forward
[Jul 23 17:39:56] DEBUG[3087]: devicestate.c:680 handle_devstate_change:
Processing device state change for 'Console/dsp'
[Jul 23 17:39:56] DEBUG[3087]: devicestate.c:637 process_collection:
Aggregate devstate result is 1
[Jul 23 17:39:56] DEBUG[3087]: devicestate.c:659 process_collection:
Aggregate state for device 'Console/dsp' has changed to 'Not in use'
[Jul 23 17:39:56] DEBUG[3066]: ais/evt.c:239 ast_event_cb: Returning here
(event_free)

 
vm-test1*CLI> core show hints
vm-test1*CLI>
    -= Registered Asterisk Dial Plan Hints =-
                   1234 at devstate_test       : Custom:mystate       
State:InUse           Watchers  0
----------------
- 1 hints registered

 

Ok for server test1, but strange message « Aggregate state for device
'Custom:mystate' has changed to 'Not in use' »
 

At the same time, on serveur vm-test2 :

vm-test2*CLI>
[Jul 23 17:38:40] DEBUG[7589]: devicestate.c:680 handle_devstate_change:
Processing device state change for 'Custom:mystate'
[Jul 23 17:38:40] DEBUG[7589]: devicestate.c:637 process_collection:
Aggregate devstate result is 1
[Jul 23 17:38:40] DEBUG[7589]: devicestate.c:659 process_collection:
Aggregate state for device 'Custom:mystate' has changed to 'Not in use'
[Jul 23 17:38:40] DEBUG[7572]: ais/evt.c:184 ast_event_cb: Got an event to
forward
[Jul 23 17:38:40] DEBUG[7572]: ais/evt.c:188 ast_event_cb: Returning here
[Jul 23 17:38:40] DEBUG[7572]: ais/evt.c:184 ast_event_cb: Got an event to
forward
[Jul 23 17:38:40] DEBUG[7572]: ais/evt.c:188 ast_event_cb: Returning here
[Jul 23 17:38:40] DEBUG[7589]: devicestate.c:680 handle_devstate_change:
Processing device state change for 'Console/dsp'
[Jul 23 17:38:40] DEBUG[7589]: devicestate.c:637 process_collection:
Aggregate devstate result is 1
[Jul 23 17:38:40] DEBUG[7589]: devicestate.c:659 process_collection:
Aggregate state for device 'Console/dsp' has changed to 'Not in use'
 

vm-test2*CLI> core show hints
vm-test2*CLI>
    -= Registered Asterisk Dial Plan Hints =-
                   1234 at devstate_test       : Custom:mystate        
State:Idle            Watchers  0
----------------
-  1 hints registered



Same wrong state is receive, then no change.

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2009-07-31 09:33 ffossard       New Issue                                    
2009-07-31 09:33 ffossard       Asterisk Version          => 1.6.1.1         
2009-07-31 09:33 ffossard       Regression                => No              
2009-07-31 09:33 ffossard       SVN Branch (only for SVN checkouts, not tarball
releases) => N/A             
======================================================================




More information about the asterisk-bugs mailing list