<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class=""><div class="h5"><br>
> I found the problem, it's (I think) a bug with queue command. My<br>
> dialplan:<br>
><br>
> [context]<br>
> ...<br>
> exten => 33123,n,macro(unpauseQueueMembers,q820,104,105,136,,)<br>
> exten => 33123,n(back2Queue),Queue(${myQueue},nit,,,14400)<br>
> exten => 33123,n,NoOp(Queue ${myQueue} call status is ${QUEUESTATUS}<br>
> -<br>
> Dial status is ${DIALSTATUS} - Our status is ${${myQueue}STATUS}) ;<br>
> value is empty<br>
> exten => 33123,n,GotoIf($["${${myQueue}STATUS}" =<br>
> "myTIMEOUT"]?back2Queue)<br>
><br>
> [to-q820]<br>
><br>
> exten => 104,1,Dial(SIP/${EXTEN},,Tt)<br>
> exten => 105,1,Dial(SIP/${EXTEN},,Tt)<br>
> exten => 136,1,Dial(SIP/${EXTEN},,Tt)<br>
> exten => _XXX,2,macro(queueCallStatus,${EXTEN})<br>
><br>
> [macro-queueCallStatus]<br>
><br>
> exten => s,1,Set(__myExten=${ARG1})<br>
> same => n,NoOp(Call status to ${myExten}@${myQueue} is<br>
> ${DIALSTATUS})<br>
> same => n,GotoIf($["${DIALSTATUS}" = "ANSWER"]?exitMacro)<br>
> same => n,GotoIf($["${DIALSTATUS}" != "NOANSWER"]?Pause)<br>
> same => n(exitMacro),MacroExit<br>
> ...<br>
> same =><br>
> n(Pause),NoOp(PauseQueueMember(,Local/${myExten}@to-${myQueue}))<br>
> same => n,Set(__${myQueue}STATUS=myTIMEOUT)<br>
> same => n,NoOp(Value of my variable is ${${myQueue}STATUS})<br>
> ; here I get correct value<br>
> ...<br>
> [macro-unpauseQueueMembers]<br>
><br>
> exten => s,1,Set(__myQueue=${ARG1})<br>
> same => n,Set(__${myQueue}STATUS=)<br>
> same => n,UnpauseQueueMember(,Local/${ARG2}@to-${myQueue})<br>
> same => n,UnpauseQueueMember(,Local/${ARG3}@to-${myQueue})<br>
> same => n,UnpauseQueueMember(,Local/${ARG4}@to-${myQueue})<br>
><br>
> If I 33123 the NoOp(Value of my variable is ${${myQueue}STATUS}) in<br>
> macro-queueCallStatus shows the right value which is text myTIMEOUT.<br>
> But<br>
> this value isn't anymore present in<br>
> NoOp(Queue ${myQueue} call status is ${QUEUESTATUS} - Dial status is<br>
> ${DIALSTATUS} - Our status is ${${myQueue}STATUS}) from [context]<br>
> which<br>
> is *after* the queue cmd exit.<br>
<br>
</div></div>The the parent channel (the incoming channel on exten 33123) sets the<br>
variable to empty. A child channel (Dialed by app Queue) running a<br>
local channel in the context [to-q820] sets the variable to the status<br>
you are wanting. The child cannot send that variable value back to the<br>
parent channel. Channel variable inheritance only goes one way: from<br>
parent to child.<br>
<span class=""><font color="#888888"><br>
Richard<br>
</font></span><div class=""><div class="h5"><br></div></div></blockquote><div><br></div><div style>SHARED function is your best pal here. </div><div style><br></div><div style>Here is the updated (but not tested) dialplan for you</div>
<div style><br></div><div style><div>[context]</div><div>...</div><div style>;Store CHANNEL in a variable</div><div>exten => 33123,n,Set(__PARENTCHANNEL=${CHANNEL})</div><div>exten => 33123,n,macro(unpauseQueueMembers,q820,104,105,136,,)</div>
<div>exten => 33123,n(back2Queue),Queue(${myQueue},nit,,,14400)</div><div>exten => 33123,n,NoOp(Queue ${myQueue} call status is ${QUEUESTATUS} - Dial status is ${DIALSTATUS} - Our status is ${${myQueue}STATUS}) ; value is empty</div>
<div>;;exten => 33123,n,GotoIf($["${${myQueue}STATUS}" = "myTIMEOUT"]?back2Queue)</div><div style>; See the SHARED FUNCTION</div><div>exten => 33123,n,GotoIf($["${SHARED(${myQueue}STATUS,${PARENTCHANNEL})}" = "myTIMEOUT"]?back2Queue)</div>
<div><br></div><div>[to-q820]</div><div><br></div><div>exten => 104,1,Dial(SIP/${EXTEN},,Tt)</div><div>exten => 105,1,Dial(SIP/${EXTEN},,Tt)</div><div>exten => 136,1,Dial(SIP/${EXTEN},,Tt)</div><div>exten => _XXX,2,macro(queueCallStatus,${EXTEN})</div>
<div><br></div><div>[macro-queueCallStatus]</div><div><br></div><div>exten => s,1,Set(__myExten=${ARG1})</div><div> same => n,NoOp(Call status to ${myExten}@${myQueue} is ${DIALSTATUS})</div><div> same => n,GotoIf($["${DIALSTATUS}" = "ANSWER"]?exitMacro)</div>
<div> same => n,GotoIf($["${DIALSTATUS}" != "NOANSWER"]?Pause)</div><div> same => n(exitMacro),MacroExit</div><div>...</div><div>same => n(Pause),NoOp(PauseQueueMember(,Local/${myExten}@to-${myQueue}))</div>
<div>;;same => n,Set(__${myQueue}STATUS=myTIMEOUT)</div><div>same => n,Set(SHARED(${myQueue}STATUS,${PARENTCHANNEL})=myTIMEOUT)</div><div>;;same => n,NoOp(Value of my variable is ${${myQueue}STATUS}) ; here I get correct value</div>
<div>; ${myQueue}STATUS is set here through SHARED FUNCTION</div><div>same => n,NoOp(Value of my variable is ${SHARED(${myQueue}STATUS,${PARENTCHANNEL})})</div><div>...</div><div>[macro-unpauseQueueMembers]</div><div><br>
</div><div>exten => s,1,Set(__myQueue=${ARG1})</div><div> same => n,Set(__${myQueue}STATUS=)</div><div> same => n,UnpauseQueueMember(,Local/${ARG2}@to-${myQueue})</div><div> same => n,UnpauseQueueMember(,Local/${ARG3}@to-${myQueue})</div>
<div> same => n,UnpauseQueueMember(,Local/${ARG4}@to-${myQueue})</div><div><br></div><div style>Hope this helps.</div><div style><br></div><div style>--Satish Barot</div><div style>Ahmedabad, India</div></div></div><br>
</div></div>