Only send TOSERVER_RECEIVED_MEDIA when really all media has been received
Enable CURLOPT_FOLLOWLOCATION
Implement urlencode/urldecode