More how-tos to help me remember:
Google Code has a PHP class written for SIP. It enables you to send CANCEL, NOTIFY, INVITE, BYE, REFER, OPTIONS, SUBSCRIBE, MESSAGE, and REGISTER messages to a SIP endpoint.
I am using it to monitor:
1. A couple of Asterisk servers that don't take registrations via OPTIONS
2. A couple of OpenSIPS servers that do take registrations.
The documentation is located at: http://code.google.com/p/php-sip/
Following is a sample PHP script that I run on a cronjob: