#!/usr/bin/php -q server = 'YOUR_JABBER_SERVER"; // Change this accord to you config $JABBER->port = 5222; // Change this accord to you config $JABBER->username = 'THE_NOTIFIER_USER_NAME'; // Change this accord to you config $JABBER->password = 'THE_NOTIFIER_USER_PASSWORD'; // Change this accord to you config $JABBER->resource = 'PABX'; if (!$JABBER->Connect()) { die('Could not connect!'); } else { if (!$JABBER->SendAuth()) { die('Could not authenticate!'); } else { $JABBER->SendPresence(NULL,NULL,'online'); $FromString=$agi['callerid']." ".$agi['calleridname']; $ToString=$agi['dnid']; $Body="Call from $FromString to $ToString"; $Subject="Call from Appel $FromString to $ToString"; $Content=array( 'body' => CleanMessage($Body), 'Subject' => CleanMessage($Subject), 'Thread' => "Appels telephoniques"); $JABBER->SendMessage($AGIArgs["jabberID"], 'chat', NULL, $Content); }; $JABBER->Disconnect(); }; fclose($in); fclose($err); function CleanMessage($M) { $M=str_replace("<","(",$M); $M=str_replace(">",")",$M); return $M; } ?>