Summary:ASTERISK-06744: On SIP REGISTER event trigger
Reporter:Tomica Crnek (tcrnek)Labels:
Date Opened:2006-04-10 03:46:48Date Closed:2011-06-07 14:07:57
Versions:Frequency of
Description:Hi all,
This is only an idea about a feature which will be nice to have in Asterisk.

I would like to have a trigger in sip.conf under a peer definition, so each time when a phone registers to Asterisk it executes whatever is needed.

Something like this would be nice:


Comments:By: Joshua C. Colp (jcolp) 2006-04-15 19:07:29

You can't trigger something in the dialplan since it isn't a call. You can trigger a priority 1 on an extension to be added with noop using regexten, and that makes an extension appear. Consult the documentation on how this is exactly done.

By: Tomica Crnek (tcrnek) 2006-04-17 11:37:23

Ok, but this what you suggested can be used to create an extension automatically and then call it when you want to.
This is not what I mean. I want to be able to trigger something in the moment someone registers. It can be some external script doing something or whatever. I wrote here onregister=context[/extension[/priority]] just because if you do it like this, you can do whatever you want, run internal application or external script.
But, if it is not possible to do it in dialplan, can you trigger execution of external shell script or something like this? And of course, the peername or extension of the peer has to be passed as an argument to this script.

By: Joshua C. Colp (jcolp) 2006-04-17 11:39:26

It's possible yes, you'd just have to find someone interested in doing it. The bug tracker doesn't end up being productive in that area though, so I suggest talking on the mailing list about this or in the IRC channel.

By: Serge Vecher (serge-v) 2006-04-17 12:02:57

Sorry for continuing discussion on a non-bug, but wouldn't monitoring for REGISTER event via AMI do just that?

By: Serge Vecher (serge-v) 2006-05-04 12:57:11

no response from reporter, functionality appears to be achievable via AMI.