[asterisk-bugs] [JIRA] (ASTERISK-26627) func_global: Provide better documentation for usage of SHARED

Joshua Colp (JIRA) noreply at issues.asterisk.org
Mon Nov 28 06:27:12 CST 2016


     [ https://issues.asterisk.org/jira/browse/ASTERISK-26627?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Joshua Colp updated ASTERISK-26627:
-----------------------------------

    Severity: Minor  (was: Major)

> func_global: Provide better documentation for usage of SHARED
> -------------------------------------------------------------
>
>                 Key: ASTERISK-26627
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-26627
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Functions/func_global
>    Affects Versions: 14.2.0
>         Environment: Linux 4.8.0-27-generic #29-Ubuntu SMP Thu Oct 20 21:03:13 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
>            Reporter: Jonathan Harris
>            Severity: Minor
>         Attachments: debug_log_123456.txt
>
>
> For the following code:
> {code}
> [svtest1]
> exten => s,1,Answer()
>     same => n,Verbose(1,Answered channel:${CHANNEL})
>     same => n,Dial(Local/s at svtest2,,g)
>     same => n,Verbose(1,***In channel:${CHANNEL} sharedVar: ${SHARED(sharedVar,Local/s at svtest2)} )
>     same => n,Hangup()  
>     
> [svtest2]
> exten => s,1,NoOp()
>     same => n,Set(SHARED(sharedVar,Local/s at svtest2)="I have been set in svtest2")
>     same => n,Verbose(1,***In channel:${CHANNEL} sharedVar: ${SHARED(sharedVar,Local/s at svtest2)})
>     same => n,Answer() 
>     same => n,Hangup()   
> {code}
> I get the following output, dialled 4 times from console, 4 times from a normal PJSIP softphone:
> Of the 8 attempts. in only 3 instances the variable survives the journey back to the parent channel, and seemingly randomly, too.
> Am I using it incorrectly?
> {code}
> CLI> originate local/s at svtest1 application echo
>  Answered channel:Local/s at svtest1-00000027;2
>  ***In channel:Local/s at svtest2-00000028;2 sharedVar: "I have been set in svtest2"
>  ***In channel:Local/s at svtest1-00000027;2 sharedVar:
> CLI> originate local/s at svtest1 application echo
>  Answered channel:Local/s at svtest1-00000029;2
>  ***In channel:Local/s at svtest2-0000002a;2 sharedVar: "I have been set in svtest2"
>  ***In channel:Local/s at svtest1-00000029;2 sharedVar:
> CLI> originate local/s at svtest1 application echo
>  Answered channel:Local/s at svtest1-0000002b;2
>  ***In channel:Local/s at svtest2-0000002c;2 sharedVar: "I have been set in svtest2"
>  ***In channel:Local/s at svtest1-0000002b;2 sharedVar: "I have been set in svtest2"
> CLI> originate local/s at svtest1 application echo
>  Answered channel:Local/s at svtest1-0000002d;2
>  ***In channel:Local/s at svtest2-0000002e;2 sharedVar: "I have been set in svtest2"
>  ***In channel:Local/s at svtest1-0000002d;2 sharedVar:
>  Answered channel:PJSIP/6001-00000007
>  ***In channel:Local/s at svtest2-0000002f;2 sharedVar: "I have been set in svtest2"
>  ***In channel:PJSIP/6001-00000007 sharedVar: "I have been set in svtest2"
>  Answered channel:PJSIP/6001-00000008
>  ***In channel:Local/s at svtest2-00000030;2 sharedVar: "I have been set in svtest2"
>  ***In channel:PJSIP/6001-00000008 sharedVar:
>  Answered channel:PJSIP/6001-00000009
>  ***In channel:Local/s at svtest2-00000031;2 sharedVar: "I have been set in svtest2"
>  ***In channel:PJSIP/6001-00000009 sharedVar:
>  Answered channel:PJSIP/6001-0000000a
>  ***In channel:Local/s at svtest2-00000032;2 sharedVar: "I have been set in svtest2"
>  ***In channel:PJSIP/6001-0000000a sharedVar: "I have been set in svtest2"
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list