<br><div class="gmail_quote">On Mon, Jan 30, 2012 at 7:12 AM, Juraj Fabo <span dir="ltr">&lt;<a href="mailto:juraj.fabo@gmail.com">juraj.fabo@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_quote"><div>You are better off using mod_freetdm.c as the reference, the sample/test applications may be outdated.</div>
<div><br></div></div></blockquote><div><br>  Unfortunatelly in mod_freetdm.c there seems to be no need for the call_id from the ftdm_call_place_ex(..).<br>

</div></div></blockquote><div><br></div><div>Yes, FreeSWITCH does not uses that call id for anything. I meant that in general, for anything else, try to use mod_freetdm.c as the reference ...</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="gmail_quote"><div></div><div>ftdm_channel_t is an opaque type to API users. I don&#39;t remember what your exact question was. You should not use fchan.caller_data, you always get a copy of caller_data when you need it, the fact that is internally attached to the fchan pointer is not something you should rely on (and that&#39;s why is in a private header).</div>



<br><table style="width:486.3pt;border-collapse:collapse" border="0" cellpadding="0" cellspacing="0" width="648"><tbody><tr style="min-height:60.55pt"><td style="border-right-style:none;border-bottom-style:none;border-left-style:none;border-width:initial;border-color:initial;border-top-style:dotted;border-top-color:rgb(128,176,214);border-top-width:1pt;padding-top:1.45pt;padding-right:5.75pt;padding-bottom:1.45pt;padding-left:5.75pt;min-height:60.55pt">


</td></tr></tbody></table></div></blockquote><br></div>I though that the freetdm generates a new call ID (in context of freetdm) when new call is initated via ftdm_call_place_ex(..) and I was looking for the way how this call_id is announced to the caller application.<br>

I&#39;ve recently tested head from freeswitch git, but the caller_data.call_id is still zero after returning from ftdm_call_place_ex().<br></blockquote><div><br></div><div>That depends on what caller data you are referring to. When returning from ftdm_call_place_ex(), if successful, the caller_data-&gt;call_id member should be valid assuming you got the pointer to caller_data from ftdm_channel_get_caller_data(). If you are talking about the caller_data that is provided as an argument to ftdm_call_place_ex() then the call id  was not populated there, until now, I just committed a change to populate the call id there too for the user convenience.</div>
<div><br></div><div>Additionally, you could wait for the SIGEVENT_DIALING notification, which is the final confirmation that the call is really going out, that notification event contains a valid call id just as any other SIGEVENT_XX event inside the sigmsg structure. You should *always* receive SIGEVENT_DIALING if ftdm_call_place_ex() returned success. In fact, due to the fact we use separate threads, it could be possible that you receive SIGEVENT_DIALING *before* ftdm_call_place_ex() returns, and you should be prepared to handle that case ...</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">My problem is that the comment aroung _ftdm_call_place() in the freetdm api says:<br>
<br>  *  \note When this function returns FTDM_SUCCESS, the member .fchan from caller_data will be set to the channel used to place the call<br>  *        and .call_id to the generated call id for that call<br>  *<br><br>

but my applciation still receives zero. mod_freetdm seems to not care about this call_id at all.<br><br></blockquote><div><br></div><div>This is because you are probably checking the caller_data variable that you provide to ftdm_call_place() not the one returned by ftdm_channel_get_caller_data(). I have improved ftdm_call_place_ex() now to also include the call id in the caller_data argument you provide. </div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">So my workaround is stil following:<br><br>ftdmret = ftdm_call_place_ex(&amp;caller_data, &amp;hunting, usrmsg);<br>
 if (ftdmret == FTDM_SUCCESS)<br>
 {<br>       callerData = ftdm_channel_get_caller_data(caller_data.fchan);<br>       freetdmLibCallId = FtdmCallId(callerData-&gt;call_id);<br>}<br></blockquote><div><br></div><div>Yes, that&#39;s how you were expected to do it before (or wait for SIGEVENT_DIALING)</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">and that was the trigger to my post.<br>Please, is the comment from the freetdm.h about the call_id  within the caller_data valid? Is the zero also valid call_id?<br>
