<div dir="ltr">Hi.<div><br></div><div>I have a rather simple case:</div><div><br></div><div>SIP client calls FreeSwitch, then IVR lua script is being executed. In IVR script I do the following logic (in pseudo code):</div>
<div><br></div><div>session:answer();</div><div><br></div><div>while session:isReady() then</div><div> do http request to external service</div><div> if response is ok then</div><div> session:execute("deflect", "some other SIP URI");</div>
<div> else</div><div> do some other logic</div><div> end</div><div>end</div><div><br></div><div>In dialplan I have something like this:</div><div><div><extension name="xxx"></div><div> <condition field="destination_number" expression="^\d+$"></div>
<div> <action application="set" data="default_language=ru"/></div><div> <action application="lua" data="/etc/freeswitch/scripts/ivr/main.lua"/></div><div> </condition></div>
<div></extension></div></div><div><br></div><div>SIP message flow looks like following:</div><div>INVITE --></div><div> <-- Trying</div><div> <-- OK with SDP</div><div>ACK --></div>
<div> <-- REFER</div><div><br></div><div>From my understanding of SIP (which obviously may be wrong:)) I expect session to become ready (session:isReady returns true) only after FreeSwitch receives ACK from SIP client. But seems that it's not so, because if I introduce small delay in SIP client before sending ACK it receives REFER before ACK is being send to FreeSwitch.</div>
<div><br></div><div>So as result I have several questions:</div><div><ul><li>Is it expected that FreeSwitch doesn't wait for ACK?</li><li>Are the any options to change default behaviour expect introducing some seconds delay after session is answered?</li>
</ul><div><br></div>-- <br>Best regards.
</div></div>