<div dir="ltr"><div><div>Hi,<br><br></div>Problem is that if I will wait for "PeerStatus: Registered" message then next time when phone will re-register message will be completely same and there is no possible to understand if it is re-registration or completely new registration.<br><br></div>This message I got when my sip-client re-register<br><div><br>Event: PeerStatus<br>Privilege: system,all<br>SequenceNumber: 8<br>File: manager.c<br>Line: 1459<br>Func: manager_default_msg_cb<br>ChannelType: SIP<br>Peer: SIP/+1111111111<br>PeerStatus: Registered<br>Address: <a href="http://192.168.1.152:5060">192.168.1.152:5060</a><br><br></div><div>This message I got when my sip-client register<br></div><div><br>Event: PeerStatus<br>Privilege: system,all<br>SequenceNumber: 4<br>File: manager.c<br>Line: 1459<br>Func: manager_default_msg_cb<br>ChannelType: SIP<br>Peer: SIP/+1111111111<br>PeerStatus: Registered<br>Address: <a href="http://192.168.1.152:5060">192.168.1.152:5060</a><br><br></div><div>As you can see they are same. Maybe you have better idea how I can trigger a script after registration and do not trigger it after each re-registration.<br><br></div><div>With kind regards,<br><br></div><div>Jurijs<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2014-09-10 17:40 GMT+02:00 Matthew Jordan <span dir="ltr"><<a href="mailto:mjordan@digium.com" target="_blank">mjordan@digium.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 10, 2014 at 9:40 AM, Jurijs Ivolga <span dir="ltr"><<a href="mailto:jurij.ivo@gmail.com" target="_blank">jurij.ivo@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hi,<br><br>I'm creating 
application which should be triggered after peer registration. I'm 
listening on manager interface for events. Following event I'm getting 
when peer are registered:<br><br>Event: SuccessfulAuth<br>Privilege: security,all<br>SequenceNumber: 214<br>File: manager.c<br>Line: 1459<br>Func: manager_default_msg_cb<br>EventTV: 2014-09-10T10:38:47.508+0200<br>Severity: Informational<br>Service: SIP<br>EventVersion: 1<br>AccountID: +1234567890<br>SessionID: 0x7f4f6431fc88<br>LocalAddress: IPV4/UDP/<a href="http://192.168.1.174/5060" target="_blank">192.168.1.174/5060</a><br>RemoteAddress: IPV4/UDP/<a href="http://192.168.1.152/36623" target="_blank">192.168.1.152/36623</a><br>UsingPassword: 1<br><br>When
 I got this event I'm triggering my script. When peer tries to 
unregister or re-register, then SessionID should be same as for initial 
register message(I believe so). Sometimes after new registration 
SessionID is not updated and in this case my script ignores this 
message, cause it is assuming that it is re-registration.<br></div></div></blockquote><div><br></div><div>This is a security event, which is not related to a channel. For all we know, something just registered; that doesn't mean there is an active call between this Account and Asterisk.<br><br></div><div>If you want to know when a peer registers, you should use the PeerStatus event, as you allude to later.<br></div><div><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br>As 
solution I assumed I can use sip header CALLID, but it is not possible 
to include it in manager SuccessfulAuth messages, I tried to add to 
manager.conf following line:<br><br>channelvars = SIPCALLID<br><br>But it do not helps, it shows SIPCALLID for other manager messages but not for SuccessfulAuth messages.<br></div></div></blockquote><div><br></div><div>It will not show up, as there is no channel. You can't emit channelvars on events that have nothing to do with an active channel.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br>Additionally
 I do not understand why PeerStatus: Reachable message(which you can 
find below) is not generated for each registration. 50% of registration I
 see this message, but I should be able to get it for each registration.<br><br>Event: PeerStatus<br>Privilege: system,all<br>SequenceNumber: 220<br>File: manager.c<br>Line: 1459<br>Func: manager_default_msg_cb<br>ChannelType: SIP<br>Peer: SIP/+1111111111<br>PeerStatus: Reachable<br></div></div></blockquote><div><br></div><div>A PeerStatus of Reachable does not imply that a peer has registered, merely that the peer is now reachable (based on qualify attempts). You should get a PeerStatus event when a peer first registers, with a PeerStatus header of "Registered".<span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888">-- <br><div dir="ltr"><div>Matthew Jordan<br></div><div>Digium, Inc. | Engineering Manager</div><div>445 Jan Davis Drive NW - Huntsville, AL 35806 - USA</div><div>Check us out at: <a href="http://digium.com" target="_blank">http://digium.com</a> & <a href="http://asterisk.org" target="_blank">http://asterisk.org</a></div></div>
</font></span></div></div>
<br>_______________________________________________<br>
asterisk-app-dev mailing list<br>
<a href="mailto:asterisk-app-dev@lists.digium.com">asterisk-app-dev@lists.digium.com</a><br>
<a href="http://lists.digium.com/cgi-bin/mailman/listinfo/asterisk-app-dev" target="_blank">http://lists.digium.com/cgi-bin/mailman/listinfo/asterisk-app-dev</a><br>
<br></blockquote></div><br></div>