Displaying 5 results from an estimated 5 matches for "sharedvar".
2016 Nov 27
2
Non-global variable that follows channel?
...n to passing variables BACK from to the parent channel.
However, it does not seem to be very reliable.
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 svtes...
2016 Nov 27
2
Non-global variable that follows channel?
...hat explanation.
I do think the docs at
https://wiki.asterisk.org/wiki/display/AST/Asterisk+14+Function_SHARED
could do with more clarification.
BTW, there were a couple of typos in your code, so for anyone who
wants to copy/paste, here's Richard's code WITH the curly braces (
Set(SHARED(sharedVar,MY_CALLER) should be
Set(SHARED(sharedVar,${MY_CALLER}) )
[svtest1]
exten => s,1,Answer()
same => n,Verbose(1,Answered channel:${CHANNEL})
same => n,Set(__MY_CALLER=${CHANNEL(name)})
same => n,Dial(Local/s at svtest2,,g)
same => n,Verbose(1,***In channel:${CHANNEL} s...
2016 Nov 23
2
Non-global variable that follows channel?
Related to http://lists.digium.com/pipermail/asterisk-users/2016-November/290384.html,
at the moment I'm passing one variable via DIAL.
Now I'd like to pass a whole bunch, and my idea was to rather than
having a great string of
b(synctest3b^setVar^1(something)^2(more things)^3(etc))
and then get them with ARG1..ARGn etc, I could bundle the whole lot
into a HASH and then unbundle them at
2019 Nov 20
2
[Clang] memory allocation
...static int solutions[] = {
1,
0,
0,
2,
10, /* 5 */
4,
40,
92,
352,
724, /* 10 */
2680,
14200,
73712,
365596,
};
#define MAX_SOLUTIONS sizeof(solutions)/sizeof(int)
int total_count;
int sharedVar = 0;
int ok(int n, char *a)
{
int i, j;
char p, q;
printf("jjjjjjjjj: %d, %p\n", n,&j);
for (i = 0; i < n; i++) {
p = a[i];
for (j = i + 1; j < n; j++) {
q = a[j];
if (q == p || q == p - (j - i) || q == p + (j - i))
return...
2019 Nov 26
2
[Clang] memory allocation
...40,
>> 92,
>> 352,
>> 724, /* 10 */
>> 2680,
>> 14200,
>> 73712,
>> 365596,
>> };
>> #define MAX_SOLUTIONS sizeof(solutions)/sizeof(int)
>>
>> int total_count;
>> int sharedVar = 0;
>>
>> int ok(int n, char *a)
>> {
>> int i, j;
>> char p, q;
>> printf("jjjjjjjjj: %d, %p\n", n,&j);
>> for (i = 0; i < n; i++) {
>> p = a[i];
>>
>>
>> for (j = i + 1; j < n; j...