Hi Peter,<br><br>Thanks for the response and help. Asterisks IS sending the OriginateResponse packet, but for whatever reason it never makes it into the while events loop. I confirmed that the OriginateResponse event is being sent both by ngrep and by manually opening a client connection with asterisks and mimicking a server with a telnet prompt.<br>
<br>the p event never gets fired for the OriginateResponse, so it must be something preventing it from getting to that line of code. The OriginateResponse event contains an ActionID, which I might guess might cause ami_event_handler to treat it as if it were a response from an action, rather than a typical event. could this be a possible cause? Any suggestions on how to fix it? <br>
<br>Again any help would be appreciated.<br><br>--matt<br><br><br>ami_event_server output<br>---------------------<br>cdr {:destination_channel=&gt;&quot;&quot;, :destination_context=&gt;&quot;default&quot;, :last_application=&gt;&quot;&quot;, :duration=&gt;&quot;0&quot;, :last_data=&gt;&quot;&quot;, :answer_time=&gt;&quot;&quot;, :channel=&gt;&quot;**Unknown**&quot;, :billable_seconds=&gt;&quot;0&quot;, :privilege=&gt;&quot;call,all&quot;, :ama_flags=&gt;&quot;DOCUMENTATION&quot;, :disposition=&gt;&quot;FAILED&quot;, :user_field=&gt;&quot;&quot;, :account_code=&gt;&quot;&quot;, :destination=&gt;&quot;s&quot;, :event=&gt;&quot;Cdr&quot;, :caller_id=&gt;&quot;&quot;, :source=&gt;&quot;&quot;, :start_time=&gt;&quot;2008-05-27 14:37:33&quot;, :end_time=&gt;&quot;2008-05-27 14:37:33&quot;, :unique_id=&gt;&quot;1211913453.1&quot;}<br>
{:destination_channel=&gt;&quot;&quot;, :destination_context=&gt;&quot;default&quot;, :last_application=&gt;&quot;&quot;, :duration=&gt;&quot;0&quot;, :last_data=&gt;&quot;&quot;, :answer_time=&gt;&quot;&quot;, :channel=&gt;&quot;**Unknown**&quot;, :billable_seconds=&gt;&quot;0&quot;, :privilege=&gt;&quot;call,all&quot;, :ama_flags=&gt;&quot;DOCUMENTATION&quot;, :disposition=&gt;&quot;FAILED&quot;, :user_field=&gt;&quot;&quot;, :account_code=&gt;&quot;&quot;, :destination=&gt;&quot;s&quot;, :event=&gt;&quot;Cdr&quot;, :caller_id=&gt;&quot;&quot;, :source=&gt;&quot;&quot;, :start_time=&gt;&quot;2008-05-27 14:38:30&quot;, :end_time=&gt;&quot;2008-05-27 14:38:30&quot;, :unique_id=&gt;&quot;1211913510.2&quot;}<br>
<br>---------------------<br>cdr {:destination_channel=&gt;&quot;&quot;, :destination_context=&gt;&quot;default&quot;, :last_application=&gt;&quot;&quot;, :duration=&gt;&quot;0&quot;, :last_data=&gt;&quot;&quot;, :answer_time=&gt;&quot;&quot;, :channel=&gt;&quot;**Unknown**&quot;, :billable_seconds=&gt;&quot;0&quot;, :privilege=&gt;&quot;call,all&quot;, :ama_flags=&gt;&quot;DOCUMENTATION&quot;, :disposition=&gt;&quot;FAILED&quot;, :user_field=&gt;&quot;&quot;, :account_code=&gt;&quot;&quot;, :destination=&gt;&quot;s&quot;, :event=&gt;&quot;Cdr&quot;, :caller_id=&gt;&quot;&quot;, :source=&gt;&quot;&quot;, :start_time=&gt;&quot;2008-05-27 14:38:30&quot;, :end_time=&gt;&quot;2008-05-27 14:38:30&quot;, :unique_id=&gt;&quot;1211913510.2&quot;}<br>
<br><br><br><br><br><br><br>ngrep output<br>------------------------------------------------------------------------------------------------<br><br>##<br>T <a href="http://127.0.0.1:40976">127.0.0.1:40976</a> -&gt; <a href="http://127.0.0.1:9000">127.0.0.1:9000</a> [AP]<br>
......0......&quot;.do_action......i....Y..{.:.action:.originate:.priority&quot;.1:.channe&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l&quot;.SIP/sr6:<br>exteni.:<br>asyncT:.context&quot;.default......0<br>##<br>T <a href="http://127.0.0.1:49436">127.0.0.1:49436</a> -&gt; <a href="http://127.0.0.1:5038">127.0.0.1:5038</a> [AP]<br>
Action: originate.<br><br>##<br>T <a href="http://127.0.0.1:49436">127.0.0.1:49436</a> -&gt; <a href="http://127.0.0.1:5038">127.0.0.1:5038</a> [AP]<br>actionid: 1211913510.22177.<br>channel: SIP/sr6.<br>priority: 1.<br>context: default.<br>
async: true.<br>exten: 1.<br>.<br><br>##<br>T <a href="http://127.0.0.1:5038">127.0.0.1:5038</a> -&gt; <a href="http://127.0.0.1:49436">127.0.0.1:49436</a> [AP]<br>Response: Success.<br><br>##<br>T <a href="http://127.0.0.1:5038">127.0.0.1:5038</a> -&gt; <a href="http://127.0.0.1:49436">127.0.0.1:49436</a> [AP]<br>
ActionID: 1211913510.22177.<br><br>##<br>T <a href="http://127.0.0.1:5038">127.0.0.1:5038</a> -&gt; <a href="http://127.0.0.1:49436">127.0.0.1:49436</a> [AP]<br>Message: Originate successfully queued.<br>.<br><br>##<br>T <a href="http://127.0.0.1:5038">127.0.0.1:5038</a> -&gt; <a href="http://127.0.0.1:49436">127.0.0.1:49436</a> [AP]<br>
Event: Cdr.<br>Privilege: call,all.<br>AccountCode: .<br>Source: .<br>Destination: s.<br>DestinationContext: default.<br>CallerID: .<br>Channel: **Unknown**.<br>DestinationChannel: .<br>LastApplication: .<br>LastData: .<br>
StartTime: 2008-05-27 14:38:30.<br>AnswerTime: .<br>EndTime: 2008-05-27 14:38:30.<br>Duration: 0.<br>BillableSeconds: 0.<br>Disposition: FAILED.<br>AMAFlags: DOCUMENTATION.<br>UniqueID: 1211913510.2.<br>UserField: .<br>.<br>
<br>##<br>T <a href="http://127.0.0.1:5038">127.0.0.1:5038</a> -&gt; <a href="http://127.0.0.1:49436">127.0.0.1:49436</a> [AP]<br>Event: OriginateResponse.<br>
Privilege: call,all.<br>
ActionID: 1211913510.22177.<br>
Response: Failure.<br>
Channel: SIP/sr6.<br>
Context: default.<br>
Exten: 1.<br>
Reason: 0.<br>
Uniqueid: &lt;null&gt;.<br>
CallerID: &lt;unknown&gt;.<br>
CallerIDNum: &lt;unknown&gt;.<br>
CallerIDName: &lt;unknown&gt;.<br>.<br><br>##<br>T <a href="http://127.0.0.1:9000">127.0.0.1:9000</a> -&gt; <a href="http://127.0.0.1:40976">127.0.0.1:40976</a> [AP]<br>......T......o: Telegraph::AsteriskResponse.:.@results[.:.@message&quot;&quot;Originate su&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ccessfully queued:.@attributes{.:.@successF:.@completeT:.@action_idf.1211913510.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 22177.1{:.@events[.<br>
#<br>T <a href="http://127.0.0.1:9000">127.0.0.1:9000</a> -&gt; <a href="http://127.0.0.1:40975">127.0.0.1:40975</a> [AP]<br>......T......[.{.:.last_data&quot;.:.ama_flags&quot;.DOCUMENTATION:.channel&quot;.**Unknown**:.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; destination&quot;.s:.start_time&quot;.2008-05-27 14:38:30:.unique_id&quot;.1211913510.2:.destin&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ation_context&quot;.default:.answer_time&quot;.:.privilege&quot;.call,all:.user_field&quot;.:.caller&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _id&quot;.:.end_time&quot;.2008-05-27 14:38:30:.disposition&quot;.FAILED:.destination_channel&quot;.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :.duration&quot;.0:.source&quot;.:.last_application&quot;.:<br>
event&quot;.Cdr:.billable_seconds&quot;.0:.account_code&quot;.<br>##<br>T <a href="http://127.0.0.1:40975">127.0.0.1:40975</a> -&gt; <a href="http://127.0.0.1:9000">127.0.0.1:9000</a> [AP]<br>......0......&quot;.get_next_events......i.......0<br>
<br><br><div class="gmail_quote">On Mon, May 26, 2008 at 5:45 AM, Peter P GMX &lt;<a href="mailto:Prometheus001@gmx.net">Prometheus001@gmx.net</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello Matthew,<br>
<br>
can you see if the OriginateResponse event it arriving at your machine by using e.g. ngrep:<br>
<br>
ngrep -d any host &lt;asterisk-ip&gt; -W byline<br>
<br>
I once recognized that it is important to precisely look at the event which is coming from the asterisk in terms on upcase/lowercase letters<br>
<br>
You may also put a puts or p line into ami_server.rb in the watch_for_events method to see if the event is arriving or not<br>
e.g.<br>
while events = @client.get_next_events<br>
&nbsp;for event in events<br>
 &nbsp;p event<br>
&nbsp;.<br>
&nbsp;.<br>
&nbsp;.<br>
<br>
Best regards<br>
Peter<br>
<br>
Matthew Fong schrieb:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="Wj3C7c">
I&#39;m trying to access the AMI Event OriginateResponse<br>
<br>
in my ami_logic file I have<br>
<br>
 &nbsp; &nbsp;def originate_response<br>
 &nbsp; &nbsp; &nbsp; &nbsp;puts &#39;---------------------&#39;<br>
 &nbsp; &nbsp; &nbsp; &nbsp;puts &quot;OriginateResponse #{params.inspect}&quot;<br>
 &nbsp; &nbsp;end<br>
<br>
but it&#39;s not getting fired when it receives an OriginateResponse response. Any ideas why? Other obscure events like JabberEvent works when defined as jabber_event, I can&#39;t figure out why OriginateResponse has problems.<br>

<br>
OriginateResponse is an AMI Event triggered by an AMI originate with async set to true<br>
<br>
Any help would be greatly apperciated.<br>
<br>
--matt<br></div></div>
------------------------------------------------------------------------<br>
<br>
_______________________________________________<br>
Telegraph-users mailing list<br>
<a href="mailto:Telegraph-users@rubyforge.org" target="_blank">Telegraph-users@rubyforge.org</a><br>
<a href="http://rubyforge.org/mailman/listinfo/telegraph-users" target="_blank">http://rubyforge.org/mailman/listinfo/telegraph-users</a><br>
 &nbsp;<br>
</blockquote>
</blockquote></div><br>