Sunday, October 18, 2009

SIP applications PHP

With basic SIP knowledge and a few lines of code any PHP developer can develop SIP applications. PHP-SIP is a PHP implementation of a SIP UA that allows to implement things like click-to-call, message waiting indications or SIMPLE based instant messages.

On Level 7 Systems' blog they show how to implement click-to-call functionality
triggered from a web page - in a relatively simple PHP script.

$api = new PhpSIP();


$api->addHeader('Subject: click2call');

$res = $api->send();

if ($res == 200)
$api->addHeader('Refer-to: '.$to);
$api->addHeader('Referred-By: sip:c2c@'.$api->getSrcIp());


$api->reply(481,'Call Leg/Transaction Does Not Exist');

Check it out the full application here:
Click to Call with PHP-SIP

No comments: