Index: channels/chan_sip.c =================================================================== --- channels/chan_sip.c (Revision 319012) +++ channels/chan_sip.c (Arbeitskopie) @@ -2641,7 +2641,8 @@ } ast_mutex_lock(&tcptls_session->lock); - if (!fgets(buf, sizeof(buf), tcptls_session->f)) { + size_t bytes_read; + if (!(bytes_read = fread(buf, 1, sizeof(buf), tcptls_session->f))) { ast_mutex_unlock(&tcptls_session->lock); goto cleanup; }