1---
2c: Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLINFO_RTSP_SESSION_ID
5Section: 3
6Source: libcurl
7See-also:
8  - CURLINFO_RTSP_CSEQ_RECV (3)
9  - curl_easy_getinfo (3)
10  - curl_easy_setopt (3)
11Protocol:
12  - RTSP
13---
14
15# NAME
16
17CURLINFO_RTSP_SESSION_ID - get RTSP session ID
18
19# SYNOPSIS
20
21~~~c
22#include <curl/curl.h>
23
24CURLcode curl_easy_getinfo(CURL *handle, CURLINFO_RTSP_SESSION_ID, char **id);
25~~~
26
27# DESCRIPTION
28
29Pass a pointer to a char pointer to receive a pointer to a string holding the
30most recent RTSP Session ID.
31
32Applications wishing to resume an RTSP session on another connection should
33retrieve this info before closing the active connection.
34
35The **id** pointer is NULL or points to private memory. You MUST NOT free -
36it gets freed when you call curl_easy_cleanup(3) on the corresponding
37CURL handle.
38
39# EXAMPLE
40
41~~~c
42int main(void)
43{
44  CURL *curl = curl_easy_init();
45  if(curl) {
46    CURLcode res;
47    curl_easy_setopt(curl, CURLOPT_URL, "rtsp://rtsp.example.com");
48    res = curl_easy_perform(curl);
49    if(res == CURLE_OK) {
50      char *id;
51      curl_easy_getinfo(curl, CURLINFO_RTSP_SESSION_ID, &id);
52    }
53    curl_easy_cleanup(curl);
54  }
55}
56~~~
57
58# AVAILABILITY
59
60Added in 7.20.0
61
62# RETURN VALUE
63
64Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
65