<style>blockquote {padding-left: 1ex; margin: 0px 0px 0px 0.8ex; border-left: #cccccc 1px solid;} p {margin: 0px;padding: 0px;} </style>
<p>Rafał,</p>
<p> </p>
<p>Dnia Czwartek, 27 Czerwca 2013 12:52 Rafal Gwizdala <rafal.gwizdala@gmail.com> napisał(a)</p>
<blockquote dir="ltr">On Thu, Jun 27, 2013 at 12:49 PM, Rafal Gwizdala <span dir="ltr"><<a href="mailto:rafal.gwizdala@gmail.com" target="_blank">rafal.gwizdala@gmail.com</a>></span> wrote:<br />
<div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin: 0 0 0 .8ex; border-left: 1px #ccc solid; padding-left: 1ex;">
<div dir="ltr">
<div>
<div>2. You don't need to answer the call in the httapi script</div>
<div>This one looks quite strange but I think I finally understood it - I can play back sounds or 'say' something without explicitly 'answerring' the call. But the call is 'pre-answerred' only and in this state you won't be able to collect dtmf, for example. I don't know what is the exact difference between a pre-answerred and answerred call but one nice thing is that when you <hangup /> or <break /> in this state the call will be rejected and the caller will hear a 'busy'
signal.</div>
<div> </div>
</div>
</div>
</blockquote>
</div>
</div>
</blockquote>
<p><br />Session is established when you send 200/OK response (that's what "answer" does). This means media will be send in both directions.</p>
<p> </p>
<p>What you experienced here is an early media mode. Because you did not explicitly called any responding app (neiher "answer" not "pre_answer") so mod_sofia did the second for you. "pre_answer" sends 183/Sesion Progress response. This means that B-side (your server) is willing to send media to other side. You should receive PRACK as a "response to response" if A-side accepts it. From this point you can send anything, but _should_ not expect any media to received. This is a situation similar
to commonly used custom ring tones (with music).</p>
<p> </p>
<p>Of course it is possible to use media in both/either side by setting P-Early-Media header in 183 response. Refer to RFC5009 for details.</p>
<p> </p>
<p>Also keep in mind, that 183 _does_ _not_ establish a session. It means that calling side may expexty this is a free time like during ringing. If A-side is a UE of a local user (in terms of service, not distance/net) it will be probably ok. But if you connect FSW to some class 4/5 softswitch, it may be misleading, because the call can be not charged on calling side (i.e. provider). Only after sending 200/OK again ("answer" later) you will establish a call.</p>
<p> </p>
<p>For all above I suggest you to explicitly call "answer" or "pre_answer" _before_ sending any media to other side. You will have 100% control of a call status and also not relay on mod_sofia responses which [are fine of course, but] may be different from what you intended (but now executed).</p>
<p> </p>
<p>Hope it is clear enough ;)</p>
<p> </p>
<p>Regards,</p>
<p>Mariusz</p><br />