[Freeswitch-users] FreeSwitch doesn't wait for ACK on OK with SDP

Andrey Vorobiev andrey.o.vorobiev at gmail.com
Thu Aug 28 15:32:52 MSD 2014


Hi.

I have a rather simple case:

SIP client calls FreeSwitch, then IVR lua script is being executed. In IVR
script I do the following logic (in pseudo code):

session:answer();

while session:isReady() then
  do http request to external service
  if response is ok then
     session:execute("deflect", "some other SIP URI");
  else
    do some other logic
  end
end

In dialplan I have something like this:
<extension name="xxx">
   <condition field="destination_number" expression="^\d+$">
      <action application="set" data="default_language=ru"/>
      <action application="lua"
data="/etc/freeswitch/scripts/ivr/main.lua"/>
   </condition>
</extension>

SIP message flow looks like following:
INVITE -->
            <-- Trying
            <-- OK with SDP
ACK    -->
           <-- REFER

>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.

So as result I have several questions:

   - Is it expected that FreeSwitch doesn't wait for ACK?
   - Are the any options to change default behaviour expect introducing
   some seconds delay after session is answered?


-- 
Best regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20140828/89a257d8/attachment-0001.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list