Commit ee5b550e authored by François Grisez's avatar François Grisez
Browse files

Linphone API: new functions to get port ranges

parent d410536b
......@@ -2442,6 +2442,14 @@ void linphone_core_get_audio_port_range(const LinphoneCore *lc, int *min_port, i
*max_port = lc->rtp_conf.audio_rtp_max_port;
}
LinphoneIntRange linphone_core_get_audio_port_range_2(const LinphoneCore *lc) {
LinphoneIntRange range = {
.min = lc->rtp_conf.audio_rtp_min_port,
.max = lc->rtp_conf.audio_rtp_max_port
};
return range;
}
int linphone_core_get_video_port(const LinphoneCore *lc){
return lc->rtp_conf.video_rtp_min_port;
}
......@@ -2451,6 +2459,14 @@ void linphone_core_get_video_port_range(const LinphoneCore *lc, int *min_port, i
*max_port = lc->rtp_conf.video_rtp_max_port;
}
LinphoneIntRange linphone_core_get_video_port_range_2(const LinphoneCore *lc) {
LinphoneIntRange range = {
.min = lc->rtp_conf.video_rtp_min_port,
.max = lc->rtp_conf.video_rtp_max_port
};
return range;
}
int linphone_core_get_text_port(const LinphoneCore *lc) {
return lc->rtp_conf.text_rtp_min_port;
}
......@@ -2460,6 +2476,14 @@ void linphone_core_get_text_port_range(const LinphoneCore *lc, int *min_port, in
*max_port = lc->rtp_conf.text_rtp_max_port;
}
LinphoneIntRange linphone_core_get_text_port_range_2(const LinphoneCore *lc) {
LinphoneIntRange range = {
.min = lc->rtp_conf.text_rtp_min_port,
.max = lc->rtp_conf.text_rtp_max_port
};
return range;
}
int linphone_core_get_nortp_timeout(const LinphoneCore *lc){
return lc->rtp_conf.nortp_timeout;
}
......
......@@ -1884,3 +1884,22 @@ void linphone_call_update_ice_from_remote_media_description(LinphoneCall *call,
linphone_call_set_symmetric_rtp(call, linphone_core_symmetric_rtp_enabled(linphone_call_get_core(call)));
}
}
/* Functions to mainpulate the LinphoneIntRange structure */
int linphone_int_range_get_min(const LinphoneIntRange *range) {
return range->min;
}
int linphone_int_range_get_max(const LinphoneIntRange *range) {
return range->max;
}
void linphone_int_range_set_min(LinphoneIntRange *range, int min) {
range->min = min;
}
void linphone_int_range_set_max(LinphoneIntRange *range, int max) {
range->max = max;
}
......@@ -2313,9 +2313,16 @@ LINPHONE_PUBLIC int linphone_core_get_audio_port(const LinphoneCore *lc);
* @param[out] min_port The lower bound of the audio port range being used
* @param[out] max_port The upper bound of the audio port range being used
* @ingroup network_parameters
* @donotwrap
*/
LINPHONE_PUBLIC void linphone_core_get_audio_port_range(const LinphoneCore *lc, int *min_port, int *max_port);
/**
* Overload of linphone_core_get_audio_port_range().
* @ingroup network_parameters
*/
LINPHONE_PUBLIC LinphoneIntRange linphone_core_get_audio_port_range_2(const LinphoneCore *lc);
/**
* Gets the UDP port used for video streaming.
* @param[in] lc LinphoneCore object
......@@ -2330,9 +2337,16 @@ LINPHONE_PUBLIC int linphone_core_get_video_port(const LinphoneCore *lc);
* @param[out] min_port The lower bound of the video port range being used
* @param[out] max_port The upper bound of the video port range being used
* @ingroup network_parameters
* @donotwrap
*/
LINPHONE_PUBLIC void linphone_core_get_video_port_range(const LinphoneCore *lc, int *min_port, int *max_port);
/**
* Overload of linphone_core_get_video_port_range().
* @ingroup network_parameters
*/
LINPHONE_PUBLIC LinphoneIntRange linphone_core_get_video_port_range_2(const LinphoneCore *lc);
/**
* Gets the UDP port used for text streaming.
* @param[in] lc LinphoneCore object
......@@ -2347,9 +2361,16 @@ LINPHONE_PUBLIC int linphone_core_get_text_port(const LinphoneCore *lc);
* @param[out] min_port The lower bound of the text port range being used
* @param[out] max_port The upper bound of the text port range being used
* @ingroup network_parameters
* @donotwrap
*/
LINPHONE_PUBLIC void linphone_core_get_text_port_range(const LinphoneCore *lc, int *min_port, int *max_port);
/**
* Overload of linphone_core_get_text_port_range().
* @ingroup network_parameters
*/
LINPHONE_PUBLIC LinphoneIntRange linphone_core_get_text_port_range_2(const LinphoneCore *lc);
/**
* Gets the value of the no-rtp timeout.
*
......
......@@ -1104,4 +1104,14 @@ typedef enum _LinphoneXmlRpcStatus {
typedef struct _LsdPlayer LsdPlayer;
/**
* Structure describing a range of integers
* @ingroup misc
*/
typedef struct _LinphoneIntRange {
int min; /**< Minimum value */
int max; /**< Maximum value */
} LinphoneIntRange;
#endif /* LINPHONE_TYPES_H_ */
......@@ -65,6 +65,30 @@ LINPHONE_PUBLIC void linphone_chat_message_resend(LinphoneChatMessage *msg);
*/
LINPHONE_PUBLIC void *linphone_vcard_get_belcard(LinphoneVcard *vcard);
/* Functions to mainpulate the LinphoneIntRange structure */
/**
* Get the minimum value of a #LinphoneIntRange.
*/
LINPHONE_PUBLIC int linphone_int_range_get_min(const LinphoneIntRange *range);
/**
* Get the maximum value of a #LinphoneIntRange.
*/
LINPHONE_PUBLIC int linphone_int_range_get_max(const LinphoneIntRange *range);
/**
* Set the minimum value of a #LinphoneIntRange.
*/
LINPHONE_PUBLIC void linphone_int_range_set_min(LinphoneIntRange *range, int min);
/**
* Set the maximum value of a #LinphoneIntRange.
*/
LINPHONE_PUBLIC void linphone_int_range_set_max(LinphoneIntRange *range, int max);
/**
* @}
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment