<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div style="RIGHT: auto"><SPAN style="RIGHT: auto">I try before , I connect AMI by telnet localhost ..</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">In this session , if I register a softphone or unregiser from softphone ,</SPAN></div>
<div style="BACKGROUND-COLOR: transparent; FONT-STYLE: normal; FONT-FAMILY: times new roman, new york, times, serif; COLOR: rgb(0,0,0); FONT-SIZE: 16px; RIGHT: auto"><SPAN style="RIGHT: auto">There is event message and show peer no : XXX ,<VAR id=yui-ie-cursor></VAR>and show register or unregister&nbsp;.</SPAN></div>
<div style="BACKGROUND-COLOR: transparent; FONT-STYLE: normal; FONT-FAMILY: times new roman, new york, times, serif; COLOR: rgb(0,0,0); FONT-SIZE: 16px; RIGHT: auto"><SPAN style="RIGHT: auto">You can&nbsp;capture this message and do further what you want .......</SPAN></div>
<div style="BACKGROUND-COLOR: transparent; FONT-STYLE: normal; FONT-FAMILY: times new roman, new york, times, serif; COLOR: rgb(0,0,0); FONT-SIZE: 16px; RIGHT: auto"><SPAN style="RIGHT: auto"></SPAN>&nbsp;</div>
<div style="BACKGROUND-COLOR: transparent; FONT-STYLE: normal; FONT-FAMILY: times new roman, new york, times, serif; COLOR: rgb(0,0,0); FONT-SIZE: 16px; RIGHT: auto"><SPAN style="RIGHT: auto">Regad/chui king man&nbsp;</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"></SPAN>&nbsp;</div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"></SPAN>&nbsp;</div>
<div><BR>
<BLOCKQUOTE style="BORDER-LEFT: rgb(16,16,255) 2px solid; MARGIN-TOP: 5px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px">
<DIV style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt">
<DIV style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt">
<DIV dir=ltr><FONT size=2 face=Arial>
<DIV style="BORDER-BOTTOM: #ccc 1px solid; BORDER-LEFT: #ccc 1px solid; PADDING-BOTTOM: 0px; LINE-HEIGHT: 0; MARGIN: 5px 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; HEIGHT: 0px; FONT-SIZE: 0px; BORDER-TOP: #ccc 1px solid; BORDER-RIGHT: #ccc 1px solid; PADDING-TOP: 0px" class=hr readonly="true" contenteditable="false"></DIV><B><SPAN style="FONT-WEIGHT: bold">寄件人︰</SPAN></B> Face &lt;falazemi@gmail.com&gt;<BR><B><SPAN style="FONT-WEIGHT: bold">收件人︰</SPAN></B> Asterisk Users Mailing List - Non-Commercial Discussion &lt;asterisk-users@lists.digium.com&gt; <BR><B><SPAN style="FONT-WEIGHT: bold">傳送日期︰</SPAN></B> 2012年11月16日 (週五) 9:55 AM<BR><B><SPAN style="FONT-WEIGHT: bold">主題︰</SPAN></B> Re: [asterisk-users] On SIP REGISTER event trigger a AGI script<BR></FONT></DIV><BR>On Fri, Nov 16, 2012 at 12:32 AM, Danny Nicholas &lt;<A href="mailto:danny@debsinc.com" ymailto="mailto:danny@debsinc.com">danny@debsinc.com</A>&gt;
 wrote:<BR>&gt; Check for Status on these commands.&nbsp; If it comes back "OK" the peer is<BR>&gt; registered.&nbsp; If not, it should return "UNKNOWN".<BR>&gt;<BR>&gt; -----Original Message-----<BR>&gt; From: <A href="mailto:asterisk-users-bounces@lists.digium.com" ymailto="mailto:asterisk-users-bounces@lists.digium.com">asterisk-users-bounces@lists.digium.com</A><BR>&gt; [mailto:<A href="mailto:asterisk-users-bounces@lists.digium.com" ymailto="mailto:asterisk-users-bounces@lists.digium.com">asterisk-users-bounces@lists.digium.com</A>] On Behalf Of Face<BR>&gt; Sent: Thursday, November 15, 2012 12:15 PM<BR>&gt; To: Asterisk Users Mailing List - Non-Commercial Discussion<BR>&gt; Subject: Re: [asterisk-users] On SIP REGISTER event trigger a AGI script<BR>&gt;<BR>&gt; On Wed, Nov 14, 2012 at 7:42 PM, Steve Edwards &lt;<A href="mailto:asterisk.org@sedwards.com" ymailto="mailto:asterisk.org@sedwards.com">asterisk.org@sedwards.com</A>&gt;<BR>&gt;
 wrote:<BR>&gt;&gt;&gt; On Wed, 14 Nov 2012, Face wrote:<BR>&gt;&gt;&gt;<BR>&gt;&gt;&gt;&gt;&gt;&gt; Is there a way I can trigger a AGI script On SIP REGISTER event.<BR>&gt;&gt;<BR>&gt;&gt;<BR>&gt;&gt; On Wed, 14 Nov 2012, Danny Nicholas wrote:<BR>&gt;&gt;<BR>&gt;&gt;&gt; What you will need to do is to monitor for the SIP REGISTER in AMI,<BR>&gt;&gt;&gt; then launch a local channel call to run your AGI process.&nbsp; If the<BR>&gt;&gt;&gt; process is not time-critical, you could monitor the logs to cut down on<BR>&gt; AMI traffic.<BR>&gt;&gt;<BR>&gt;&gt;<BR>&gt;&gt; Just for clarity...<BR>&gt;&gt;<BR>&gt;&gt; If the OP's script does not interact with Asterisk using the AGI<BR>&gt;&gt; protocol, it is not an 'AGI' and does not need any channel.<BR>&gt;&gt;<BR>&gt;&gt; If the OP's 'goal' is something like 'when Asterisk receives a<BR>&gt;&gt; REGISTER, I want to update a counter in my MySQL database' then no channel<BR>&gt; is
 needed.<BR>&gt;&gt;<BR>&gt;&gt; Hey, OP, if we know what you are trying to accomplish, maybe we can<BR>&gt;&gt; suggest a solution rather than answering a 'feature' question.<BR>&gt;&gt;<BR>&gt;&gt; --<BR>&gt;&gt; Thanks in advance,<BR>&gt;&gt; -------------------------------------------------------------------------<BR>&gt;&gt; Steve Edwards&nbsp; &nbsp; &nbsp; <A href="mailto:sedwards@sedwards.com" ymailto="mailto:sedwards@sedwards.com">sedwards@sedwards.com</A>&nbsp; &nbsp; &nbsp; Voice: +1-760-468-3867 PST<BR>&gt;&gt; Newline&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Fax: +1-760-731-3000<BR>&gt;&gt;<BR>&gt;&gt; --<BR>&gt;&gt; _____________________________________________________________________<BR>&gt;&gt; -- Bandwidth and Colocation Provided by <A href="http://www.api-digital.com/" target=_blank>http://www.api-digital.com/</A>
 --<BR>&gt;&gt; New to Asterisk? Join us for a live introductory webinar every Thurs:<BR>&gt;&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <A href="http://www.asterisk.org/hello" target=_blank>http://www.asterisk.org/hello</A><BR>&gt;&gt;<BR>&gt;&gt; asterisk-users mailing list<BR>&gt;&gt; To UNSUBSCRIBE or update options visit:<BR>&gt;&gt;&nbsp; <A href="http://lists.digium.com/mailman/listinfo/asterisk-users" target=_blank>http://lists.digium.com/mailman/listinfo/asterisk-users</A><BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; I have a related question. I need to know if a SIP peer is registered or<BR>&gt; unregistered. I try :<BR>&gt;<BR>&gt; CLI<BR>&gt; ------------------------------<BR>&gt; sip show peer 6000<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; AMI<BR>&gt; ------------------------------<BR>&gt; Action: SIPShowPeer<BR>&gt; Peer: 6000<BR>&gt;<BR>&gt;<BR>&gt; AMI<BR>&gt; ------------------------------<BR>&gt; Action: ExtensionState<BR>&gt; Exten:
 1<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; noun of those return anything about the SIP peer is registered or<BR>&gt; unregistered!<BR>&gt;<BR>&gt;<BR>&gt; --<BR>&gt; Sincerely,<BR>&gt; falazemi<BR>&gt;<BR>&gt; --<BR>&gt; _____________________________________________________________________<BR>&gt; -- Bandwidth and Colocation Provided by <A href="http://www.api-digital.com/" target=_blank>http://www.api-digital.com/</A> -- New to<BR>&gt; Asterisk? Join us for a live introductory webinar every Thurs:<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <A href="http://www.asterisk.org/hello" target=_blank>http://www.asterisk.org/hello</A><BR>&gt;<BR>&gt; asterisk-users mailing list<BR>&gt; To UNSUBSCRIBE or update options visit:<BR>&gt;&nbsp; &nbsp; <A href="http://lists.digium.com/mailman/listinfo/asterisk-users" target=_blank>http://lists.digium.com/mailman/listinfo/asterisk-users</A><BR>&gt;<BR>&gt;<BR>&gt; --<BR>&gt;
 _____________________________________________________________________<BR>&gt; -- Bandwidth and Colocation Provided by <A href="http://www.api-digital.com/" target=_blank>http://www.api-digital.com/</A> --<BR>&gt; New to Asterisk? Join us for a live introductory webinar every Thurs:<BR>&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <A href="http://www.asterisk.org/hello" target=_blank>http://www.asterisk.org/hello</A><BR>&gt;<BR>&gt; asterisk-users mailing list<BR>&gt; To UNSUBSCRIBE or update options visit:<BR>&gt;&nbsp; &nbsp; <A href="http://lists.digium.com/mailman/listinfo/asterisk-users" target=_blank>http://lists.digium.com/mailman/listinfo/asterisk-users</A><BR><BR><BR>I try all of those<BR>------------------------------<BR>Action: Status<BR>Peer: 600<BR><BR>Action: Status<BR>Exten: 600<BR><BR>Action: Status<BR>SIP: 600<BR><BR><BR><BR>the return is this<BR>------------------------------<BR>Response: Success<BR>Message: Channel status
 will follow<BR><BR>Event: StatusComplete<BR>Items: 0<BR><BR>Response: Success<BR>Message: Channel status will follow<BR><BR>Event: StatusComplete<BR>Items: 0<BR><BR>Response: Success<BR>Message: Channel status will follow<BR><BR>Event: StatusComplete<BR>Items: 0<BR><BR><BR>-- <BR>Sincerely,<BR>falazemi<BR><BR>--<BR>_____________________________________________________________________<BR>-- Bandwidth and Colocation Provided by <A href="http://www.api-digital.com/" target=_blank>http://www.api-digital.com/</A> --<BR>New to Asterisk? Join us for a live introductory webinar every Thurs:<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <A href="http://www.asterisk.org/hello" target=_blank>http://www.asterisk.org/hello</A><BR><BR>asterisk-users mailing list<BR>To UNSUBSCRIBE or update options visit:<BR>&nbsp; <A href="http://lists.digium.com/mailman/listinfo/asterisk-users"
 target=_blank>http://lists.digium.com/mailman/listinfo/asterisk-users</A><BR><BR><BR></DIV></DIV></BLOCKQUOTE></div></div></body></html>