<div>I've got a macro that tries to find the first available SIP trunk to send outgoing calls on. It tracks the usage of the lines (since each trunk has a call-limit of 2) by using GROUP(). My problem is that once a call switched to ANSWER state, ``group show channels`` stops listing it and then my Macro starts screwing up because it's sending calls to a line that sometimes is full even though GROUP() shows it as being less than 2. I'm tempted to send this to the Asterisk Dev team just because I believe it's an issue of the GROUP information being released when Asterisk consolidates the channels (removes all the MASQ channels) once the call is answered. But maybe it's something else so I'll ask here first.
</div>
<div> </div>
<div>The dialplan setup:</div>
<div> </div>
<div>exten => 555,1,Dial(Local/1234567890)</div>
<div>exten => _NXXNXXXXXX,1,Macro(which-line,${EXTEN})</div>
<div> </div>
<div>[macro-which-line]</div>
<div>exten => s,1,set(GROUP()=${DIALSTRING})</div>
<div>exten => s,n,Dial(${DIALSTRING}/1${ARG1})<br clear="all"></div>
<div>Things are a bit more complex, but it's all just logic. The extensions above should give a decent representation of what's going on. I think each time you switch extensions, Asterisk creates a MASQ channel and that's what's causing the issue since the GROUP() is set only at the end, inside the macro. Are there any EVENTS for unlocking of GROUPs? Anything I can do to better show where this is happening?
</div>
<div> </div>
<div>I'd love some help if anyone has a guess.<br>-- <br>/Nick </div>