</blockquote><div><br></div><div>The comment is correct, is just talking about the caller data returned by ftdm_channel_caller_data and not the caller data provided as argument to ftdm_call_place_ex(), but with the change I just committed both are valid now.</div>
<div><br></div><div>The value 0 is not a valid call_id, call ids start at 1</div><div><br class="Apple-interchange-newline"><table border="0" cellspacing="0" cellpadding="0" width="648" style="width:486.3pt;border-collapse:collapse">
<tbody><tr style="height:60.55pt"><td style="border-right-style:none;border-bottom-style:none;border-left-style:none;border-width:initial;border-color:initial;border-top-style:dotted;border-top-color:rgb(128,176,214);border-top-width:1pt;padding-top:1.45pt;padding-right:5.75pt;padding-bottom:1.45pt;padding-left:5.75pt;height:60.55pt">
<p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:15px"><b><span lang="PT-BR" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(14,93,167)">Moises Silva<br>
</span></b><b><i><span lang="EN-CA" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(128,176,214)">Software Engineer, Development Manager</span></i></b><b><span lang="PT-BR" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(14,93,167)"></span></b></p>
<p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:15px"><span lang="EN-CA" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(0,92,165)"><a href="mailto:msilva@sangoma.com" target="_blank">msilva@sangoma.com</a></span></p>
<p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:15px"><span lang="EN-CA" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(0,92,165)">Sangoma Technologies</span></p>
<p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:15px"><span lang="EN-CA" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(0,92,165)">100 Renfrew Drive, Suite 100, Markham, ON L3R 9R6 Canada</span><span lang="EN-CA" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(255,192,0)"></span></p>
</td><td width="187" style="width:140.45pt;border-right-style:none;border-bottom-style:none;border-left-style:none;border-width:initial;border-color:initial;border-top-style:dotted;border-top-color:rgb(128,176,214);border-top-width:1pt;padding-top:1.45pt;padding-right:5.75pt;padding-bottom:1.45pt;padding-left:5.75pt;height:60.55pt">
<p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:15px"><span lang="EN-CA" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(0,92,165)"><br>t.   +1 800 388 2475 (N. America)</span></p>
<p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:15px"><span lang="EN-CA" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(0,92,165)">t.   +1 905 474 1990 x128</span></p>
<p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:15px"><span lang="EN-CA" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(0,92,165)">f.   +1 905 474 9223</span></p>
<p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:15px"><span lang="EN-CA" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(31,73,125)"> </span></p></td><td width="149" rowspan="2" style="width:111.55pt;border-top-style:dotted;border-top-color:rgb(128,176,214);border-top-width:1pt;border-left-style:none;border-left-width:initial;border-left-color:initial;border-bottom-style:dotted;border-bottom-color:rgb(128,176,214);border-bottom-width:1pt;border-right-style:none;border-right-width:initial;border-right-color:initial;padding-top:1.45pt;padding-right:5.75pt;padding-bottom:1.45pt;padding-left:5.75pt;height:60.55pt">
<p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:15px"><a href="http://www.sangoma.com/contact?utm_source=signature&amp;utm_medium=email&amp;utm_campaign=email+signatures" target="_blank"><b><span style="color:rgb(31,73,125);text-decoration:none"><img border="0" width="96" height="15"></span></b></a><span style="color:rgb(31,73,125)"></span></p>
</td></tr><tr><td width="500" colspan="2" style="width:374.75pt;border-top-style:none;border-right-style:none;border-left-style:none;border-width:initial;border-color:initial;border-bottom-style:dotted;border-bottom-color:rgb(128,176,214);border-bottom-width:1pt;padding-top:1.45pt;padding-right:5.75pt;padding-bottom:1.45pt;padding-left:5.75pt">
<p style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:15px"><a href="http://sangoma.com/products?utm_source=signature&amp;utm_medium=email&amp;utm_campaign=email%2Bsignatures" target="_blank"><span lang="PT-BR" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(128,176,214)">Products</span></a><span lang="PT-BR" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(128,176,214)"> | </span><a href="http://sangoma.com/solutions?utm_source=signature&amp;utm_medium=email&amp;utm_campaign=email%2Bsignatures" target="_blank"><span lang="PT-BR" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(128,176,214)">Solutions</span></a><span lang="PT-BR" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(128,176,214)"> | </span><a href="http://sangoma.com/about_us/events?utm_source=signature&amp;utm_medium=email&amp;utm_campaign=email%2Bsignatures" target="_blank"><span lang="PT-BR" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(128,176,214)">Events</span></a><span lang="PT-BR" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(128,176,214)"> | </span><a href="http://www.sangoma.com/contact?utm_source=signature&amp;utm_medium=email&amp;utm_campaign=email%2Bsignatures" target="_blank"><span lang="PT-BR" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(128,176,214)">Contact</span></a><span lang="PT-BR" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(128,176,214)"> | </span><a href="http://wiki.sangoma.com/?utm_source=signature&amp;utm_medium=email&amp;utm_campaign=email%2Bsignatures" target="_blank"><span lang="PT-BR" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(128,176,214)">Wiki</span></a><span lang="PT-BR" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(128,176,214)"> | </span><a href="http://www.facebook.com/pages/Sangoma-VoIP-Cards/43578453335?utm_source=signature&amp;utm_medium=email&amp;utm_campaign=email%2Bsignatures" target="_blank"><span lang="PT-BR" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(128,176,214)">Facebook</span></a><span lang="PT-BR" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(128,176,214)"> | </span><a href="http://www.twitter.com/sangoma?utm_source=signature&amp;utm_medium=email&amp;utm_campaign=email%2Bsignatures" target="_blank"><span lang="PT-BR" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(128,176,214)">Twitter</span></a><span lang="PT-BR" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(128,176,214)">`| | </span><span lang="PT-BR" style="font-size:8pt;line-height:12px;font-family:Arial,sans-serif;color:rgb(128,176,214)"><a href="http://www.youtube.com/sangomatechnologies?utm_source=signature&amp;utm_medium=email&amp;utm_campaign=email%2Bsignatures" target="_blank">YouTube</a></span></p>
</td></tr></tbody></table></div></div>