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