Call a url or run a macro when extension ring

hi everybody.

I’ve installed trixbox on a server and defined 5 extensions. All extensions are in a ring group.
inbound route assigned to this ring group.
I have a server that runs an application i want to get callerid and when extension rings i want to call a url (or run a macro in custom-extensions)

for example

exten => s,n,TrySystem(wget -qb -O /dev/null -o /dev/null “${CALLERID(num)}&ext=EXTEN}”)

what should i do ? where i put this line .
this simple script runs a pop up.

i want to automatically detect ringing extension number and when extension rings call the url (based on callerid and my ringing extension number).

please forgive me.
my english in not very well .

Best Thanks.

Not doing exactly the same thing here, but it’s the same problem - the need to run a line of code when an extension rings. See if this gives you any inspiration: