$value) { if($name == 'X-callid') { error_log("SIP CALL-ID:".$value\n", 0); break; } } -more details: http://php.net/manual/en/features.file-upload.php */ $target_dir = "voice_uploads/"; //target directory. make sure that PHP has write permission to this folder!!! $target_file = $target_dir . basename($_FILES["file"]["name"]); //this is the file name suggested by the webhone (normalize/sanitize it or use a file name generetad by you instead of this) if (move_uploaded_file($_FILES["file"]["tmp_name"], $target_file)) //the most important code line { echo "OK: The file ". basename( $_FILES["file"]["name"]). " has been uploaded successfully."; } else { echo "ERROR: there was an error uploading your file tmp:".basename( $_FILES["file"]["name"])."dst:".basename( $_FILES["file"]["name"]); } } handlevoicefile(); ?>