<div>Hi</div><div>In the following lua function, I want to invoke VMX(another function) after execution of callcenter is completed. but it seems when agent answers the call from callcenter, execution continues from the line after "session:execute("callcenter","tehccq");", I mean it is not waiting till the dialog between agent and member ends. Is it normal (or I'm doing something wrong)? if it is normal is there anyway I can get this working the way I need?</div>
<div>thanx</div><div><br></div><div>function DialCallCenter()</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>setLastState('CALLCENTER');<span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>session:execute('answer');</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>current_call_add(customerId,callerNumber,firstname,lastname);</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>session:execute("callcenter","tehccq");<span class="Apple-tab-span" style="white-space:pre">        </span></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>local agent_found = session:getVariable('cc_agent_found');</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>freeswitch.consoleLog("info","hellophone:cc agent"..(agent_found or ""));</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>if agent_found == nil or agent_found ~= 'true' then</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>VMX('no-answer-leave-a-message');</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>end<span class="Apple-tab-span" style="white-space:pre">        </span></div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>return true;</div><div>end</div><div><br></div><div><br></div>