1---
2c: Copyright (C) Daniel Stenberg, <daniel.se>, et al.
3SPDX-License-Identifier: curl
4Title: CURLOPT_RTSP_SESSION_ID
5Section: 3
6Source: libcurl
7See-also:
8  - CURLOPT_RTSP_REQUEST (3)
9  - CURLOPT_RTSP_STREAM_URI (3)
10---
11
12# NAME
13
14CURLOPT_RTSP_SESSION_ID - RTSP session ID
15
16# SYNOPSIS
17
18~~~c
19#include <curl/curl.h>
20
21CURLcode curl_easy_setopt(CURL *handle, CURLOPT_RTSP_SESSION_ID, char *id);
22~~~
23
24# DESCRIPTION
25
26Pass a char pointer as a parameter to set the value of the current RTSP
27Session ID for the handle. Useful for resuming an in-progress session. Once
28this value is set to any non-NULL value, libcurl returns
29*CURLE_RTSP_SESSION_ERROR* if ID received from the server does not match. If
30unset (or set to NULL), libcurl automatically sets the ID the first time the
31server sets it in a response.
32
33The application does not have to keep the string around after setting this
34option.
35
36# DEFAULT
37
38NULL
39
40# PROTOCOLS
41
42RTSP
43
44# EXAMPLE
45
46~~~c
47int main(void)
48{
49  CURL *curl = curl_easy_init();
50  if(curl) {
51    CURLcode res;
52    char *prev_id; /* saved from before somehow */
53    curl_easy_setopt(curl, CURLOPT_URL, "rtsp://example.com/");
54    curl_easy_setopt(curl, CURLOPT_RTSP_SESSION_ID, prev_id);
55    res = curl_easy_perform(curl);
56    curl_easy_cleanup(curl);
57  }
58}
59~~~
60
61# AVAILABILITY
62
63Added in 7.20.0
64
65# RETURN VALUE
66
67Returns CURLE_OK if the option is supported, CURLE_UNKNOWN_OPTION if not, or
68CURLE_OUT_OF_MEMORY if there was insufficient heap space.
69