Trigger or event when SIP phone registers with Asterisk

I have a requirement in which I must execute a script when a SIP phone registers with Asterisk. Is there a way to do this within Asterisk?

Cheers!!

Hi First time it registers or every time it registers ?

Ian

[quote=“ianplain”]Hi First time it registers or every time it registers ?

Ian[/quote]

I would like it to trigger/execute everytime it registers.

Cheers!!

Ok.

What are you trying to achieve ? wanting to know the first time it registers but every time ???

Ian

[quote=“ianplain”]Ok.

What are you trying to achieve ? wanting to know the first time it registers but every time ???

Ian[/quote]

Currently my requirement is for a demo that when a device registers with Asterisk we are able to execute a script or perform a administrator defined action. The reason why we need to be able to do this everytime is that these are mobile phones which are SIP enabled. Therefore, they will be moving in and out of range of the access point and constantly re-registering with the Asterisk server. It’s unusual but never the less, it’s what I want to demonstrate.

Cheers!!