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