<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1250">


<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Excellent.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>So just to clarify, from the &#8220;Event-Name:
CHANNEL_ORIGINATE&#8221; event, every thereafter will include the custom variable_{vars}.
According to this, I&#8217;d only miss the two Event-Names: CHANNEL_CREATE and CHANNEL_OUTGOING
(which I don&#8217;t really need).<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Thanks!<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
freeswitch-users-bounces@lists.freeswitch.org
[mailto:freeswitch-users-bounces@lists.freeswitch.org] <b><span
style='font-weight:bold'>On Behalf Of </span></b>Anthony Minessale<br>
<b><span style='font-weight:bold'>Sent:</span></b> Tuesday, April 15, 2008 3:31
AM<br>
<b><span style='font-weight:bold'>To:</span></b>
freeswitch-users@lists.freeswitch.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [Freeswitch-users]
event BACKGROUND too late inORIGINATEscenario?</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>I looked at the code and
there is really only one place i can push the variables in sooner and that is
before the CHANNEL_ORGINATE event.&nbsp; This event is fired as soon as the
channel is created while it's waiting for it to ring etc.&nbsp; I moved the
code that adds the variables from the {foo=bar} to right before this
event.&nbsp; This is the earliest event you will be able to track an outbound
call that you initiated.&nbsp; Any others that do not contain your param must
be discarded because there is no way to get your information into the channel
any sooner in the lifecycle of the channel.&nbsp; <br>
<br>
The change is in trunk so you will get that along with the other updates when
we commit the fix to windows build.<br>
<br>
Note you can also pick your own job-uuid by adding the job-uuid header to your
request using this with the suggestion the other guy gave you you can sync them<br>
<br>
api originate {my_uuid=ABC1234}sofia/default/<a href="mailto:1000@domain.com">1000@domain.com</a><br>
job-uuid: ABC1234<br>
<br>
This will add the variable_my_uuid line to every event set to ABC1234 and the
final job_uuid in the BACKGROUND event will also be ABC1234<br>
<br>
<br>
<br>
<br>
<o:p></o:p></span></font></p>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
On Mon, Apr 14, 2008 at 12:08 PM, UV &lt;<a href="mailto:uv@talknet.com.au">uv@talknet.com.au</a>&gt;
wrote:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Thanks, Michael!<br>
Your advise seemed to be a workaround to most events although not all<br>
(missing some new, init and few others).<br>
<br>
I'll update to the newest version as soon as there's a fix for the win32<br>
build (doesn't work for me either).<br>
<br>
Btw, Will that little race fixing allow me to correlate the BGPAI JOB-UUID<br>
to these missing events? It's not that I don't get those events - I just<br>
don't know what request initiated them...<br>
<br>
Cheers,<br>
UV<o:p></o:p></span></font></p>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'><br>
<br>
-----Original Message-----<br>
From: <a href="mailto:freeswitch-users-bounces@lists.freeswitch.org">freeswitch-users-bounces@lists.freeswitch.org</a><br>
[mailto:<a href="mailto:freeswitch-users-bounces@lists.freeswitch.org">freeswitch-users-bounces@lists.freeswitch.org</a>]
On Behalf Of Michael<br>
Jerris<br>
Sent: Tuesday, April 15, 2008 2:30 AM<br>
To: <a href="mailto:freeswitch-users@lists.freeswitch.org">freeswitch-users@lists.freeswitch.org</a><br>
Subject: Re: [Freeswitch-users] event BACKGROUND too late in<br>
ORIGINATEscenario?<o:p></o:p></span></font></p>

</div>

<div>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>You can set your own
unique id reference as a variable to the<br>
originate using the {my_uuid=1234567ABCD} syntax and then track all<br>
events off that variable that should be included on every event.<br>
<br>
<a href="http://wiki.freeswitch.org/wiki/Freeswitch_IVR_Originate"
target="_blank">http://wiki.freeswitch.org/wiki/Freeswitch_IVR_Originate</a><br>
<br>
Also, we just fixed a little race that might have allowed you to get<br>
events before you got the background uuid so you probably want to<br>
update to most recent code.<br>
<br>
Mike<br>
<br>
<br>
On Apr 14, 2008, at 11:39 AM, UV wrote:<br>
<br>
&gt; We're busy integrating a heavy-duty call-control engine on top of the<br>
&gt; Freeswitch and I'm not sure if what's happening is by design or a bug:<br>
&gt;<br>
&gt; When originating a call via the &quot;bgapi originate&quot; call<br>
&gt; (mod_commands) the<br>
&gt; BACKGROUND event invoked only AFTER the call successfully terminated<br>
&gt; (answered/rejected).<br>
&gt; Because only the BACKGROUND event has the correlation between the<br>
&gt; JOB-UUID<br>
&gt; of the BGAPI command and the UNIQUE-ID, it's impossible to intercept<br>
&gt; all the<br>
&gt; events until that point (create, outgoing, ring, codec-exchange, etc).<br>
&gt;<br>
&gt; This becomes a real problem when originating multiple calls in a<br>
&gt; short time.<br>
&gt; It's impossible to distinguish which event belongs to which<br>
&gt; origination<br>
&gt; request. Resorting to pull that info from the DB or through SHOW<br>
&gt; CHANNELS<br>
&gt; might still cost missing few events.<br>
&gt;<br>
&gt; Anyone has any ideas on how to track an ORIGINATE call setup flow?<br>
&gt;<br>
&gt;<br>
&gt; Here's an extract from the log (just took the relevant parts):<br>
&gt; bgapi originate sofia/default/1001 &amp;park<br>
&gt;<br>
&gt; Reply-Text: +OK Job-UUID: &lt;UUID-A&gt;<br>
&gt;<br>
&gt; Channel-State: CS_NEW<br>
&gt; Unique-ID: &lt;UUID-B&gt;<br>
&gt; Event-Name: CHANNEL_CREATE<br>
&gt;<br>
&gt; Channel-State: CS_INIT<br>
&gt; Unique-ID: &lt;UUID-B&gt;<br>
&gt; Event-Name: CHANNEL_OUTGOING<br>
&gt;<br>
&gt; Channel-State: CS_INIT<br>
&gt; Unique-ID: &lt;UUID-B&gt;<br>
&gt; Event-Name: CHANNEL_ORIGINATE<br>
&gt;<br>
&gt; Channel-State: CS_INIT<br>
&gt; Unique-ID: &lt;UUID-B&gt;<br>
&gt; Event-Name: CHANNEL_STATE<br>
&gt;<br>
&gt; Channel-State: CS_RING<br>
&gt; Unique-ID: &lt;UUID-B&gt;<br>
&gt; Event-Name: PRESENCE_IN<br>
&gt;<br>
&gt; Channel-State: CS_RING<br>
&gt; Unique-ID: &lt;UUID-B&gt;<br>
&gt; Event-Name: CHANNEL_STATE<br>
&gt;<br>
&gt; Channel-State: CS_HOLD<br>
&gt; Unique-ID: &lt;UUID-B&gt;<br>
&gt; Event-Name: PRESENCE_IN<br>
&gt;<br>
&gt; Channel-State: CS_HOLD<br>
&gt; Unique-ID: &lt;UUID-B&gt;<br>
&gt; Event-Name: CHANNEL_STATE<br>
&gt;<br>
&gt; Channel-State: CS_HOLD<br>
&gt; Unique-ID: &lt;UUID-B&gt;<br>
&gt; Event-Name: CODEC<br>
&gt;<br>
&gt; Channel-State: CS_HOLD<br>
&gt; Unique-ID: &lt;UUID-B&gt;<br>
&gt; Event-Name: CODEC<br>
&gt;<br>
&gt; Channel-State: CS_HOLD<br>
&gt; Unique-ID: &lt;UUID-B&gt;<br>
&gt; Event-Name: CHANNEL_ANSWER<br>
&gt;<br>
&gt; API-Command: originate<br>
&gt; Event-Name: API<br>
&gt;<br>
&gt; Job-UUID: &lt;UUID-A&gt;<br>
&gt; Job-Command: originate<br>
&gt; Event-Name: BACKGROUND_JOB<br>
&gt; +OK &lt;UUID-B&gt;<br>
&gt;<br>
&gt; Channel-State: CS_EXECUTE<br>
&gt; Unique-ID: &lt;UUID-B&gt;<br>
&gt; Event-Name: PRESENCE_IN<br>
&gt;<br>
&gt; Channel-State: CS_EXECUTE<br>
&gt; Unique-ID: &lt;UUID-B&gt;<br>
&gt; Event-Name: CHANNEL_STATE<br>
&gt;<br>
&gt; Thanks,<br>
&gt; UV<br>
&gt;<br>
&gt; No virus found in this outgoing message.<br>
&gt; Checked by AVG.<br>
&gt; Version: 7.5.519 / Virus Database: 269.22.12 - Release Date: 10-<br>
&gt; Apr-08 12:00<br>
&gt; AM<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Freeswitch-users mailing list<br>
&gt; <a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br>
&gt; <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users"
target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
&gt; UNSUBSCRIBE:<a
href="http://lists.freeswitch.org/mailman/options/freeswitch-users"
target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
&gt; <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br>
<br>
_______________________________________________<br>
Freeswitch-users mailing list<br>
<a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users"
target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a
href="http://lists.freeswitch.org/mailman/options/freeswitch-users"
target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><o:p></o:p></span></font></p>

</div>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>No virus found in this incoming message.<o:p></o:p></span></font></p>

<div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Checked by AVG.<br>
Version: 7.5.519 / Virus Database: 269.22.12 - Release Date: 10-Apr-08 12:00<br>
AM<br>
<br>
<br>
No virus found in this outgoing message.<br>
Checked by AVG.<br>
Version: 7.5.519 / Virus Database: 269.22.12 - Release Date: 10-Apr-08 12:00<br>
AM<br>
<br>
<br>
<br>
_______________________________________________<br>
Freeswitch-users mailing list<br>
<a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users"
target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a
href="http://lists.freeswitch.org/mailman/options/freeswitch-users"
target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><o:p></o:p></span></font></p>

</div>

</div>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
<br clear=all>
<br>
-- <br>
Anthony Minessale II<br>
<br>
FreeSWITCH <a href="http://www.freeswitch.org/">http://www.freeswitch.org/</a><br>
ClueCon <a href="http://www.cluecon.com/">http://www.cluecon.com/</a><br>
<br>
AIM: anthm<br>
<a href="mailto:MSN%3Aanthony_minessale@hotmail.com">MSN:anthony_minessale@hotmail.com</a><br>
GTALK/JABBER/<a href="mailto:PAYPAL%3Aanthony.minessale@gmail.com">PAYPAL:anthony.minessale@gmail.com</a><br>
IRC: <a href="http://irc.freenode.net">irc.freenode.net</a> #freeswitch<br>
<br>
FreeSWITCH Developer Conference<br>
<a href="mailto:sip%3A888@conference.freeswitch.org">sip:888@conference.freeswitch.org</a><br>
<a href="http://iax:guest@conference.freeswitch.org/888">iax:guest@conference.freeswitch.org/888</a><br>
<a href="mailto:googletalk%3Aconf%2B888@conference.freeswitch.org">googletalk:conf+888@conference.freeswitch.org</a><br>
pstn:213-799-1400 <o:p></o:p></span></font></p>

<p><font size=2 face="Times New Roman"><span style='font-size:10.0pt'>No virus
found in this incoming message.<br>
Checked by AVG.<br>
Version: 7.5.519 / Virus Database: 269.22.12 - Release Date: 10-Apr-08 12:00 AM</span></font><o:p></o:p></p>

</div>

</body>

</html>
<BR>

<P><FONT SIZE=2>No virus found in this outgoing message.<BR>
Checked by AVG.<BR>
Version: 7.5.519 / Virus Database: 269.22.12 - Release Date: 10-Apr-08 12:00 AM<BR>
</FONT> </P>