Perform action when receiving a call

I’m using FreePBX and have this configuration in extensions_custom.conf so that I can receive a notification via Pushover.

exten => s,1,System(/usr/bin/sendpush.php "Call from ${CALLERID(num)} to ${OUTNUM}")

I also need to receive notifications on incoming calls, but can’t figure it out on what context should I apply it.
(If it makes any difference, I’m using 4 trunks and want notifications from all of them)
Thank you.

Do you have all of the trunk inbound to the same context?

Using ‘from-pstn’ as an example, I’d set up a custom context call ‘from-pstn-push’, put your line of code in, and then a ‘goto(from-pstn,s,0)’ as the second line.

Just a thought.

Solved by adding:

exten => s,1,System(/usr/bin/sendpush.php "External call from ${CALLERID(num)}")

Thanks anyway.

I am having great difficulty with Pushover, had this working perfectly on NotifyMyAndoid (now down thanks to the E.U. and their crazy GDPR annoyance)

Yaba would you be so kind as to share the sendpush.php file please
as I’m obviously doing it wrong, I get “test” as the caller (name/number) and name now
when it used to return the details of the calling extension.

Thank you