I have put together a dialer (of sorts) that is failing a fraction of the time. First, I instantiate a call leg from FreeSwitch to an agent (an employee in my facility with a softclient registered to FreeSwitch). Upon answering this call I have FreeSwitch bridge this leg to an outbound leg destined to a customer (via our carrier). The agent listens as this external number is dialed then is prepared to speak with that person. So all is well except a fraction of these calls fail at the step where FreeSwitch calls the agent. There seems to be a 'hangup' event received from the client at the moment this leg is answered. This happens maybe 1/3 of the time.<div>
<br></div><div>here's my steps</div><div><br></div><div>1. call a Lua script via ESL</div><div><br></div><div>2. Lua script generates a call leg to agent:</div><div><div> local session = freeswitch.Session("user/" .. agentExt .. "@<a href="http://stuff.com">stuff.com</a>")</div>
<div> session:sleep(1000)</div><div> if session:ready() then</div><div> session:execute("pre_answer")</div><div> session:execute("ring_ready")</div>
<div> session:execute("sleep", "1000")</div><div><div> session:setVariable("outbound_callee_number", outboundCalleeNumber)</div></div><div> session:setVariable("outbound_caller_number", outboundCallerNumber)</div>
<div> session:setVariable("outbound_caller_name", outboundCallerName)</div><div> session:transfer("sales_outbound", "XML", "telifi")</div>
</div><div><br></div><div>******** fails here ~30% of the time - phone rings on the agent's desk, she answers and the call immediately ends ********</div><div><br></div><div>3. this leg is transferred to an XML dialplan that handles bridging to a customer's phone number:</div>
<div><div> <extension name="sales_outbound"></div><div> <condition field="destination_number" expression="^sales_outbound$"></div><div> <action application="log" data="INFO connected to agent, now dialing out..."/></div>
<div> <action application="sleep" data="1000"/></div><div> <action application="playback" data="ivr/8000/ivr-call_being_transferred.wav"/>--></div><div>
<action application="set" data="continue_on_fail=true"/></div><div> <action application="set" data="hangup_after_bridge=true"/></div><div> <action application="set" data="ringback=${us-ring}"/></div>
<div> <action application="set" data="call_timeout=30"/></div><div> <action application="set" data="effective_caller_id_number=${outbound_caller_number}"/></div>
<div> <action application="set" data="effective_caller_id_name=${outbound_caller_name}"/></div><div> <action application="sleep" data="1000"/></div><div> <action application="bridge" data="sofia/gateway/mycarrier/${outbound_callee_number}"/></div>
<div> </condition></div><div> </extension></div></div><div><br></div><div>I appreciate any insight or suggestions you could provide.</div>