Apparently my asterisk skills are weak. I want to run a script whenever an extension rings. Eventually this will be a php script. The end goal is to send CallerID info to RocketChat.
What endpoint are you using? Many (most?) brands have an action URL setting for various events.
The variable will depend on the brand, for Yealink it is $callerID so your URL would be something like this: https://webserver.domain.com/cid2rc.php?CID=$callerID
Yealink only accepts responses as XML files, so make sure your PHP outputs a response back to the phone (if any) in XML.