Actually, you need to subscribe to BACKGROUND_JOB events so that you can match up the uuid of the call leg with the Job-UUID. Here is a copy and paste from an actual session I just did, with what I typed in bold:<br><br><span style="font-family: courier new,monospace;"><291>:<b>telnet localhost 8021</b></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Trying 127.0.0.1...</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Connected to localhost.</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Escape character is '^]'.</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Content-Type: auth/request</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">auth ClueCon</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Content-Type: command/reply</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Reply-Text: +OK accepted</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><b><span style="font-family: courier new,monospace;">event plain BACKGROUND_JOB</span></b><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Content-Type: command/reply</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Reply-Text: +OK event listener enabled plain</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><b><span style="font-family: courier new,monospace;">bgapi originate user/1001 &park()</span></b><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Content-Type: command/reply</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Reply-Text: +OK Job-UUID: d601515b-e986-4d56-90f4-101f1a3c279f</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Job-UUID: d601515b-e986-4d56-90f4-101f1a3c279f</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Content-Length: 581</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Content-Type: text/event-plain</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Event-Name: BACKGROUND_JOB</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Core-UUID: 4a408781-c3ec-4cdd-a8e0-ad13915711ba</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">FreeSWITCH-Hostname: <a href="http://freeswitch1.yt">freeswitch1.yt</a></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">FreeSWITCH-IPv4: 10.15.0.91</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">FreeSWITCH-IPv6: %3A%3A1</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Event-Date-Local: 2010-06-22%2010%3A51%3A50</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Event-Date-GMT: Tue,%2022%20Jun%202010%2017%3A51%3A50%20GMT</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Event-Date-Timestamp: 1277229110556854</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Event-Calling-File: mod_event_socket.c</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Event-Calling-Function: api_exec</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Event-Calling-Line-Number: 1374</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Job-UUID: d601515b-e986-4d56-90f4-101f1a3c279f</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Job-Command: originate</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Job-Command-Arg: user/1001%20%26park()</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">Content-Length: 41</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">+OK b5d8310a-1085-4ea5-8927-398e9eee0c39</span><br style="font-family: courier new,monospace;"><br><br><br>Notice that the Job-UUID that you got in response to the bgapi command corresponds with the Job-UUID of the BACKGROUND_JOB event. The information you want, which is the result of the originate command, is found at the end of the event after "Content-Length" header. In this case the originate was successful ("+OK") and the call leg's UUID is b5d8310a...<br>
<br>Have fun!<br>-MC<br><br><div class="gmail_quote">2010/6/19 Roland Hänel <span dir="ltr"><<a href="mailto:roland@haenel.me">roland@haenel.me</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hello everyone,<div><br></div><div>I'm using mod_event_socket in inbound mode to 'remote control' a FreeSwitch instance. I'm using the raw TCP interface (not any of the available language bindings). My problem now is, if I do a command like</div>
<div><br></div><div> bgapi originate sofia/gateway/mygw/0123456789 &park</div><div><br></div><div>and try to match the channel which is created by this command to the command itself, this seems to be very difficult. I cannot do it on timing only, because many channels may be created in a very short time and the order of originate-CHANNEL_CREATE will probably not be consistent.</div>
<div><br></div><div>Is there any 'best practice' how to solve this problem?</div><div><br></div><div>One solution seems to be to set {origination_uuid=x-y-z-k} in the originate section, but this does not reliably work with failover routing (for example, if I specify two gateways and the call gets rejected on the first and then originated on the second, the origination_uuid will not be the same any more).</div>
<div><br></div><div>Greetings,</div><div>Roland</div><font color="#888888"><div><div><br></div><div><br></div></div>
</font><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></blockquote></div><br>