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. This event is fired as soon as the channel is created while it's waiting for it to ring etc. I moved the code that adds the variables from the {foo=bar} to right before this event. This is the earliest event you will be able to track an outbound call that you initiated. 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. <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><br><div class="gmail_quote"><br>On Mon, Apr 14, 2008 at 12:08 PM, UV <<a href="mailto:uv@talknet.com.au">uv@talknet.com.au</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
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<br>
<div class="Ih2E3d"><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?<br>
<br>
</div><div><div></div><div class="Wj3C7c">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>
> We're busy integrating a heavy-duty call-control engine on top of the<br>
> Freeswitch and I'm not sure if what's happening is by design or a bug:<br>
><br>
> When originating a call via the "bgapi originate" call<br>
> (mod_commands) the<br>
> BACKGROUND event invoked only AFTER the call successfully terminated<br>
> (answered/rejected).<br>
> Because only the BACKGROUND event has the correlation between the<br>
> JOB-UUID<br>
> of the BGAPI command and the UNIQUE-ID, it's impossible to intercept<br>
> all the<br>
> events until that point (create, outgoing, ring, codec-exchange, etc).<br>
><br>
> This becomes a real problem when originating multiple calls in a<br>
> short time.<br>
> It's impossible to distinguish which event belongs to which<br>
> origination<br>
> request. Resorting to pull that info from the DB or through SHOW<br>
> CHANNELS<br>
> might still cost missing few events.<br>
><br>
> Anyone has any ideas on how to track an ORIGINATE call setup flow?<br>
><br>
><br>
> Here's an extract from the log (just took the relevant parts):<br>
> bgapi originate sofia/default/1001 &park<br>
><br>
> Reply-Text: +OK Job-UUID: <UUID-A><br>
><br>
> Channel-State: CS_NEW<br>
> Unique-ID: <UUID-B><br>
> Event-Name: CHANNEL_CREATE<br>
><br>
> Channel-State: CS_INIT<br>
> Unique-ID: <UUID-B><br>
> Event-Name: CHANNEL_OUTGOING<br>
><br>
> Channel-State: CS_INIT<br>
> Unique-ID: <UUID-B><br>
> Event-Name: CHANNEL_ORIGINATE<br>
><br>
> Channel-State: CS_INIT<br>
> Unique-ID: <UUID-B><br>
> Event-Name: CHANNEL_STATE<br>
><br>
> Channel-State: CS_RING<br>
> Unique-ID: <UUID-B><br>
> Event-Name: PRESENCE_IN<br>
><br>
> Channel-State: CS_RING<br>
> Unique-ID: <UUID-B><br>
> Event-Name: CHANNEL_STATE<br>
><br>
> Channel-State: CS_HOLD<br>
> Unique-ID: <UUID-B><br>
> Event-Name: PRESENCE_IN<br>
><br>
> Channel-State: CS_HOLD<br>
> Unique-ID: <UUID-B><br>
> Event-Name: CHANNEL_STATE<br>
><br>
> Channel-State: CS_HOLD<br>
> Unique-ID: <UUID-B><br>
> Event-Name: CODEC<br>
><br>
> Channel-State: CS_HOLD<br>
> Unique-ID: <UUID-B><br>
> Event-Name: CODEC<br>
><br>
> Channel-State: CS_HOLD<br>
> Unique-ID: <UUID-B><br>
> Event-Name: CHANNEL_ANSWER<br>
><br>
> API-Command: originate<br>
> Event-Name: API<br>
><br>
> Job-UUID: <UUID-A><br>
> Job-Command: originate<br>
> Event-Name: BACKGROUND_JOB<br>
> +OK <UUID-B><br>
><br>
> Channel-State: CS_EXECUTE<br>
> Unique-ID: <UUID-B><br>
> Event-Name: PRESENCE_IN<br>
><br>
> Channel-State: CS_EXECUTE<br>
> Unique-ID: <UUID-B><br>
> Event-Name: CHANNEL_STATE<br>
><br>
> Thanks,<br>
> UV<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-<br>
> 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><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><br>
<br>
</div></div>No virus found in this incoming message.<br>
<div><div></div><div class="Wj3C7c">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><br>
</div></div></blockquote></div><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