static inline int check_sessionid(AVFormatContext *s,
                                  RTSPMessageHeader *request)
{
    RTSPState *rt = s->priv_data;
    unsigned char *session_id = rt->session_id;
    if (!session_id[0]) {
        av_log(s, AV_LOG_WARNING, "There is no session-id at the moment\n");
        return 0;
    }
    if (strcmp(session_id, request->session_id)) {
        av_log(s, AV_LOG_ERROR, "Unexpected session-id %s\n",
               request->session_id);
        rtsp_send_reply(s, RTSP_STATUS_SESSION, NULL, request->seq);
        return AVERROR_STREAM_NOT_FOUND;
    }
    return 0;
}
['static inline int check_sessionid(AVFormatContext *s,\n                                  RTSPMessageHeader *request)\n{\n    RTSPState *rt = s->priv_data;\n    unsigned char *session_id = rt->session_id;\n    if (!session_id[0]) {\n        av_log(s, AV_LOG_WARNING, "There is no session-id at the moment\\n");\n        return 0;\n    }\n    if (strcmp(session_id, request->session_id)) {\n        av_log(s, AV_LOG_ERROR, "Unexpected session-id %s\\n",\n               request->session_id);\n        rtsp_send_reply(s, RTSP_STATUS_SESSION, NULL, request->seq);\n        return AVERROR_STREAM_NOT_FOUND;\n    }\n    return 0;\n}', 'static int rtsp_send_reply(AVFormatContext *s, enum RTSPStatusCode code,\n                           const char *extracontent, uint16_t seq)\n{\n    RTSPState *rt = s->priv_data;\n    char message[4096];\n    int index = 0;\n    while (status_messages[index].code) {\n        if (status_messages[index].code == code) {\n            snprintf(message, sizeof(message), "RTSP/1.0 %d %s\\r\\n",\n                     code, status_messages[index].message);\n            break;\n        }\n        index++;\n    }\n    if (!status_messages[index].code)\n        return AVERROR(EINVAL);\n    av_strlcatf(message, sizeof(message), "CSeq: %d\\r\\n", seq);\n    av_strlcatf(message, sizeof(message), "Server: %s\\r\\n", LIBAVFORMAT_IDENT);\n    if (extracontent)\n        av_strlcat(message, extracontent, sizeof(message));\n    av_strlcat(message, "\\r\\n", sizeof(message));\n    av_dlog(s, "Sending response:\\n%s", message);\n    ffurl_write(rt->rtsp_hd, message, strlen(message));\n    return 0;\n}']