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 “http://192.168.2.163/smartcrm/calls.php?number=${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:

http://www.freepbx.org/support/documentation/howtos/how-to-set-up-notification-caller-id-popup-on-mac-os-x-linux-and-other-