- Allow setting RTC and RTCP-MUX options
- Fix issue on ICE negotiation when RTCP-MUX is disabled - Make ICE negotiation smarter
This commit is contained in:
parent
93d5e1a658
commit
31d1edf3ff
|
@ -332,6 +332,20 @@ bool MediaSessionMgr::defaultsSetSRtpMode(tmedia_srtp_mode_t mode){
|
|||
return (tmedia_defaults_set_srtp_mode(mode) == 0);
|
||||
}
|
||||
|
||||
bool MediaSessionMgr::defaultsSetRtcpEnabled(bool enabled){
|
||||
return (tmedia_defaults_set_rtcp_enabled(enabled ? tsk_true : tsk_false) == 0);
|
||||
}
|
||||
bool MediaSessionMgr::defaultsGetRtcpEnabled(){
|
||||
return (tmedia_defaults_get_rtcp_enabled() == tsk_true);
|
||||
}
|
||||
|
||||
bool MediaSessionMgr::defaultsSetRtcpMuxEnabled(bool enabled){
|
||||
return (tmedia_defaults_set_rtcpmux_enabled(enabled ? tsk_true : tsk_false) == 0);
|
||||
}
|
||||
bool MediaSessionMgr::defaultsGetRtcpMuxEnabled(){
|
||||
return (tmedia_defaults_get_rtcpmux_enabled() == tsk_true);
|
||||
}
|
||||
|
||||
bool MediaSessionMgr::defaultsSetIceEnabled(bool ice_enabled){
|
||||
return (tmedia_defaults_set_ice_enabled(ice_enabled ? tsk_true : tsk_false) == 0);
|
||||
}
|
|
@ -91,6 +91,10 @@ public:
|
|||
static int32_t defaultsGetVolume();
|
||||
static bool defaultsSetInviteSessionTimers(int32_t timeout, const char* refresher);
|
||||
static bool defaultsSetSRtpMode(tmedia_srtp_mode_t mode);
|
||||
static bool defaultsSetRtcpEnabled(bool enabled);
|
||||
static bool defaultsGetRtcpEnabled();
|
||||
static bool defaultsSetRtcpMuxEnabled(bool enabled);
|
||||
static bool defaultsGetRtcpMuxEnabled();
|
||||
static bool defaultsSetIceEnabled(bool ice_enabled);
|
||||
|
||||
private:
|
||||
|
|
|
@ -520,42 +520,44 @@ bool CallSession::setSessionTimer(unsigned timeout, const char* refresher)
|
|||
|
||||
bool CallSession::set100rel(bool enabled)
|
||||
{
|
||||
if(enabled){
|
||||
return (tsip_ssession_set(m_pHandle,
|
||||
TSIP_SSESSION_SET_MEDIA(
|
||||
TSIP_MSESSION_SET_100rel(),
|
||||
TSIP_MSESSION_SET_NULL()
|
||||
),
|
||||
TSIP_SSESSION_SET_NULL()) == 0);
|
||||
}
|
||||
else{
|
||||
return (tsip_ssession_set(m_pHandle,
|
||||
TSIP_SSESSION_SET_MEDIA(
|
||||
TSIP_MSESSION_UNSET_100rel(),
|
||||
TSIP_MSESSION_SET_NULL()
|
||||
),
|
||||
TSIP_SSESSION_SET_NULL()) == 0);
|
||||
}
|
||||
return (tsip_ssession_set(m_pHandle,
|
||||
TSIP_SSESSION_SET_MEDIA(
|
||||
TSIP_MSESSION_SET_100rel(enabled ? tsk_true : tsk_false),
|
||||
TSIP_MSESSION_SET_NULL()
|
||||
),
|
||||
TSIP_SSESSION_SET_NULL()) == 0);
|
||||
}
|
||||
|
||||
bool CallSession::setRtcp(bool enabled)
|
||||
{
|
||||
return (tsip_ssession_set(m_pHandle,
|
||||
TSIP_SSESSION_SET_MEDIA(
|
||||
TSIP_MSESSION_SET_RTCP(enabled ? tsk_true : tsk_false),
|
||||
TSIP_MSESSION_SET_NULL()
|
||||
),
|
||||
TSIP_SSESSION_SET_NULL()) == 0);
|
||||
|
||||
}
|
||||
|
||||
bool CallSession::setRtcpMux(bool enabled)
|
||||
{
|
||||
return (tsip_ssession_set(m_pHandle,
|
||||
TSIP_SSESSION_SET_MEDIA(
|
||||
TSIP_MSESSION_SET_RTCPMUX(enabled ? tsk_true : tsk_false),
|
||||
TSIP_MSESSION_SET_NULL()
|
||||
),
|
||||
TSIP_SSESSION_SET_NULL()) == 0);
|
||||
|
||||
}
|
||||
|
||||
bool CallSession::setICE(bool enabled)
|
||||
{
|
||||
if(enabled){
|
||||
return (tsip_ssession_set(m_pHandle,
|
||||
TSIP_SSESSION_SET_MEDIA(
|
||||
TSIP_MSESSION_SET_ICE(),
|
||||
TSIP_MSESSION_SET_NULL()
|
||||
),
|
||||
TSIP_SSESSION_SET_NULL()) == 0);
|
||||
}
|
||||
else{
|
||||
return (tsip_ssession_set(m_pHandle,
|
||||
TSIP_SSESSION_SET_MEDIA(
|
||||
TSIP_MSESSION_UNSET_ICE(),
|
||||
TSIP_MSESSION_SET_NULL()
|
||||
),
|
||||
TSIP_SSESSION_SET_NULL()) == 0);
|
||||
}
|
||||
return (tsip_ssession_set(m_pHandle,
|
||||
TSIP_SSESSION_SET_MEDIA(
|
||||
TSIP_MSESSION_SET_ICE(enabled ? tsk_true : tsk_false),
|
||||
TSIP_MSESSION_SET_NULL()
|
||||
),
|
||||
TSIP_SSESSION_SET_NULL()) == 0);
|
||||
}
|
||||
|
||||
bool CallSession::setQoS(tmedia_qos_stype_t type, tmedia_qos_strength_t strength)
|
||||
|
|
|
@ -111,6 +111,8 @@ public: /* Public functions */
|
|||
bool callVideo(const SipUri* remoteUri, ActionConfig* config=tsk_null);
|
||||
bool setSessionTimer(unsigned timeout, const char* refresher);
|
||||
bool set100rel(bool enabled);
|
||||
bool setRtcp(bool enabled);
|
||||
bool setRtcpMux(bool enabled);
|
||||
bool setICE(bool enabled);
|
||||
bool setQoS(tmedia_qos_stype_t type, tmedia_qos_strength_t strength);
|
||||
bool hold(ActionConfig* config=tsk_null);
|
||||
|
|
|
@ -113,6 +113,16 @@ public class CallSession : InviteSession {
|
|||
return ret;
|
||||
}
|
||||
|
||||
public bool setRtcp(bool enabled) {
|
||||
bool ret = tinyWRAPPINVOKE.CallSession_setRtcp(swigCPtr, enabled);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public bool setRtcpMux(bool enabled) {
|
||||
bool ret = tinyWRAPPINVOKE.CallSession_setRtcpMux(swigCPtr, enabled);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public bool setICE(bool enabled) {
|
||||
bool ret = tinyWRAPPINVOKE.CallSession_setICE(swigCPtr, enabled);
|
||||
return ret;
|
||||
|
|
|
@ -248,6 +248,26 @@ public class MediaSessionMgr : IDisposable {
|
|||
return ret;
|
||||
}
|
||||
|
||||
public static bool defaultsSetRtcpEnabled(bool enabled) {
|
||||
bool ret = tinyWRAPPINVOKE.MediaSessionMgr_defaultsSetRtcpEnabled(enabled);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static bool defaultsGetRtcpEnabled() {
|
||||
bool ret = tinyWRAPPINVOKE.MediaSessionMgr_defaultsGetRtcpEnabled();
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static bool defaultsSetRtcpMuxEnabled(bool enabled) {
|
||||
bool ret = tinyWRAPPINVOKE.MediaSessionMgr_defaultsSetRtcpMuxEnabled(enabled);
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static bool defaultsGetRtcpMuxEnabled() {
|
||||
bool ret = tinyWRAPPINVOKE.MediaSessionMgr_defaultsGetRtcpMuxEnabled();
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static bool defaultsSetIceEnabled(bool ice_enabled) {
|
||||
bool ret = tinyWRAPPINVOKE.MediaSessionMgr_defaultsSetIceEnabled(ice_enabled);
|
||||
return ret;
|
||||
|
|
|
@ -387,6 +387,18 @@ class tinyWRAPPINVOKE {
|
|||
[DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_defaultsSetSRtpMode")]
|
||||
public static extern bool MediaSessionMgr_defaultsSetSRtpMode(int jarg1);
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_defaultsSetRtcpEnabled")]
|
||||
public static extern bool MediaSessionMgr_defaultsSetRtcpEnabled(bool jarg1);
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_defaultsGetRtcpEnabled")]
|
||||
public static extern bool MediaSessionMgr_defaultsGetRtcpEnabled();
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_defaultsSetRtcpMuxEnabled")]
|
||||
public static extern bool MediaSessionMgr_defaultsSetRtcpMuxEnabled(bool jarg1);
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_defaultsGetRtcpMuxEnabled")]
|
||||
public static extern bool MediaSessionMgr_defaultsGetRtcpMuxEnabled();
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_MediaSessionMgr_defaultsSetIceEnabled")]
|
||||
public static extern bool MediaSessionMgr_defaultsSetIceEnabled(bool jarg1);
|
||||
|
||||
|
@ -753,6 +765,12 @@ class tinyWRAPPINVOKE {
|
|||
[DllImport("tinyWRAP", EntryPoint="CSharp_CallSession_set100rel")]
|
||||
public static extern bool CallSession_set100rel(HandleRef jarg1, bool jarg2);
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_CallSession_setRtcp")]
|
||||
public static extern bool CallSession_setRtcp(HandleRef jarg1, bool jarg2);
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_CallSession_setRtcpMux")]
|
||||
public static extern bool CallSession_setRtcpMux(HandleRef jarg1, bool jarg2);
|
||||
|
||||
[DllImport("tinyWRAP", EntryPoint="CSharp_CallSession_setICE")]
|
||||
public static extern bool CallSession_setICE(HandleRef jarg1, bool jarg2);
|
||||
|
||||
|
|
|
@ -1952,6 +1952,50 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MediaSessionMgr_defaultsSetSRtpMode(i
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MediaSessionMgr_defaultsSetRtcpEnabled(unsigned int jarg1) {
|
||||
unsigned int jresult ;
|
||||
bool arg1 ;
|
||||
bool result;
|
||||
|
||||
arg1 = jarg1 ? true : false;
|
||||
result = (bool)MediaSessionMgr::defaultsSetRtcpEnabled(arg1);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MediaSessionMgr_defaultsGetRtcpEnabled() {
|
||||
unsigned int jresult ;
|
||||
bool result;
|
||||
|
||||
result = (bool)MediaSessionMgr::defaultsGetRtcpEnabled();
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MediaSessionMgr_defaultsSetRtcpMuxEnabled(unsigned int jarg1) {
|
||||
unsigned int jresult ;
|
||||
bool arg1 ;
|
||||
bool result;
|
||||
|
||||
arg1 = jarg1 ? true : false;
|
||||
result = (bool)MediaSessionMgr::defaultsSetRtcpMuxEnabled(arg1);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MediaSessionMgr_defaultsGetRtcpMuxEnabled() {
|
||||
unsigned int jresult ;
|
||||
bool result;
|
||||
|
||||
result = (bool)MediaSessionMgr::defaultsGetRtcpMuxEnabled();
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_MediaSessionMgr_defaultsSetIceEnabled(unsigned int jarg1) {
|
||||
unsigned int jresult ;
|
||||
bool arg1 ;
|
||||
|
@ -3489,6 +3533,34 @@ SWIGEXPORT unsigned int SWIGSTDCALL CSharp_CallSession_set100rel(void * jarg1, u
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_CallSession_setRtcp(void * jarg1, unsigned int jarg2) {
|
||||
unsigned int jresult ;
|
||||
CallSession *arg1 = (CallSession *) 0 ;
|
||||
bool arg2 ;
|
||||
bool result;
|
||||
|
||||
arg1 = (CallSession *)jarg1;
|
||||
arg2 = jarg2 ? true : false;
|
||||
result = (bool)(arg1)->setRtcp(arg2);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_CallSession_setRtcpMux(void * jarg1, unsigned int jarg2) {
|
||||
unsigned int jresult ;
|
||||
CallSession *arg1 = (CallSession *) 0 ;
|
||||
bool arg2 ;
|
||||
bool result;
|
||||
|
||||
arg1 = (CallSession *)jarg1;
|
||||
arg2 = jarg2 ? true : false;
|
||||
result = (bool)(arg1)->setRtcpMux(arg2);
|
||||
jresult = result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT unsigned int SWIGSTDCALL CSharp_CallSession_setICE(void * jarg1, unsigned int jarg2) {
|
||||
unsigned int jresult ;
|
||||
CallSession *arg1 = (CallSession *) 0 ;
|
||||
|
|
|
@ -95,6 +95,14 @@ public class CallSession extends InviteSession {
|
|||
return tinyWRAPJNI.CallSession_set100rel(swigCPtr, this, enabled);
|
||||
}
|
||||
|
||||
public boolean setRtcp(boolean enabled) {
|
||||
return tinyWRAPJNI.CallSession_setRtcp(swigCPtr, this, enabled);
|
||||
}
|
||||
|
||||
public boolean setRtcpMux(boolean enabled) {
|
||||
return tinyWRAPJNI.CallSession_setRtcpMux(swigCPtr, this, enabled);
|
||||
}
|
||||
|
||||
public boolean setICE(boolean enabled) {
|
||||
return tinyWRAPJNI.CallSession_setICE(swigCPtr, this, enabled);
|
||||
}
|
||||
|
|
|
@ -201,6 +201,22 @@ public class MediaSessionMgr {
|
|||
return tinyWRAPJNI.MediaSessionMgr_defaultsSetSRtpMode(mode.swigValue());
|
||||
}
|
||||
|
||||
public static boolean defaultsSetRtcpEnabled(boolean enabled) {
|
||||
return tinyWRAPJNI.MediaSessionMgr_defaultsSetRtcpEnabled(enabled);
|
||||
}
|
||||
|
||||
public static boolean defaultsGetRtcpEnabled() {
|
||||
return tinyWRAPJNI.MediaSessionMgr_defaultsGetRtcpEnabled();
|
||||
}
|
||||
|
||||
public static boolean defaultsSetRtcpMuxEnabled(boolean enabled) {
|
||||
return tinyWRAPJNI.MediaSessionMgr_defaultsSetRtcpMuxEnabled(enabled);
|
||||
}
|
||||
|
||||
public static boolean defaultsGetRtcpMuxEnabled() {
|
||||
return tinyWRAPJNI.MediaSessionMgr_defaultsGetRtcpMuxEnabled();
|
||||
}
|
||||
|
||||
public static boolean defaultsSetIceEnabled(boolean ice_enabled) {
|
||||
return tinyWRAPJNI.MediaSessionMgr_defaultsSetIceEnabled(ice_enabled);
|
||||
}
|
||||
|
|
|
@ -95,6 +95,14 @@ public class CallSession extends InviteSession {
|
|||
return tinyWRAPJNI.CallSession_set100rel(swigCPtr, this, enabled);
|
||||
}
|
||||
|
||||
public boolean setRtcp(boolean enabled) {
|
||||
return tinyWRAPJNI.CallSession_setRtcp(swigCPtr, this, enabled);
|
||||
}
|
||||
|
||||
public boolean setRtcpMux(boolean enabled) {
|
||||
return tinyWRAPJNI.CallSession_setRtcpMux(swigCPtr, this, enabled);
|
||||
}
|
||||
|
||||
public boolean setICE(boolean enabled) {
|
||||
return tinyWRAPJNI.CallSession_setICE(swigCPtr, this, enabled);
|
||||
}
|
||||
|
|
|
@ -201,6 +201,22 @@ public class MediaSessionMgr {
|
|||
return tinyWRAPJNI.MediaSessionMgr_defaultsSetSRtpMode(mode.swigValue());
|
||||
}
|
||||
|
||||
public static boolean defaultsSetRtcpEnabled(boolean enabled) {
|
||||
return tinyWRAPJNI.MediaSessionMgr_defaultsSetRtcpEnabled(enabled);
|
||||
}
|
||||
|
||||
public static boolean defaultsGetRtcpEnabled() {
|
||||
return tinyWRAPJNI.MediaSessionMgr_defaultsGetRtcpEnabled();
|
||||
}
|
||||
|
||||
public static boolean defaultsSetRtcpMuxEnabled(boolean enabled) {
|
||||
return tinyWRAPJNI.MediaSessionMgr_defaultsSetRtcpMuxEnabled(enabled);
|
||||
}
|
||||
|
||||
public static boolean defaultsGetRtcpMuxEnabled() {
|
||||
return tinyWRAPJNI.MediaSessionMgr_defaultsGetRtcpMuxEnabled();
|
||||
}
|
||||
|
||||
public static boolean defaultsSetIceEnabled(boolean ice_enabled) {
|
||||
return tinyWRAPJNI.MediaSessionMgr_defaultsSetIceEnabled(ice_enabled);
|
||||
}
|
||||
|
|
|
@ -76,6 +76,10 @@ public class tinyWRAPJNI {
|
|||
public final static native int MediaSessionMgr_defaultsGetVolume();
|
||||
public final static native boolean MediaSessionMgr_defaultsSetInviteSessionTimers(int jarg1, String jarg2);
|
||||
public final static native boolean MediaSessionMgr_defaultsSetSRtpMode(int jarg1);
|
||||
public final static native boolean MediaSessionMgr_defaultsSetRtcpEnabled(boolean jarg1);
|
||||
public final static native boolean MediaSessionMgr_defaultsGetRtcpEnabled();
|
||||
public final static native boolean MediaSessionMgr_defaultsSetRtcpMuxEnabled(boolean jarg1);
|
||||
public final static native boolean MediaSessionMgr_defaultsGetRtcpMuxEnabled();
|
||||
public final static native boolean MediaSessionMgr_defaultsSetIceEnabled(boolean jarg1);
|
||||
public final static native void delete_MediaContent(long jarg1);
|
||||
public final static native String MediaContent_getType(long jarg1, MediaContent jarg1_);
|
||||
|
@ -198,6 +202,8 @@ public class tinyWRAPJNI {
|
|||
public final static native boolean CallSession_callVideo__SWIG_3(long jarg1, CallSession jarg1_, long jarg2, SipUri jarg2_);
|
||||
public final static native boolean CallSession_setSessionTimer(long jarg1, CallSession jarg1_, long jarg2, String jarg3);
|
||||
public final static native boolean CallSession_set100rel(long jarg1, CallSession jarg1_, boolean jarg2);
|
||||
public final static native boolean CallSession_setRtcp(long jarg1, CallSession jarg1_, boolean jarg2);
|
||||
public final static native boolean CallSession_setRtcpMux(long jarg1, CallSession jarg1_, boolean jarg2);
|
||||
public final static native boolean CallSession_setICE(long jarg1, CallSession jarg1_, boolean jarg2);
|
||||
public final static native boolean CallSession_setQoS(long jarg1, CallSession jarg1_, int jarg2, int jarg3);
|
||||
public final static native boolean CallSession_hold__SWIG_0(long jarg1, CallSession jarg1_, long jarg2, ActionConfig jarg2_);
|
||||
|
|
|
@ -2956,6 +2956,58 @@ SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionM
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetRtcpEnabled(JNIEnv *jenv, jclass jcls, jboolean jarg1) {
|
||||
jboolean jresult = 0 ;
|
||||
bool arg1 ;
|
||||
bool result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
arg1 = jarg1 ? true : false;
|
||||
result = (bool)MediaSessionMgr::defaultsSetRtcpEnabled(arg1);
|
||||
jresult = (jboolean)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsGetRtcpEnabled(JNIEnv *jenv, jclass jcls) {
|
||||
jboolean jresult = 0 ;
|
||||
bool result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
result = (bool)MediaSessionMgr::defaultsGetRtcpEnabled();
|
||||
jresult = (jboolean)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetRtcpMuxEnabled(JNIEnv *jenv, jclass jcls, jboolean jarg1) {
|
||||
jboolean jresult = 0 ;
|
||||
bool arg1 ;
|
||||
bool result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
arg1 = jarg1 ? true : false;
|
||||
result = (bool)MediaSessionMgr::defaultsSetRtcpMuxEnabled(arg1);
|
||||
jresult = (jboolean)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsGetRtcpMuxEnabled(JNIEnv *jenv, jclass jcls) {
|
||||
jboolean jresult = 0 ;
|
||||
bool result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
result = (bool)MediaSessionMgr::defaultsGetRtcpMuxEnabled();
|
||||
jresult = (jboolean)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetIceEnabled(JNIEnv *jenv, jclass jcls, jboolean jarg1) {
|
||||
jboolean jresult = 0 ;
|
||||
bool arg1 ;
|
||||
|
@ -5042,6 +5094,40 @@ SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_CallSession_1
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_CallSession_1setRtcp(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) {
|
||||
jboolean jresult = 0 ;
|
||||
CallSession *arg1 = (CallSession *) 0 ;
|
||||
bool arg2 ;
|
||||
bool result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(CallSession **)&jarg1;
|
||||
arg2 = jarg2 ? true : false;
|
||||
result = (bool)(arg1)->setRtcp(arg2);
|
||||
jresult = (jboolean)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_CallSession_1setRtcpMux(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) {
|
||||
jboolean jresult = 0 ;
|
||||
CallSession *arg1 = (CallSession *) 0 ;
|
||||
bool arg2 ;
|
||||
bool result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(CallSession **)&jarg1;
|
||||
arg2 = jarg2 ? true : false;
|
||||
result = (bool)(arg1)->setRtcpMux(arg2);
|
||||
jresult = (jboolean)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_CallSession_1setICE(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) {
|
||||
jboolean jresult = 0 ;
|
||||
CallSession *arg1 = (CallSession *) 0 ;
|
||||
|
|
|
@ -76,6 +76,10 @@ public class tinyWRAPJNI {
|
|||
public final static native int MediaSessionMgr_defaultsGetVolume();
|
||||
public final static native boolean MediaSessionMgr_defaultsSetInviteSessionTimers(int jarg1, String jarg2);
|
||||
public final static native boolean MediaSessionMgr_defaultsSetSRtpMode(int jarg1);
|
||||
public final static native boolean MediaSessionMgr_defaultsSetRtcpEnabled(boolean jarg1);
|
||||
public final static native boolean MediaSessionMgr_defaultsGetRtcpEnabled();
|
||||
public final static native boolean MediaSessionMgr_defaultsSetRtcpMuxEnabled(boolean jarg1);
|
||||
public final static native boolean MediaSessionMgr_defaultsGetRtcpMuxEnabled();
|
||||
public final static native boolean MediaSessionMgr_defaultsSetIceEnabled(boolean jarg1);
|
||||
public final static native void delete_MediaContent(long jarg1);
|
||||
public final static native String MediaContent_getType(long jarg1, MediaContent jarg1_);
|
||||
|
@ -198,6 +202,8 @@ public class tinyWRAPJNI {
|
|||
public final static native boolean CallSession_callVideo__SWIG_3(long jarg1, CallSession jarg1_, long jarg2, SipUri jarg2_);
|
||||
public final static native boolean CallSession_setSessionTimer(long jarg1, CallSession jarg1_, long jarg2, String jarg3);
|
||||
public final static native boolean CallSession_set100rel(long jarg1, CallSession jarg1_, boolean jarg2);
|
||||
public final static native boolean CallSession_setRtcp(long jarg1, CallSession jarg1_, boolean jarg2);
|
||||
public final static native boolean CallSession_setRtcpMux(long jarg1, CallSession jarg1_, boolean jarg2);
|
||||
public final static native boolean CallSession_setICE(long jarg1, CallSession jarg1_, boolean jarg2);
|
||||
public final static native boolean CallSession_setQoS(long jarg1, CallSession jarg1_, int jarg2, int jarg3);
|
||||
public final static native boolean CallSession_hold__SWIG_0(long jarg1, CallSession jarg1_, long jarg2, ActionConfig jarg2_);
|
||||
|
|
|
@ -2956,6 +2956,58 @@ SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionM
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetRtcpEnabled(JNIEnv *jenv, jclass jcls, jboolean jarg1) {
|
||||
jboolean jresult = 0 ;
|
||||
bool arg1 ;
|
||||
bool result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
arg1 = jarg1 ? true : false;
|
||||
result = (bool)MediaSessionMgr::defaultsSetRtcpEnabled(arg1);
|
||||
jresult = (jboolean)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsGetRtcpEnabled(JNIEnv *jenv, jclass jcls) {
|
||||
jboolean jresult = 0 ;
|
||||
bool result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
result = (bool)MediaSessionMgr::defaultsGetRtcpEnabled();
|
||||
jresult = (jboolean)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetRtcpMuxEnabled(JNIEnv *jenv, jclass jcls, jboolean jarg1) {
|
||||
jboolean jresult = 0 ;
|
||||
bool arg1 ;
|
||||
bool result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
arg1 = jarg1 ? true : false;
|
||||
result = (bool)MediaSessionMgr::defaultsSetRtcpMuxEnabled(arg1);
|
||||
jresult = (jboolean)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsGetRtcpMuxEnabled(JNIEnv *jenv, jclass jcls) {
|
||||
jboolean jresult = 0 ;
|
||||
bool result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
result = (bool)MediaSessionMgr::defaultsGetRtcpMuxEnabled();
|
||||
jresult = (jboolean)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_MediaSessionMgr_1defaultsSetIceEnabled(JNIEnv *jenv, jclass jcls, jboolean jarg1) {
|
||||
jboolean jresult = 0 ;
|
||||
bool arg1 ;
|
||||
|
@ -5042,6 +5094,40 @@ SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_CallSession_1
|
|||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_CallSession_1setRtcp(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) {
|
||||
jboolean jresult = 0 ;
|
||||
CallSession *arg1 = (CallSession *) 0 ;
|
||||
bool arg2 ;
|
||||
bool result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(CallSession **)&jarg1;
|
||||
arg2 = jarg2 ? true : false;
|
||||
result = (bool)(arg1)->setRtcp(arg2);
|
||||
jresult = (jboolean)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_CallSession_1setRtcpMux(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) {
|
||||
jboolean jresult = 0 ;
|
||||
CallSession *arg1 = (CallSession *) 0 ;
|
||||
bool arg2 ;
|
||||
bool result;
|
||||
|
||||
(void)jenv;
|
||||
(void)jcls;
|
||||
(void)jarg1_;
|
||||
arg1 = *(CallSession **)&jarg1;
|
||||
arg2 = jarg2 ? true : false;
|
||||
result = (bool)(arg1)->setRtcpMux(arg2);
|
||||
jresult = (jboolean)result;
|
||||
return jresult;
|
||||
}
|
||||
|
||||
|
||||
SWIGEXPORT jboolean JNICALL Java_org_doubango_tinyWRAP_tinyWRAPJNI_CallSession_1setICE(JNIEnv *jenv, jclass jcls, jlong jarg1, jobject jarg1_, jboolean jarg2) {
|
||||
jboolean jresult = 0 ;
|
||||
CallSession *arg1 = (CallSession *) 0 ;
|
||||
|
|
|
@ -233,6 +233,10 @@ sub DESTROY {
|
|||
*defaultsGetVolume = *tinyWRAPc::MediaSessionMgr_defaultsGetVolume;
|
||||
*defaultsSetInviteSessionTimers = *tinyWRAPc::MediaSessionMgr_defaultsSetInviteSessionTimers;
|
||||
*defaultsSetSRtpMode = *tinyWRAPc::MediaSessionMgr_defaultsSetSRtpMode;
|
||||
*defaultsSetRtcpEnabled = *tinyWRAPc::MediaSessionMgr_defaultsSetRtcpEnabled;
|
||||
*defaultsGetRtcpEnabled = *tinyWRAPc::MediaSessionMgr_defaultsGetRtcpEnabled;
|
||||
*defaultsSetRtcpMuxEnabled = *tinyWRAPc::MediaSessionMgr_defaultsSetRtcpMuxEnabled;
|
||||
*defaultsGetRtcpMuxEnabled = *tinyWRAPc::MediaSessionMgr_defaultsGetRtcpMuxEnabled;
|
||||
*defaultsSetIceEnabled = *tinyWRAPc::MediaSessionMgr_defaultsSetIceEnabled;
|
||||
sub DISOWN {
|
||||
my $self = shift;
|
||||
|
@ -903,6 +907,8 @@ sub DESTROY {
|
|||
*callVideo = *tinyWRAPc::CallSession_callVideo;
|
||||
*setSessionTimer = *tinyWRAPc::CallSession_setSessionTimer;
|
||||
*set100rel = *tinyWRAPc::CallSession_set100rel;
|
||||
*setRtcp = *tinyWRAPc::CallSession_setRtcp;
|
||||
*setRtcpMux = *tinyWRAPc::CallSession_setRtcpMux;
|
||||
*setICE = *tinyWRAPc::CallSession_setICE;
|
||||
*setQoS = *tinyWRAPc::CallSession_setQoS;
|
||||
*hold = *tinyWRAPc::CallSession_hold;
|
||||
|
|
|
@ -4361,6 +4361,98 @@ XS(_wrap_MediaSessionMgr_defaultsSetSRtpMode) {
|
|||
}
|
||||
|
||||
|
||||
XS(_wrap_MediaSessionMgr_defaultsSetRtcpEnabled) {
|
||||
{
|
||||
bool arg1 ;
|
||||
bool val1 ;
|
||||
int ecode1 = 0 ;
|
||||
int argvi = 0;
|
||||
bool result;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 1) || (items > 1)) {
|
||||
SWIG_croak("Usage: MediaSessionMgr_defaultsSetRtcpEnabled(enabled);");
|
||||
}
|
||||
ecode1 = SWIG_AsVal_bool SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
|
||||
if (!SWIG_IsOK(ecode1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "MediaSessionMgr_defaultsSetRtcpEnabled" "', argument " "1"" of type '" "bool""'");
|
||||
}
|
||||
arg1 = static_cast< bool >(val1);
|
||||
result = (bool)MediaSessionMgr::defaultsSetRtcpEnabled(arg1);
|
||||
ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
|
||||
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_MediaSessionMgr_defaultsGetRtcpEnabled) {
|
||||
{
|
||||
int argvi = 0;
|
||||
bool result;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 0) || (items > 0)) {
|
||||
SWIG_croak("Usage: MediaSessionMgr_defaultsGetRtcpEnabled();");
|
||||
}
|
||||
result = (bool)MediaSessionMgr::defaultsGetRtcpEnabled();
|
||||
ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_MediaSessionMgr_defaultsSetRtcpMuxEnabled) {
|
||||
{
|
||||
bool arg1 ;
|
||||
bool val1 ;
|
||||
int ecode1 = 0 ;
|
||||
int argvi = 0;
|
||||
bool result;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 1) || (items > 1)) {
|
||||
SWIG_croak("Usage: MediaSessionMgr_defaultsSetRtcpMuxEnabled(enabled);");
|
||||
}
|
||||
ecode1 = SWIG_AsVal_bool SWIG_PERL_CALL_ARGS_2(ST(0), &val1);
|
||||
if (!SWIG_IsOK(ecode1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "MediaSessionMgr_defaultsSetRtcpMuxEnabled" "', argument " "1"" of type '" "bool""'");
|
||||
}
|
||||
arg1 = static_cast< bool >(val1);
|
||||
result = (bool)MediaSessionMgr::defaultsSetRtcpMuxEnabled(arg1);
|
||||
ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
|
||||
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_MediaSessionMgr_defaultsGetRtcpMuxEnabled) {
|
||||
{
|
||||
int argvi = 0;
|
||||
bool result;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 0) || (items > 0)) {
|
||||
SWIG_croak("Usage: MediaSessionMgr_defaultsGetRtcpMuxEnabled();");
|
||||
}
|
||||
result = (bool)MediaSessionMgr::defaultsGetRtcpMuxEnabled();
|
||||
ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_MediaSessionMgr_defaultsSetIceEnabled) {
|
||||
{
|
||||
bool arg1 ;
|
||||
|
@ -10059,6 +10151,82 @@ XS(_wrap_CallSession_set100rel) {
|
|||
}
|
||||
|
||||
|
||||
XS(_wrap_CallSession_setRtcp) {
|
||||
{
|
||||
CallSession *arg1 = (CallSession *) 0 ;
|
||||
bool arg2 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
bool val2 ;
|
||||
int ecode2 = 0 ;
|
||||
int argvi = 0;
|
||||
bool result;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 2) || (items > 2)) {
|
||||
SWIG_croak("Usage: CallSession_setRtcp(self,enabled);");
|
||||
}
|
||||
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CallSession, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CallSession_setRtcp" "', argument " "1"" of type '" "CallSession *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< CallSession * >(argp1);
|
||||
ecode2 = SWIG_AsVal_bool SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
|
||||
if (!SWIG_IsOK(ecode2)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CallSession_setRtcp" "', argument " "2"" of type '" "bool""'");
|
||||
}
|
||||
arg2 = static_cast< bool >(val2);
|
||||
result = (bool)(arg1)->setRtcp(arg2);
|
||||
ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
|
||||
|
||||
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
|
||||
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_CallSession_setRtcpMux) {
|
||||
{
|
||||
CallSession *arg1 = (CallSession *) 0 ;
|
||||
bool arg2 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
bool val2 ;
|
||||
int ecode2 = 0 ;
|
||||
int argvi = 0;
|
||||
bool result;
|
||||
dXSARGS;
|
||||
|
||||
if ((items < 2) || (items > 2)) {
|
||||
SWIG_croak("Usage: CallSession_setRtcpMux(self,enabled);");
|
||||
}
|
||||
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_CallSession, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CallSession_setRtcpMux" "', argument " "1"" of type '" "CallSession *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< CallSession * >(argp1);
|
||||
ecode2 = SWIG_AsVal_bool SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
|
||||
if (!SWIG_IsOK(ecode2)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CallSession_setRtcpMux" "', argument " "2"" of type '" "bool""'");
|
||||
}
|
||||
arg2 = static_cast< bool >(val2);
|
||||
result = (bool)(arg1)->setRtcpMux(arg2);
|
||||
ST(argvi) = SWIG_From_bool SWIG_PERL_CALL_ARGS_1(static_cast< bool >(result)); argvi++ ;
|
||||
|
||||
|
||||
XSRETURN(argvi);
|
||||
fail:
|
||||
|
||||
|
||||
SWIG_croak_null();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
XS(_wrap_CallSession_setICE) {
|
||||
{
|
||||
CallSession *arg1 = (CallSession *) 0 ;
|
||||
|
@ -23821,6 +23989,10 @@ static swig_command_info swig_commands[] = {
|
|||
{"tinyWRAPc::MediaSessionMgr_defaultsGetVolume", _wrap_MediaSessionMgr_defaultsGetVolume},
|
||||
{"tinyWRAPc::MediaSessionMgr_defaultsSetInviteSessionTimers", _wrap_MediaSessionMgr_defaultsSetInviteSessionTimers},
|
||||
{"tinyWRAPc::MediaSessionMgr_defaultsSetSRtpMode", _wrap_MediaSessionMgr_defaultsSetSRtpMode},
|
||||
{"tinyWRAPc::MediaSessionMgr_defaultsSetRtcpEnabled", _wrap_MediaSessionMgr_defaultsSetRtcpEnabled},
|
||||
{"tinyWRAPc::MediaSessionMgr_defaultsGetRtcpEnabled", _wrap_MediaSessionMgr_defaultsGetRtcpEnabled},
|
||||
{"tinyWRAPc::MediaSessionMgr_defaultsSetRtcpMuxEnabled", _wrap_MediaSessionMgr_defaultsSetRtcpMuxEnabled},
|
||||
{"tinyWRAPc::MediaSessionMgr_defaultsGetRtcpMuxEnabled", _wrap_MediaSessionMgr_defaultsGetRtcpMuxEnabled},
|
||||
{"tinyWRAPc::MediaSessionMgr_defaultsSetIceEnabled", _wrap_MediaSessionMgr_defaultsSetIceEnabled},
|
||||
{"tinyWRAPc::delete_MediaContent", _wrap_delete_MediaContent},
|
||||
{"tinyWRAPc::MediaContent_getType", _wrap_MediaContent_getType},
|
||||
|
@ -23921,6 +24093,8 @@ static swig_command_info swig_commands[] = {
|
|||
{"tinyWRAPc::CallSession_callVideo", _wrap_CallSession_callVideo},
|
||||
{"tinyWRAPc::CallSession_setSessionTimer", _wrap_CallSession_setSessionTimer},
|
||||
{"tinyWRAPc::CallSession_set100rel", _wrap_CallSession_set100rel},
|
||||
{"tinyWRAPc::CallSession_setRtcp", _wrap_CallSession_setRtcp},
|
||||
{"tinyWRAPc::CallSession_setRtcpMux", _wrap_CallSession_setRtcpMux},
|
||||
{"tinyWRAPc::CallSession_setICE", _wrap_CallSession_setICE},
|
||||
{"tinyWRAPc::CallSession_setQoS", _wrap_CallSession_setQoS},
|
||||
{"tinyWRAPc::CallSession_hold", _wrap_CallSession_hold},
|
||||
|
|
|
@ -227,6 +227,14 @@ class MediaSessionMgr(_object):
|
|||
if _newclass:defaultsSetInviteSessionTimers = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsSetInviteSessionTimers)
|
||||
__swig_getmethods__["defaultsSetSRtpMode"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsSetSRtpMode
|
||||
if _newclass:defaultsSetSRtpMode = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsSetSRtpMode)
|
||||
__swig_getmethods__["defaultsSetRtcpEnabled"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsSetRtcpEnabled
|
||||
if _newclass:defaultsSetRtcpEnabled = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsSetRtcpEnabled)
|
||||
__swig_getmethods__["defaultsGetRtcpEnabled"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsGetRtcpEnabled
|
||||
if _newclass:defaultsGetRtcpEnabled = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsGetRtcpEnabled)
|
||||
__swig_getmethods__["defaultsSetRtcpMuxEnabled"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsSetRtcpMuxEnabled
|
||||
if _newclass:defaultsSetRtcpMuxEnabled = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsSetRtcpMuxEnabled)
|
||||
__swig_getmethods__["defaultsGetRtcpMuxEnabled"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsGetRtcpMuxEnabled
|
||||
if _newclass:defaultsGetRtcpMuxEnabled = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsGetRtcpMuxEnabled)
|
||||
__swig_getmethods__["defaultsSetIceEnabled"] = lambda x: _tinyWRAP.MediaSessionMgr_defaultsSetIceEnabled
|
||||
if _newclass:defaultsSetIceEnabled = staticmethod(_tinyWRAP.MediaSessionMgr_defaultsSetIceEnabled)
|
||||
MediaSessionMgr_swigregister = _tinyWRAP.MediaSessionMgr_swigregister
|
||||
|
@ -360,6 +368,22 @@ def MediaSessionMgr_defaultsSetSRtpMode(*args):
|
|||
return _tinyWRAP.MediaSessionMgr_defaultsSetSRtpMode(*args)
|
||||
MediaSessionMgr_defaultsSetSRtpMode = _tinyWRAP.MediaSessionMgr_defaultsSetSRtpMode
|
||||
|
||||
def MediaSessionMgr_defaultsSetRtcpEnabled(*args):
|
||||
return _tinyWRAP.MediaSessionMgr_defaultsSetRtcpEnabled(*args)
|
||||
MediaSessionMgr_defaultsSetRtcpEnabled = _tinyWRAP.MediaSessionMgr_defaultsSetRtcpEnabled
|
||||
|
||||
def MediaSessionMgr_defaultsGetRtcpEnabled():
|
||||
return _tinyWRAP.MediaSessionMgr_defaultsGetRtcpEnabled()
|
||||
MediaSessionMgr_defaultsGetRtcpEnabled = _tinyWRAP.MediaSessionMgr_defaultsGetRtcpEnabled
|
||||
|
||||
def MediaSessionMgr_defaultsSetRtcpMuxEnabled(*args):
|
||||
return _tinyWRAP.MediaSessionMgr_defaultsSetRtcpMuxEnabled(*args)
|
||||
MediaSessionMgr_defaultsSetRtcpMuxEnabled = _tinyWRAP.MediaSessionMgr_defaultsSetRtcpMuxEnabled
|
||||
|
||||
def MediaSessionMgr_defaultsGetRtcpMuxEnabled():
|
||||
return _tinyWRAP.MediaSessionMgr_defaultsGetRtcpMuxEnabled()
|
||||
MediaSessionMgr_defaultsGetRtcpMuxEnabled = _tinyWRAP.MediaSessionMgr_defaultsGetRtcpMuxEnabled
|
||||
|
||||
def MediaSessionMgr_defaultsSetIceEnabled(*args):
|
||||
return _tinyWRAP.MediaSessionMgr_defaultsSetIceEnabled(*args)
|
||||
MediaSessionMgr_defaultsSetIceEnabled = _tinyWRAP.MediaSessionMgr_defaultsSetIceEnabled
|
||||
|
@ -699,6 +723,8 @@ class CallSession(InviteSession):
|
|||
def callVideo(self, *args): return _tinyWRAP.CallSession_callVideo(self, *args)
|
||||
def setSessionTimer(self, *args): return _tinyWRAP.CallSession_setSessionTimer(self, *args)
|
||||
def set100rel(self, *args): return _tinyWRAP.CallSession_set100rel(self, *args)
|
||||
def setRtcp(self, *args): return _tinyWRAP.CallSession_setRtcp(self, *args)
|
||||
def setRtcpMux(self, *args): return _tinyWRAP.CallSession_setRtcpMux(self, *args)
|
||||
def setICE(self, *args): return _tinyWRAP.CallSession_setICE(self, *args)
|
||||
def setQoS(self, *args): return _tinyWRAP.CallSession_setQoS(self, *args)
|
||||
def hold(self, *args): return _tinyWRAP.CallSession_hold(self, *args)
|
||||
|
|
|
@ -7200,6 +7200,76 @@ fail:
|
|||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_MediaSessionMgr_defaultsSetRtcpEnabled(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
bool arg1 ;
|
||||
bool val1 ;
|
||||
int ecode1 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
bool result;
|
||||
|
||||
if (!PyArg_ParseTuple(args,(char *)"O:MediaSessionMgr_defaultsSetRtcpEnabled",&obj0)) SWIG_fail;
|
||||
ecode1 = SWIG_AsVal_bool(obj0, &val1);
|
||||
if (!SWIG_IsOK(ecode1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "MediaSessionMgr_defaultsSetRtcpEnabled" "', argument " "1"" of type '" "bool""'");
|
||||
}
|
||||
arg1 = static_cast< bool >(val1);
|
||||
result = (bool)MediaSessionMgr::defaultsSetRtcpEnabled(arg1);
|
||||
resultobj = SWIG_From_bool(static_cast< bool >(result));
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_MediaSessionMgr_defaultsGetRtcpEnabled(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
bool result;
|
||||
|
||||
if (!PyArg_ParseTuple(args,(char *)":MediaSessionMgr_defaultsGetRtcpEnabled")) SWIG_fail;
|
||||
result = (bool)MediaSessionMgr::defaultsGetRtcpEnabled();
|
||||
resultobj = SWIG_From_bool(static_cast< bool >(result));
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_MediaSessionMgr_defaultsSetRtcpMuxEnabled(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
bool arg1 ;
|
||||
bool val1 ;
|
||||
int ecode1 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
bool result;
|
||||
|
||||
if (!PyArg_ParseTuple(args,(char *)"O:MediaSessionMgr_defaultsSetRtcpMuxEnabled",&obj0)) SWIG_fail;
|
||||
ecode1 = SWIG_AsVal_bool(obj0, &val1);
|
||||
if (!SWIG_IsOK(ecode1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "MediaSessionMgr_defaultsSetRtcpMuxEnabled" "', argument " "1"" of type '" "bool""'");
|
||||
}
|
||||
arg1 = static_cast< bool >(val1);
|
||||
result = (bool)MediaSessionMgr::defaultsSetRtcpMuxEnabled(arg1);
|
||||
resultobj = SWIG_From_bool(static_cast< bool >(result));
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_MediaSessionMgr_defaultsGetRtcpMuxEnabled(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
bool result;
|
||||
|
||||
if (!PyArg_ParseTuple(args,(char *)":MediaSessionMgr_defaultsGetRtcpMuxEnabled")) SWIG_fail;
|
||||
result = (bool)MediaSessionMgr::defaultsGetRtcpMuxEnabled();
|
||||
resultobj = SWIG_From_bool(static_cast< bool >(result));
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_MediaSessionMgr_defaultsSetIceEnabled(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
bool arg1 ;
|
||||
|
@ -11629,6 +11699,68 @@ fail:
|
|||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_CallSession_setRtcp(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
CallSession *arg1 = (CallSession *) 0 ;
|
||||
bool arg2 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
bool val2 ;
|
||||
int ecode2 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
PyObject * obj1 = 0 ;
|
||||
bool result;
|
||||
|
||||
if (!PyArg_ParseTuple(args,(char *)"OO:CallSession_setRtcp",&obj0,&obj1)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CallSession, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CallSession_setRtcp" "', argument " "1"" of type '" "CallSession *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< CallSession * >(argp1);
|
||||
ecode2 = SWIG_AsVal_bool(obj1, &val2);
|
||||
if (!SWIG_IsOK(ecode2)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CallSession_setRtcp" "', argument " "2"" of type '" "bool""'");
|
||||
}
|
||||
arg2 = static_cast< bool >(val2);
|
||||
result = (bool)(arg1)->setRtcp(arg2);
|
||||
resultobj = SWIG_From_bool(static_cast< bool >(result));
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_CallSession_setRtcpMux(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
CallSession *arg1 = (CallSession *) 0 ;
|
||||
bool arg2 ;
|
||||
void *argp1 = 0 ;
|
||||
int res1 = 0 ;
|
||||
bool val2 ;
|
||||
int ecode2 = 0 ;
|
||||
PyObject * obj0 = 0 ;
|
||||
PyObject * obj1 = 0 ;
|
||||
bool result;
|
||||
|
||||
if (!PyArg_ParseTuple(args,(char *)"OO:CallSession_setRtcpMux",&obj0,&obj1)) SWIG_fail;
|
||||
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CallSession, 0 | 0 );
|
||||
if (!SWIG_IsOK(res1)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CallSession_setRtcpMux" "', argument " "1"" of type '" "CallSession *""'");
|
||||
}
|
||||
arg1 = reinterpret_cast< CallSession * >(argp1);
|
||||
ecode2 = SWIG_AsVal_bool(obj1, &val2);
|
||||
if (!SWIG_IsOK(ecode2)) {
|
||||
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CallSession_setRtcpMux" "', argument " "2"" of type '" "bool""'");
|
||||
}
|
||||
arg2 = static_cast< bool >(val2);
|
||||
result = (bool)(arg1)->setRtcpMux(arg2);
|
||||
resultobj = SWIG_From_bool(static_cast< bool >(result));
|
||||
return resultobj;
|
||||
fail:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
SWIGINTERN PyObject *_wrap_CallSession_setICE(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
|
||||
PyObject *resultobj = 0;
|
||||
CallSession *arg1 = (CallSession *) 0 ;
|
||||
|
@ -23004,6 +23136,10 @@ static PyMethodDef SwigMethods[] = {
|
|||
{ (char *)"MediaSessionMgr_defaultsGetVolume", _wrap_MediaSessionMgr_defaultsGetVolume, METH_VARARGS, NULL},
|
||||
{ (char *)"MediaSessionMgr_defaultsSetInviteSessionTimers", _wrap_MediaSessionMgr_defaultsSetInviteSessionTimers, METH_VARARGS, NULL},
|
||||
{ (char *)"MediaSessionMgr_defaultsSetSRtpMode", _wrap_MediaSessionMgr_defaultsSetSRtpMode, METH_VARARGS, NULL},
|
||||
{ (char *)"MediaSessionMgr_defaultsSetRtcpEnabled", _wrap_MediaSessionMgr_defaultsSetRtcpEnabled, METH_VARARGS, NULL},
|
||||
{ (char *)"MediaSessionMgr_defaultsGetRtcpEnabled", _wrap_MediaSessionMgr_defaultsGetRtcpEnabled, METH_VARARGS, NULL},
|
||||
{ (char *)"MediaSessionMgr_defaultsSetRtcpMuxEnabled", _wrap_MediaSessionMgr_defaultsSetRtcpMuxEnabled, METH_VARARGS, NULL},
|
||||
{ (char *)"MediaSessionMgr_defaultsGetRtcpMuxEnabled", _wrap_MediaSessionMgr_defaultsGetRtcpMuxEnabled, METH_VARARGS, NULL},
|
||||
{ (char *)"MediaSessionMgr_defaultsSetIceEnabled", _wrap_MediaSessionMgr_defaultsSetIceEnabled, METH_VARARGS, NULL},
|
||||
{ (char *)"MediaSessionMgr_swigregister", MediaSessionMgr_swigregister, METH_VARARGS, NULL},
|
||||
{ (char *)"delete_MediaContent", _wrap_delete_MediaContent, METH_VARARGS, NULL},
|
||||
|
@ -23122,6 +23258,8 @@ static PyMethodDef SwigMethods[] = {
|
|||
{ (char *)"CallSession_callVideo", _wrap_CallSession_callVideo, METH_VARARGS, NULL},
|
||||
{ (char *)"CallSession_setSessionTimer", _wrap_CallSession_setSessionTimer, METH_VARARGS, NULL},
|
||||
{ (char *)"CallSession_set100rel", _wrap_CallSession_set100rel, METH_VARARGS, NULL},
|
||||
{ (char *)"CallSession_setRtcp", _wrap_CallSession_setRtcp, METH_VARARGS, NULL},
|
||||
{ (char *)"CallSession_setRtcpMux", _wrap_CallSession_setRtcpMux, METH_VARARGS, NULL},
|
||||
{ (char *)"CallSession_setICE", _wrap_CallSession_setICE, METH_VARARGS, NULL},
|
||||
{ (char *)"CallSession_setQoS", _wrap_CallSession_setQoS, METH_VARARGS, NULL},
|
||||
{ (char *)"CallSession_hold", _wrap_CallSession_hold, METH_VARARGS, NULL},
|
||||
|
|
|
@ -48,7 +48,7 @@ typedef struct tdav_session_av_s
|
|||
|
||||
tsk_bool_t use_ipv6;
|
||||
tsk_bool_t use_rtcp;
|
||||
tsk_bool_t use_rtcp_mux;
|
||||
tsk_bool_t use_rtcpmux;
|
||||
tmedia_type_t media_type;
|
||||
tsk_bool_t use_avpf;
|
||||
tsk_bool_t use_srtp;
|
||||
|
|
|
@ -36,6 +36,8 @@
|
|||
# pragma comment(lib, "dxguid.lib")
|
||||
#endif
|
||||
|
||||
#define FIXME_SEND_SILENCE_ON_MUTE 0
|
||||
|
||||
#include "tsk_thread.h"
|
||||
#include "tsk_memory.h"
|
||||
#include "tsk_debug.h"
|
||||
|
@ -69,12 +71,17 @@ static void *_tdav_producer_dsound_record_thread(void *param)
|
|||
}
|
||||
|
||||
if(TMEDIA_PRODUCER(dsound)->enc_cb.callback){
|
||||
if(lpvAudio2){
|
||||
TMEDIA_PRODUCER(dsound)->enc_cb.callback(TMEDIA_PRODUCER(dsound)->enc_cb.callback_data, lpvAudio1, dwBytesAudio1);
|
||||
TMEDIA_PRODUCER(dsound)->enc_cb.callback(TMEDIA_PRODUCER(dsound)->enc_cb.callback_data, lpvAudio2, dwBytesAudio2);
|
||||
#if FIXME_SEND_SILENCE_ON_MUTE
|
||||
if(dsound->mute){
|
||||
memset(lpvAudio1, 0, dwBytesAudio1);
|
||||
if(lpvAudio2){
|
||||
memset(lpvAudio2, 0, dwBytesAudio2);
|
||||
}
|
||||
}
|
||||
else{
|
||||
TMEDIA_PRODUCER(dsound)->enc_cb.callback(TMEDIA_PRODUCER(dsound)->enc_cb.callback_data, lpvAudio1, dwBytesAudio1);
|
||||
#endif
|
||||
TMEDIA_PRODUCER(dsound)->enc_cb.callback(TMEDIA_PRODUCER(dsound)->enc_cb.callback_data, lpvAudio1, dwBytesAudio1);
|
||||
if(lpvAudio2){
|
||||
TMEDIA_PRODUCER(dsound)->enc_cb.callback(TMEDIA_PRODUCER(dsound)->enc_cb.callback_data, lpvAudio2, dwBytesAudio2);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -124,6 +131,7 @@ static int tdav_producer_dsound_set(tmedia_producer_t* self, const tmedia_param_
|
|||
if(param->value_type == tmedia_pvt_int32){
|
||||
if(tsk_striequals(param->key, "mute")){
|
||||
dsound->mute = (TSK_TO_INT32((uint8_t*)param->value) != 0);
|
||||
#if !FIXME_SEND_SILENCE_ON_MUTE
|
||||
if(dsound->started){
|
||||
if(dsound->mute){
|
||||
IDirectSoundCaptureBuffer_Stop(dsound->captureBuffer);
|
||||
|
@ -132,6 +140,7 @@ static int tdav_producer_dsound_set(tmedia_producer_t* self, const tmedia_param_
|
|||
IDirectSoundCaptureBuffer_Start(dsound->captureBuffer, DSBPLAY_LOOPING);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -270,6 +279,13 @@ static int tdav_producer_dsound_stop(tmedia_producer_t* self)
|
|||
// should be done here
|
||||
dsound->started = tsk_false;
|
||||
|
||||
#if !FIXME_SEND_SILENCE_ON_MUTE
|
||||
if(dsound->mute && dsound->notifEvents[0]){
|
||||
// thread is paused -> raise event now that "started" is equal to false
|
||||
SetEvent(dsound->notifEvents[0]);
|
||||
}
|
||||
#endif
|
||||
|
||||
// stop thread
|
||||
if(dsound->tid[0]){
|
||||
tsk_thread_join(&(dsound->tid[0]));
|
||||
|
|
|
@ -57,8 +57,8 @@ int tdav_session_av_init(tdav_session_av_t* self, tsk_bool_t is_audio)
|
|||
/* base::init(): called by tmedia_session_create() */
|
||||
|
||||
self->media_type = is_audio ? tmedia_audio : tmedia_video;
|
||||
self->use_rtcp = tsk_true; // FIXME: for now RTCP is always on, use "session_set('use-rtcp');"
|
||||
self->use_rtcp_mux = tsk_true;
|
||||
self->use_rtcp = tmedia_defaults_get_rtcp_enabled();
|
||||
self->use_rtcpmux = tmedia_defaults_get_rtcpmux_enabled();
|
||||
self->use_avpf = (profile == tmedia_profile_rtcweb); // negotiate if not RTCWeb profile
|
||||
|
||||
tsk_safeobj_init(self);
|
||||
|
@ -127,6 +127,10 @@ tsk_bool_t tdav_session_av_set(tdav_session_av_t* self, const tmedia_param_t* pa
|
|||
self->use_rtcp = (TSK_TO_INT32((uint8_t*)param->value) != 0);
|
||||
return tsk_true;
|
||||
}
|
||||
else if(tsk_striequals(param->key, "rtcpmux-enabled")){
|
||||
self->use_rtcpmux = (TSK_TO_INT32((uint8_t*)param->value) != 0);
|
||||
return tsk_true;
|
||||
}
|
||||
else if(tsk_striequals(param->key, "avpf-enabled")){
|
||||
self->use_avpf = (TSK_TO_INT32((uint8_t*)param->value) != 0);
|
||||
return tsk_true;
|
||||
|
@ -231,7 +235,7 @@ int tdav_session_av_start(tdav_session_av_t* self, const tmedia_codec_t* best_co
|
|||
// these information will be updated when the RTP manager starts if ICE is enabled
|
||||
ret = trtp_manager_set_rtp_remote(self->rtp_manager, self->remote_ip, self->remote_port);
|
||||
ret = trtp_manager_set_payload_type(self->rtp_manager, best_codec->neg_format ? atoi(best_codec->neg_format) : atoi(best_codec->format));
|
||||
self->rtp_manager->use_rtcp_mux = self->use_rtcp_mux; //FIXME: use "set_rtcp_mux()"
|
||||
self->rtp_manager->use_rtcpmux = self->use_rtcpmux;
|
||||
ret = trtp_manager_start(self->rtp_manager);
|
||||
|
||||
// because of AudioUnit under iOS => prepare both consumer and producer then start() at the same time
|
||||
|
@ -505,7 +509,7 @@ const tsdp_header_M_t* tdav_session_av_get_lo(tdav_session_av_t* self, tsk_bool_
|
|||
);
|
||||
|
||||
// RFC 5761: RTCP/RTP muxing
|
||||
if(self->use_rtcp_mux){
|
||||
if(self->use_rtcpmux){
|
||||
tsdp_header_M_add_headers(base->M.lo, TSDP_HEADER_A_VA_ARGS("rtcp-mux", tsk_null), tsk_null);
|
||||
}
|
||||
|
||||
|
@ -525,6 +529,7 @@ const tsdp_header_M_t* tdav_session_av_get_lo(tdav_session_av_t* self, tsk_bool_
|
|||
if(self->ice_ctx){
|
||||
tsk_size_t index = 0;
|
||||
const tnet_ice_candidate_t* candidate;
|
||||
tsk_bool_t remote_use_rtcpmux = (base->M.ro && (tsdp_header_M_findA(base->M.ro, "rtcp-mux") != tsk_null));
|
||||
|
||||
// FIXME: for RTCP, use "RFC 3605"in addition to "rtcp-mux"
|
||||
|
||||
|
@ -543,10 +548,12 @@ const tsdp_header_M_t* tdav_session_av_get_lo(tdav_session_av_t* self, tsk_bool_
|
|||
// RTCWeb
|
||||
tsdp_header_M_add_headers(base->M.lo,
|
||||
TSDP_HEADER_A_VA_ARGS("mid", self->media_type == tmedia_audio ? "audio" : "video"),
|
||||
TSDP_HEADER_A_VA_ARGS("rtcp-mux", tsk_null),
|
||||
tsk_null);
|
||||
|
||||
while((candidate = tnet_ice_ctx_get_local_candidate_at(self->ice_ctx, index++))){
|
||||
if(self->use_rtcpmux && remote_use_rtcpmux && candidate->comp_id == TNET_ICE_CANDIDATE_COMPID_RTCP){
|
||||
continue; // do not add RTCP candidates if RTCP-MUX is activated (local + remote)
|
||||
}
|
||||
tsdp_header_M_add_headers(base->M.lo,
|
||||
TSDP_HEADER_A_VA_ARGS("candidate", tnet_ice_candidate_tostring((tnet_ice_candidate_t*)candidate)),
|
||||
tsk_null);
|
||||
|
@ -644,7 +651,7 @@ int tdav_session_av_set_ro(tdav_session_av_t* self, const struct tsdp_header_M_s
|
|||
self->remote_port = m->port;
|
||||
|
||||
/* RTCP-MUX */
|
||||
self->use_rtcp_mux = (tsdp_header_M_findA(m, "rtcp-mux") != tsk_null);
|
||||
self->use_rtcpmux = (tsdp_header_M_findA(m, "rtcp-mux") != tsk_null);
|
||||
|
||||
/* SDPCapNeg: RFC 5939 */
|
||||
{
|
||||
|
|
|
@ -76,6 +76,10 @@ TINYMEDIA_API const char* tmedia_defaults_get_inv_session_refresher();
|
|||
TINYMEDIA_API int tmedia_defaults_set_inv_session_refresher(const char* refresher);
|
||||
TINYMEDIA_API tmedia_srtp_mode_t tmedia_defaults_get_srtp_mode();
|
||||
TINYMEDIA_API int tmedia_defaults_set_srtp_mode(tmedia_srtp_mode_t mode);
|
||||
TINYMEDIA_API tsk_bool_t tmedia_defaults_get_rtcp_enabled();
|
||||
TINYMEDIA_API int tmedia_defaults_set_rtcp_enabled(tsk_bool_t rtcp_enabled);
|
||||
TINYMEDIA_API tsk_bool_t tmedia_defaults_get_rtcpmux_enabled();
|
||||
TINYMEDIA_API int tmedia_defaults_set_rtcpmux_enabled(tsk_bool_t rtcpmux_enabled);
|
||||
TINYMEDIA_API int tmedia_defaults_set_ice_enabled(tsk_bool_t ice_enabled);
|
||||
TINYMEDIA_API tsk_bool_t tmedia_defaults_get_ice_enabled();
|
||||
|
||||
|
|
|
@ -50,6 +50,8 @@ static int32_t __volume = 100;
|
|||
static int32_t __inv_session_expires = 0; // Session Timers: 0: disabled
|
||||
static char* __inv_session_refresher = tsk_null;
|
||||
static tmedia_srtp_mode_t __srtp_mode = tmedia_srtp_mode_none;
|
||||
static tsk_bool_t __rtcp_enabled = tsk_true;
|
||||
static tsk_bool_t __rtcpmux_enabled = tsk_true;
|
||||
static tsk_bool_t __ice_enabled = tsk_false;
|
||||
|
||||
int tmedia_defaults_set_profile(tmedia_profile_t profile){
|
||||
|
@ -273,6 +275,22 @@ int tmedia_defaults_set_srtp_mode(tmedia_srtp_mode_t mode){
|
|||
return 0;
|
||||
}
|
||||
|
||||
tsk_bool_t tmedia_defaults_get_rtcp_enabled(){
|
||||
return __rtcp_enabled;
|
||||
}
|
||||
int tmedia_defaults_set_rtcp_enabled(tsk_bool_t rtcp_enabled){
|
||||
__rtcp_enabled = rtcp_enabled;
|
||||
return 0;
|
||||
}
|
||||
|
||||
tsk_bool_t tmedia_defaults_get_rtcpmux_enabled(){
|
||||
return __rtcpmux_enabled;
|
||||
}
|
||||
int tmedia_defaults_set_rtcpmux_enabled(tsk_bool_t rtcpmux_enabled){
|
||||
__rtcpmux_enabled = rtcpmux_enabled;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int tmedia_defaults_set_ice_enabled(tsk_bool_t ice_enabled){
|
||||
__ice_enabled = ice_enabled;
|
||||
return 0;
|
||||
|
|
|
@ -102,17 +102,14 @@ static const tsk_object_def_t tnet_ice_candidate_def_s =
|
|||
tnet_ice_candidate_cmp,
|
||||
};
|
||||
|
||||
tnet_ice_candidate_t* tnet_ice_candidate_create(tnet_ice_cand_type_t type_e, tnet_socket_t* socket, tsk_bool_t is_ice_jingle, tsk_bool_t is_rtp, tsk_bool_t is_video, const char* ufrag, const char* pwd)
|
||||
tnet_ice_candidate_t* tnet_ice_candidate_create(tnet_ice_cand_type_t type_e, tnet_socket_t* socket, tsk_bool_t is_ice_jingle, tsk_bool_t is_rtp, tsk_bool_t is_video, const char* ufrag, const char* pwd, const char *foundation)
|
||||
{
|
||||
tnet_ice_candidate_t* candidate;
|
||||
const char *foundation;
|
||||
|
||||
if(!(candidate = tsk_object_new(&tnet_ice_candidate_def_s))){
|
||||
TSK_DEBUG_ERROR("Failed to create candidate");
|
||||
return tsk_null;
|
||||
}
|
||||
|
||||
foundation = _tnet_ice_candidate_get_foundation(type_e);
|
||||
|
||||
candidate->transport_e = socket->type;
|
||||
candidate->type_e = type_e;
|
||||
|
@ -122,7 +119,12 @@ tnet_ice_candidate_t* tnet_ice_candidate_create(tnet_ice_cand_type_t type_e, tne
|
|||
candidate->is_rtp = is_rtp;
|
||||
candidate->is_video = is_video;
|
||||
candidate->comp_id = is_rtp ? TNET_ICE_CANDIDATE_COMPID_RTP : TNET_ICE_CANDIDATE_COMPID_RTCP;
|
||||
memcpy(candidate->foundation, foundation, TSK_MIN(sizeof(candidate->foundation), tsk_strlen(foundation)));
|
||||
if(foundation){
|
||||
memcpy(candidate->foundation, foundation, TSK_MIN(tsk_strlen(foundation), TNET_ICE_CANDIDATE_FOUND_SIZE_PREF));
|
||||
}
|
||||
else{
|
||||
tnet_ice_utils_compute_foundation((char*)candidate->foundation, TSK_MIN(sizeof(candidate->foundation), TNET_ICE_CANDIDATE_FOUND_SIZE_PREF));
|
||||
}
|
||||
candidate->priority = tnet_ice_utils_get_priority(candidate->type_e, candidate->local_pref, candidate->is_rtp);
|
||||
if(candidate->socket){
|
||||
memcpy(candidate->connection_addr, candidate->socket->ip, sizeof(candidate->socket->ip));
|
||||
|
|
|
@ -48,14 +48,16 @@ TNET_BEGIN_DECLS
|
|||
#define TNET_ICE_CANDIDATE_PREF_PRFLX 110
|
||||
#define TNET_ICE_CANDIDATE_PREF_RELAY 0
|
||||
|
||||
#define TNET_ICE_CANDIDATE_FOUNDATION_HOST "00host00"
|
||||
#define TNET_ICE_CANDIDATE_FOUNDATION_SRFLX "00srflx00"
|
||||
#define TNET_ICE_CANDIDATE_FOUNDATION_PRFLX "00prflx00"
|
||||
#define TNET_ICE_CANDIDATE_FOUNDATION_RELAY "00relay00"
|
||||
#define TNET_ICE_CANDIDATE_FOUNDATION_HOST "fhost"
|
||||
#define TNET_ICE_CANDIDATE_FOUNDATION_SRFLX "fsrflx"
|
||||
#define TNET_ICE_CANDIDATE_FOUNDATION_PRFLX "fprflx"
|
||||
#define TNET_ICE_CANDIDATE_FOUNDATION_RELAY "frelay"
|
||||
|
||||
#define TNET_ICE_CANDIDATE_COMPID_RTP 1
|
||||
#define TNET_ICE_CANDIDATE_COMPID_RTCP 2
|
||||
|
||||
#define TNET_ICE_CANDIDATE_FOUND_SIZE_PREF 8
|
||||
|
||||
typedef enum tnet_ice_cand_type_e
|
||||
{
|
||||
tnet_ice_cand_type_unknown,
|
||||
|
@ -104,7 +106,7 @@ tnet_ice_candidate_t;
|
|||
|
||||
typedef tsk_list_t tnet_ice_candidates_L_t;
|
||||
|
||||
tnet_ice_candidate_t* tnet_ice_candidate_create(tnet_ice_cand_type_t type_e, struct tnet_socket_s* socket, tsk_bool_t is_ice_jingle, tsk_bool_t is_rtp, tsk_bool_t is_video, const char* ufrag, const char* pwd);
|
||||
tnet_ice_candidate_t* tnet_ice_candidate_create(tnet_ice_cand_type_t type_e, struct tnet_socket_s* socket, tsk_bool_t is_ice_jingle, tsk_bool_t is_rtp, tsk_bool_t is_video, const char* ufrag, const char* pwd, const char *foundation);
|
||||
TINYNET_API tnet_ice_candidate_t* tnet_ice_candidate_parse(const char* str);
|
||||
int tnet_ice_candidate_set_credential(tnet_ice_candidate_t* self, const char* ufrag, const char* pwd);
|
||||
int tnet_ice_candidate_set_rflx_addr(tnet_ice_candidate_t* self, const char* addr, tnet_port_t port);
|
||||
|
|
|
@ -64,6 +64,8 @@
|
|||
|
||||
#define TNET_ICE_CONFLICT_ERROR_CODE 487
|
||||
|
||||
static const char* foundation_default = tsk_null;
|
||||
|
||||
static int _tnet_ice_ctx_fsm_act_async(struct tnet_ice_ctx_s* self, tsk_fsm_action_id action_id);
|
||||
static int _tnet_ice_ctx_signal_async(struct tnet_ice_ctx_s* self, tnet_ice_event_type_t type, const char* phrase);
|
||||
static int _tnet_ice_ctx_restart(struct tnet_ice_ctx_s* self);
|
||||
|
@ -96,6 +98,7 @@ typedef struct tnet_ice_ctx_s
|
|||
const void* userdata;
|
||||
tsk_bool_t use_ipv6;
|
||||
tsk_bool_t use_rtcp;
|
||||
tsk_bool_t use_rtcpmux;
|
||||
tsk_bool_t is_video;
|
||||
tsk_bool_t unicast;
|
||||
tsk_bool_t anycast;
|
||||
|
@ -119,9 +122,9 @@ typedef struct tnet_ice_ctx_s
|
|||
tnet_ice_candidates_L_t* candidates_local;
|
||||
tnet_ice_candidates_L_t* candidates_remote;
|
||||
tnet_ice_pairs_L_t* candidates_pairs;
|
||||
tsk_bool_t has_nominated_offer;
|
||||
tsk_bool_t has_nominated_answer;
|
||||
tsk_bool_t has_nominated_symetric; /**< Whether symetic RTP has been negotiated */
|
||||
tsk_bool_t have_nominated_offer;
|
||||
tsk_bool_t have_nominated_answer;
|
||||
tsk_bool_t have_nominated_symetric; /**< Whether symetic RTP has been negotiated */
|
||||
|
||||
uint16_t RTO; /**< Estimate of the round-trip time (RTT) in millisecond */
|
||||
uint16_t Rc; /**< Number of retransmissions for UDP in millisecond */
|
||||
|
@ -504,6 +507,16 @@ int tnet_ice_ctx_set_remote_candidates(tnet_ice_ctx_t* self, const char* candida
|
|||
return ret;
|
||||
}
|
||||
|
||||
int tnet_ice_ctx_set_rtcpmux(tnet_ice_ctx_t* self, tsk_bool_t use_rtcpmux)
|
||||
{
|
||||
if(!self){
|
||||
TSK_DEBUG_ERROR("Invalid parameter");
|
||||
return -1;
|
||||
}
|
||||
self->use_rtcpmux = use_rtcpmux;
|
||||
return 0;
|
||||
}
|
||||
|
||||
tsk_size_t tnet_ice_ctx_count_local_candidates(const tnet_ice_ctx_t* self)
|
||||
{
|
||||
if(!self){
|
||||
|
@ -561,17 +574,17 @@ tsk_bool_t tnet_ice_ctx_is_active(const tnet_ice_ctx_t* self)
|
|||
// says if media can start in both direction
|
||||
tsk_bool_t tnet_ice_ctx_is_connected(const tnet_ice_ctx_t* self)
|
||||
{
|
||||
return (self && self->has_nominated_symetric);
|
||||
return (self && self->have_nominated_symetric);
|
||||
}
|
||||
|
||||
tsk_bool_t tnet_ice_ctx_is_can_send(const tnet_ice_ctx_t* self)
|
||||
{
|
||||
return (self && self->has_nominated_offer);
|
||||
return (self && self->have_nominated_offer);
|
||||
}
|
||||
|
||||
tsk_bool_t tnet_ice_ctx_is_can_recv(const tnet_ice_ctx_t* self)
|
||||
{
|
||||
return (self && self->has_nominated_answer);
|
||||
return (self && self->have_nominated_answer);
|
||||
}
|
||||
|
||||
tsk_bool_t tnet_ice_ctx_use_ipv6(const tnet_ice_ctx_t* self)
|
||||
|
@ -612,7 +625,7 @@ int tnet_ice_ctx_recv_stun_message(tnet_ice_ctx_t* self, const void* data, tsk_s
|
|||
if(self->rtp_callback){
|
||||
return self->rtp_callback(self->rtp_callback_data, data, size, local_fd, remote_addr);
|
||||
}
|
||||
TSK_DEBUG_WARN("Not STUN message");
|
||||
TSK_DEBUG_INFO("Not STUN message");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -659,7 +672,7 @@ int tnet_ice_ctx_recv_stun_message(tnet_ice_ctx_t* self, const void* data, tsk_s
|
|||
}
|
||||
}
|
||||
ret = tnet_ice_pair_send_response((tnet_ice_pair_t *)pair, message, resp_code, resp_phrase, remote_addr);
|
||||
if(self->is_ice_jingle && self->has_nominated_symetric){
|
||||
if(self->is_ice_jingle && self->have_nominated_symetric){
|
||||
ret = tnet_ice_pair_send_conncheck((tnet_ice_pair_t *)pair); // "keepalive"
|
||||
}
|
||||
}
|
||||
|
@ -709,9 +722,9 @@ int tnet_ice_ctx_cancel(tnet_ice_ctx_t* self)
|
|||
}
|
||||
|
||||
self->is_active = tsk_false;
|
||||
self->has_nominated_symetric = tsk_false;
|
||||
self->has_nominated_answer = tsk_false;
|
||||
self->has_nominated_offer = tsk_false;
|
||||
self->have_nominated_symetric = tsk_false;
|
||||
self->have_nominated_answer = tsk_false;
|
||||
self->have_nominated_offer = tsk_false;
|
||||
return _tnet_ice_ctx_fsm_act_async(self, _fsm_action_Cancel);
|
||||
}
|
||||
|
||||
|
@ -793,9 +806,11 @@ static int _tnet_ice_ctx_fsm_Started_2_GatheringHostCandidates_X_GatherHostCandi
|
|||
address->ip, &socket_rtp,
|
||||
self->use_rtcp ? &socket_rtcp : tsk_null);
|
||||
if(ret == 0){
|
||||
const char* foundation_rtp = foundation_default;
|
||||
tsk_list_lock(self->candidates_local);
|
||||
if(socket_rtp){
|
||||
if((candidate = tnet_ice_candidate_create(tnet_ice_cand_type_host, socket_rtp, self->is_ice_jingle, tsk_true, self->is_video, self->ufrag, self->pwd))){
|
||||
if((candidate = tnet_ice_candidate_create(tnet_ice_cand_type_host, socket_rtp, self->is_ice_jingle, tsk_true, self->is_video, self->ufrag, self->pwd, foundation_default))){
|
||||
foundation_rtp = (const char*)candidate->foundation;
|
||||
if(check_best_local_ip && (candidate->socket && (tsk_striequals(candidate->socket->ip, best_local_ip)))){
|
||||
curr_local_pref = 0xFFFF;
|
||||
check_best_local_ip = tsk_false;
|
||||
|
@ -810,7 +825,7 @@ static int _tnet_ice_ctx_fsm_Started_2_GatheringHostCandidates_X_GatherHostCandi
|
|||
}
|
||||
}
|
||||
if(socket_rtcp){
|
||||
if((candidate = tnet_ice_candidate_create(tnet_ice_cand_type_host, socket_rtcp, self->is_ice_jingle, tsk_false, self->is_video, self->ufrag, self->pwd))){
|
||||
if((candidate = tnet_ice_candidate_create(tnet_ice_cand_type_host, socket_rtcp, self->is_ice_jingle, tsk_false, self->is_video, self->ufrag, self->pwd, foundation_rtp))){
|
||||
tnet_ice_candidate_set_local_pref(candidate, curr_local_pref);
|
||||
tsk_list_push_back_data(self->candidates_local, (void**)&candidate);
|
||||
}
|
||||
|
@ -1001,7 +1016,11 @@ static int _tnet_ice_ctx_fsm_GatheringHostCandidatesDone_2_GatheringReflexiveCan
|
|||
if(tsk_strnullORempty(candidate_curr->stun.srflx_addr)){
|
||||
ret = tnet_ice_candidate_process_stun_response((tnet_ice_candidate_t*)candidate_curr, response, fd);
|
||||
if(!tsk_strnullORempty(candidate_curr->stun.srflx_addr)){
|
||||
tnet_ice_candidate_t* new_cand = tnet_ice_candidate_create(tnet_ice_cand_type_srflx, candidate_curr->socket, candidate_curr->is_ice_jingle, candidate_curr->is_rtp, self->is_video, self->ufrag, self->pwd);
|
||||
char* foundation = tsk_strdup("srflx");
|
||||
tnet_ice_candidate_t* new_cand;
|
||||
tsk_strcat(&foundation, candidate_curr->foundation);
|
||||
new_cand = tnet_ice_candidate_create(tnet_ice_cand_type_srflx, candidate_curr->socket, candidate_curr->is_ice_jingle, candidate_curr->is_rtp, self->is_video, self->ufrag, self->pwd, foundation);
|
||||
TSK_FREE(foundation);
|
||||
if(new_cand){
|
||||
++srflx_addr_count;
|
||||
tsk_list_lock(self->candidates_local);
|
||||
|
@ -1149,7 +1168,7 @@ static int _tnet_ice_ctx_fsm_GatheringComplet_2_ConnChecking_X_ConnCheck(va_list
|
|||
static const long rto = 160; // milliseconds
|
||||
struct sockaddr_storage remote_addr;
|
||||
uint64_t time_start, time_curr, time_end, concheck_timeout;
|
||||
tsk_bool_t role_conflict;
|
||||
tsk_bool_t role_conflict, check_rtcp;
|
||||
|
||||
self = va_arg(*app, tnet_ice_ctx_t *);
|
||||
|
||||
|
@ -1183,7 +1202,7 @@ start_conneck:
|
|||
time_start = time_curr = tsk_time_now();
|
||||
time_end = (time_start + concheck_timeout);
|
||||
|
||||
while(self->is_started && self->is_active && (time_curr < time_end) && !self->has_nominated_symetric){
|
||||
while(self->is_started && self->is_active && (time_curr < time_end) && !self->have_nominated_symetric){
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = (rto * 1000);
|
||||
|
||||
|
@ -1203,7 +1222,7 @@ start_conneck:
|
|||
|
||||
// Send ConnCheck requests
|
||||
// the pairs are already order by priority (from high to low)
|
||||
if(!self->has_nominated_symetric){
|
||||
if(!self->have_nominated_symetric){
|
||||
tsk_list_foreach(item, self->candidates_pairs){
|
||||
if(!(pair = item->data) || !pair->candidate_offer || !pair->candidate_offer->socket){
|
||||
continue;
|
||||
|
@ -1267,21 +1286,22 @@ start_conneck:
|
|||
TSK_FREE(data);
|
||||
}
|
||||
|
||||
if(!self->has_nominated_offer){
|
||||
self->has_nominated_offer = tnet_ice_pairs_has_nominated_offer(self->candidates_pairs);
|
||||
check_rtcp = (self->use_rtcp && !self->use_rtcpmux);
|
||||
if(!self->have_nominated_offer){
|
||||
self->have_nominated_offer = tnet_ice_pairs_have_nominated_offer(self->candidates_pairs, check_rtcp);
|
||||
}
|
||||
if(!self->has_nominated_answer){
|
||||
self->has_nominated_answer = tnet_ice_pairs_has_nominated_answer(self->candidates_pairs);
|
||||
if(!self->have_nominated_answer){
|
||||
self->have_nominated_answer = tnet_ice_pairs_have_nominated_answer(self->candidates_pairs, check_rtcp);
|
||||
}
|
||||
if(self->has_nominated_offer && self->has_nominated_answer){
|
||||
self->has_nominated_symetric = tnet_ice_pairs_has_nominated_symetric(self->candidates_pairs, self->use_rtcp);
|
||||
if(self->have_nominated_offer && self->have_nominated_answer){
|
||||
self->have_nominated_symetric = tnet_ice_pairs_have_nominated_symetric(self->candidates_pairs, check_rtcp);
|
||||
}
|
||||
}
|
||||
|
||||
bail:
|
||||
// move to the next state depending on the conncheck result
|
||||
if(self->is_started){
|
||||
if(ret == 0 && self->has_nominated_symetric){
|
||||
if(ret == 0 && self->have_nominated_symetric){
|
||||
_tnet_ice_ctx_fsm_act_async(self, _fsm_action_Success);
|
||||
}
|
||||
else{
|
||||
|
|
|
@ -54,6 +54,7 @@ TINYNET_API int tnet_ice_ctx_start(struct tnet_ice_ctx_s* self);
|
|||
TINYNET_API int tnet_ice_ctx_rtp_callback(struct tnet_ice_ctx_s* self, tnet_ice_rtp_callback_f rtp_callback, const void* rtp_callback_data);
|
||||
TINYNET_API int tnet_ice_ctx_set_concheck_timeout(struct tnet_ice_ctx_s* self, int64_t timeout);
|
||||
TINYNET_API int tnet_ice_ctx_set_remote_candidates(struct tnet_ice_ctx_s* self, const char* candidates, const char* ufrag, const char* pwd, tsk_bool_t is_controlling, tsk_bool_t is_ice_jingle);
|
||||
TINYNET_API int tnet_ice_ctx_set_rtcpmux(struct tnet_ice_ctx_s* self, tsk_bool_t use_rtcpmux);
|
||||
TINYNET_API tsk_size_t tnet_ice_ctx_count_local_candidates(const struct tnet_ice_ctx_s* self);
|
||||
TINYNET_API tsk_bool_t tnet_ice_ctx_got_local_candidates(const struct tnet_ice_ctx_s* self);
|
||||
TINYNET_API const struct tnet_ice_candidate_s* tnet_ice_ctx_get_local_candidate_at(const struct tnet_ice_ctx_s* self, tsk_size_t index);
|
||||
|
|
|
@ -518,7 +518,9 @@ const tnet_ice_pair_t* tnet_ice_pairs_find_by_fd_and_addr(tnet_ice_pairs_L_t* pa
|
|||
}
|
||||
|
||||
// both RTP and RTCP have succeeded
|
||||
#define _tnet_ice_pairs_get_nominated_at(pairs, dir, index, ret) \
|
||||
#define _tnet_ice_pairs_get_nominated_offer_at(pairs, index, comp_id, check_fullness, ret) _tnet_ice_pairs_get_nominated_at((pairs), offer, answer, (index), (comp_id), (check_fullness), (ret))
|
||||
#define _tnet_ice_pairs_get_nominated_answer_at(pairs, index, comp_id, check_fullness, ret) _tnet_ice_pairs_get_nominated_at((pairs), answer, offer, (index), (comp_id), (check_fullness), (ret))
|
||||
#define _tnet_ice_pairs_get_nominated_at(pairs, dir_1, dir_2, index, _comp_id, check_fullness, ret) \
|
||||
{ \
|
||||
ret = tsk_null; \
|
||||
if(pairs){ \
|
||||
|
@ -530,21 +532,22 @@ const tnet_ice_pair_t* tnet_ice_pairs_find_by_fd_and_addr(tnet_ice_pairs_L_t* pa
|
|||
if(!(pair = item->data)){ \
|
||||
continue; \
|
||||
} \
|
||||
if(pair->state_##dir == tnet_ice_pair_state_succeed){ \
|
||||
/* find another pair with same foundation (e.g. host) but different comp-id (e.g. RTCP) */ \
|
||||
const tsk_list_item_t *item2; \
|
||||
const tnet_ice_pair_t *pair2; \
|
||||
if(pair->state_##dir_1 == tnet_ice_pair_state_succeed && pair->candidate_##dir_1->comp_id == _comp_id){ \
|
||||
pos = 0; \
|
||||
nominated = tsk_true; \
|
||||
tsk_list_foreach(item2, pairs){ \
|
||||
if(!(pair2 = item2->data)){ \
|
||||
continue; \
|
||||
} \
|
||||
if((tsk_striequals(pair2->candidate_##dir->foundation, pair->candidate_##dir->foundation)) \
|
||||
&& (pair2->candidate_##dir->comp_id != pair2->candidate_##dir->comp_id) \
|
||||
&& (pair2->state_##dir != tnet_ice_pair_state_succeed)){ \
|
||||
nominated = tsk_false; \
|
||||
break; \
|
||||
if(check_fullness){ \
|
||||
/* find another pair with same foundation (e.g. 'host') but different comp-id (e.g. RTCP) */ \
|
||||
const tsk_list_item_t *item2; \
|
||||
const tnet_ice_pair_t *pair2; \
|
||||
tsk_list_foreach(item2, pairs){ \
|
||||
if(!(pair2 = item2->data)){ \
|
||||
continue; \
|
||||
} \
|
||||
if((tsk_striequals(pair2->candidate_##dir_2->foundation, pair->candidate_##dir_2->foundation)) \
|
||||
&& (pair2->candidate_##dir_2->comp_id != pair->candidate_##dir_2->comp_id)){ \
|
||||
nominated = (pair2->state_##dir_2 == tnet_ice_pair_state_succeed); \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
|
@ -558,23 +561,33 @@ const tnet_ice_pair_t* tnet_ice_pairs_find_by_fd_and_addr(tnet_ice_pairs_L_t* pa
|
|||
} \
|
||||
|
||||
// true only if both RTP and RTCP are nominated
|
||||
tsk_bool_t tnet_ice_pairs_has_nominated_offer(const tnet_ice_pairs_L_t* pairs)
|
||||
tsk_bool_t tnet_ice_pairs_have_nominated_offer(const tnet_ice_pairs_L_t* pairs, tsk_bool_t check_rtcp)
|
||||
{
|
||||
const tnet_ice_pair_t *pair_ = tsk_null;
|
||||
_tnet_ice_pairs_get_nominated_at((pairs), offer, 0, (pair_));
|
||||
return (pair_ != tsk_null);
|
||||
tsk_bool_t is_nominated_rtp, is_nominated_rtcp = tsk_true;
|
||||
_tnet_ice_pairs_get_nominated_offer_at((pairs), 0, TNET_ICE_CANDIDATE_COMPID_RTP, check_rtcp, (pair_));
|
||||
if((is_nominated_rtp = (pair_ != tsk_null)) && check_rtcp){
|
||||
_tnet_ice_pairs_get_nominated_offer_at((pairs), 0, TNET_ICE_CANDIDATE_COMPID_RTCP, check_rtcp, (pair_));
|
||||
is_nominated_rtcp =(pair_ != tsk_null);
|
||||
}
|
||||
return (is_nominated_rtp && is_nominated_rtcp);
|
||||
}
|
||||
|
||||
// true only if both RTP and RTCP are nominated
|
||||
tsk_bool_t tnet_ice_pairs_has_nominated_answer(const tnet_ice_pairs_L_t* pairs)
|
||||
tsk_bool_t tnet_ice_pairs_have_nominated_answer(const tnet_ice_pairs_L_t* pairs, tsk_bool_t check_rtcp)
|
||||
{
|
||||
const tnet_ice_pair_t *pair_ = tsk_null;
|
||||
_tnet_ice_pairs_get_nominated_at((pairs), answer, 0, (pair_));
|
||||
return (pair_ != tsk_null);
|
||||
tsk_bool_t is_nominated_rtp, is_nominated_rtcp = tsk_true;
|
||||
_tnet_ice_pairs_get_nominated_answer_at((pairs), 0, TNET_ICE_CANDIDATE_COMPID_RTP, check_rtcp, (pair_));
|
||||
if((is_nominated_rtp = (pair_ != tsk_null)) && check_rtcp){
|
||||
_tnet_ice_pairs_get_nominated_answer_at((pairs), 0, TNET_ICE_CANDIDATE_COMPID_RTCP, check_rtcp, (pair_));
|
||||
is_nominated_rtcp =(pair_ != tsk_null);
|
||||
}
|
||||
return (is_nominated_rtp && is_nominated_rtcp);
|
||||
}
|
||||
|
||||
// true only if both RTP and RTCP are nominated in symetric way
|
||||
tsk_bool_t tnet_ice_pairs_has_nominated_symetric(const tnet_ice_pairs_L_t* pairs, tsk_bool_t check_rtcp)
|
||||
tsk_bool_t tnet_ice_pairs_have_nominated_symetric(const tnet_ice_pairs_L_t* pairs, tsk_bool_t check_rtcp)
|
||||
{
|
||||
const tnet_ice_candidate_t *candidate_offer, *candidate_answer_src, *candidate_answer_dest;
|
||||
tsk_bool_t is_nominated_rtp, is_nominated_rtcp = tsk_true;
|
||||
|
@ -598,6 +611,7 @@ int tnet_ice_pairs_get_nominated_symetric(const tnet_ice_pairs_L_t* pairs, uint3
|
|||
const tnet_ice_pair_t *pair_offer = tsk_null;
|
||||
const tnet_ice_pair_t *pair_answer = tsk_null;
|
||||
tsk_size_t i_offer, i_answer;
|
||||
static const tsk_bool_t __check_fullness = tsk_false; // pairs will be checked seperatly
|
||||
|
||||
if(!pairs || !candidate_offer || !candidate_answer_src || !candidate_answer_dest){
|
||||
TSK_DEBUG_ERROR("Invalid parameter");
|
||||
|
@ -610,7 +624,7 @@ int tnet_ice_pairs_get_nominated_symetric(const tnet_ice_pairs_L_t* pairs, uint3
|
|||
|
||||
i_offer = 0;
|
||||
while(1){
|
||||
_tnet_ice_pairs_get_nominated_at((pairs), offer, i_offer, (pair_offer)); // pair with socket SO as sender
|
||||
_tnet_ice_pairs_get_nominated_offer_at((pairs), i_offer, comp_id, __check_fullness, (pair_offer)); // pair with socket SO as sender
|
||||
if(!pair_offer) return 0;
|
||||
++i_offer;
|
||||
if(pair_offer->candidate_offer->comp_id != comp_id) continue;
|
||||
|
@ -618,7 +632,7 @@ int tnet_ice_pairs_get_nominated_symetric(const tnet_ice_pairs_L_t* pairs, uint3
|
|||
|
||||
i_answer = 0;
|
||||
while(1){
|
||||
_tnet_ice_pairs_get_nominated_at((pairs), answer, i_answer, (pair_answer));
|
||||
_tnet_ice_pairs_get_nominated_answer_at((pairs), i_answer, comp_id, __check_fullness, (pair_answer));
|
||||
if(!pair_answer) break;
|
||||
++i_answer;
|
||||
if(pair_answer->candidate_offer->comp_id != comp_id) continue;
|
||||
|
|
|
@ -65,9 +65,9 @@ int tnet_ice_pair_auth_conncheck(const tnet_ice_pair_t *self, const struct tnet_
|
|||
int tnet_ice_pair_recv_response(tnet_ice_pair_t *self, const struct tnet_stun_message_s* response);
|
||||
const tnet_ice_pair_t* tnet_ice_pairs_find_by_response(tnet_ice_pairs_L_t* pairs, const struct tnet_stun_message_s* response);
|
||||
const tnet_ice_pair_t* tnet_ice_pairs_find_by_fd_and_addr(tnet_ice_pairs_L_t* pairs, uint16_t local_fd, const struct sockaddr_storage *remote_addr);
|
||||
tsk_bool_t tnet_ice_pairs_has_nominated_offer(const tnet_ice_pairs_L_t* pairs);
|
||||
tsk_bool_t tnet_ice_pairs_has_nominated_answer(const tnet_ice_pairs_L_t* pairs);
|
||||
tsk_bool_t tnet_ice_pairs_has_nominated_symetric(const tnet_ice_pairs_L_t* pairs, tsk_bool_t check_rtcp);
|
||||
tsk_bool_t tnet_ice_pairs_have_nominated_offer(const tnet_ice_pairs_L_t* pairs, tsk_bool_t check_rtcp);
|
||||
tsk_bool_t tnet_ice_pairs_have_nominated_answer(const tnet_ice_pairs_L_t* pairs, tsk_bool_t check_rtcp);
|
||||
tsk_bool_t tnet_ice_pairs_have_nominated_symetric(const tnet_ice_pairs_L_t* pairs, tsk_bool_t check_rtcp);
|
||||
int tnet_ice_pairs_get_nominated_symetric(const tnet_ice_pairs_L_t* pairs, uint32_t comp_id,
|
||||
const struct tnet_ice_candidate_s** candidate_offer,
|
||||
const struct tnet_ice_candidate_s** candidate_answer_src,
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
static const char ice_chars[] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'k', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
|
||||
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'K', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
|
||||
'0','1', '2', '3', '4', '5', '6', '7', '8', '9'}; // /!\do not add '/' and '+' because WebRTC password
|
||||
'0','1', '2', '3', '4', '5', '6', '7', '8', '9'}; // /!\do not add '/' and '+' because of WebRTC password
|
||||
static const tsk_size_t ice_chars_count = sizeof(ice_chars);
|
||||
|
||||
uint32_t tnet_ice_utils_get_priority(tnet_ice_cand_type_t type, uint16_t local_pref, tsk_bool_t is_rtp)
|
||||
|
|
|
@ -89,7 +89,7 @@ typedef struct trtp_manager_s
|
|||
tsk_bool_t use_ipv6;
|
||||
tsk_bool_t is_started;
|
||||
tsk_bool_t use_rtcp;
|
||||
tsk_bool_t use_rtcp_mux;
|
||||
tsk_bool_t use_rtcpmux;
|
||||
tsk_bool_t socket_disabled;
|
||||
tnet_transport_t* transport;
|
||||
struct{
|
||||
|
|
|
@ -598,7 +598,7 @@ int trtp_manager_start(trtp_manager_t* self)
|
|||
/* RTCP */
|
||||
if(self->use_rtcp){
|
||||
tnet_fd_t local_rtcp_fd = self->rtcp.local_socket ? self->rtcp.local_socket->fd : -1;
|
||||
if(local_rtcp_fd < 0 || self->use_rtcp_mux){ // use RTP local port to send RTCP packets
|
||||
if(local_rtcp_fd < 0 || self->use_rtcpmux){ // use RTP local port to send RTCP packets
|
||||
local_rtcp_fd = self->transport->master->fd;
|
||||
}
|
||||
|
||||
|
@ -606,7 +606,7 @@ int trtp_manager_start(trtp_manager_t* self)
|
|||
self->rtcp.remote_ip = tsk_strdup(self->rtcp.remote_ip ? self->rtcp.remote_ip : self->rtp.remote_ip);
|
||||
}
|
||||
if(!self->rtcp.remote_port){
|
||||
self->rtcp.remote_port = self->rtcp.remote_port ? self->rtcp.remote_port : (self->use_rtcp_mux ? self->rtp.remote_port : (self->rtp.remote_port + 1));
|
||||
self->rtcp.remote_port = self->rtcp.remote_port ? self->rtcp.remote_port : (self->use_rtcpmux ? self->rtp.remote_port : (self->rtp.remote_port + 1));
|
||||
}
|
||||
|
||||
if((ret = tnet_sockaddr_init(self->rtcp.remote_ip, self->rtcp.remote_port, self->transport->master->type, &self->rtcp.remote_addr))){
|
||||
|
|
|
@ -49,6 +49,7 @@ typedef struct tsip_dialog_invite
|
|||
tsk_bool_t is_transf;
|
||||
tsk_bool_t refersub;
|
||||
tsk_bool_t use_rtcp;
|
||||
tsk_bool_t use_rtcpmux;
|
||||
uint32_t rseq;
|
||||
|
||||
tsip_timer_t timershutdown;
|
||||
|
@ -107,7 +108,7 @@ typedef struct tsip_dialog_invite
|
|||
unsigned timer:1;
|
||||
unsigned norefersub;
|
||||
unsigned ice:1;
|
||||
} require;
|
||||
} required;
|
||||
}
|
||||
tsip_dialog_invite_t;
|
||||
|
||||
|
|
|
@ -107,10 +107,9 @@ typedef enum tsip_msession_param_type_e
|
|||
mstype_set_srtp_mode,
|
||||
|
||||
mstype_set_100rel,
|
||||
mstype_unset_100rel,
|
||||
|
||||
mstype_set_rtcp,
|
||||
mstype_set_rtcpmux,
|
||||
mstype_set_ice,
|
||||
mstype_unset_ice,
|
||||
|
||||
mstype_set_qos,
|
||||
mstype_unset_qos,
|
||||
|
@ -124,10 +123,10 @@ tsip_msession_param_type_t;
|
|||
|
||||
#define TSIP_MSESSION_SET_SRTP_MODE(SRTP_MODE_ENUM) mstype_set_profile, (tmedia_srtp_mode_t)SRTP_MODE_ENUM
|
||||
#define TSIP_MSESSION_SET_PROFILE(PROFILE_ENUM) mstype_set_srtp_mode, (tmedia_profile_t)PROFILE_ENUM
|
||||
#define TSIP_MSESSION_SET_100rel() mstype_set_100rel
|
||||
#define TSIP_MSESSION_UNSET_100rel() mstype_unset_100rel
|
||||
#define TSIP_MSESSION_SET_ICE() mstype_set_ice
|
||||
#define TSIP_MSESSION_UNSET_ICE() mstype_unset_ice
|
||||
#define TSIP_MSESSION_SET_100rel(ENABLED_BOOL) mstype_set_100rel, (tsk_bool_t)ENABLED_BOOL
|
||||
#define TSIP_MSESSION_SET_RTCP(ENABLED_BOOL) mstype_set_rtcp, (tsk_bool_t)ENABLED_BOOL
|
||||
#define TSIP_MSESSION_SET_RTCPMUX(ENABLED_BOOL) mstype_set_rtcpmux, (tsk_bool_t)ENABLED_BOOL
|
||||
#define TSIP_MSESSION_SET_ICE(ENABLED_BOOL) mstype_set_ice, (tsk_bool_t)ENABLED_BOOL
|
||||
#define TSIP_MSESSION_SET_QOS(TYPE_ENUM, STRENGTH_ENUM) mstype_set_qos, (tmedia_qos_stype_t)TYPE_ENUM, (tmedia_qos_strength_t)STRENGTH_ENUM
|
||||
#define TSIP_MSESSION_UNSET_QOS() mstype_unset_qos
|
||||
#define TSIP_MSESSION_SET_TIMERS(TIMEOUT_UINT, REFRESHER_STR) mstype_set_timers, (unsigned)TIMEOUT_UINT, (const char*)REFRESHER_STR
|
||||
|
@ -186,6 +185,8 @@ typedef struct tsip_ssession_s
|
|||
/* Features */
|
||||
unsigned enable_100rel:1;
|
||||
unsigned enable_ice:1;
|
||||
unsigned enable_rtcp:1;
|
||||
unsigned enable_rtcpmux:1;
|
||||
} media;
|
||||
}
|
||||
tsip_ssession_t;
|
||||
|
|
|
@ -569,7 +569,7 @@ int x0000_Connected_2_Connected_X_iACK(va_list *app)
|
|||
|
||||
// starts ICE timers now that both parties receive the "candidates"
|
||||
if(tsip_dialog_invite_ice_is_enabled(self)){
|
||||
tsip_dialog_invite_ice_timers_set(self, TSIP_DIALOG_INVITE_ICE_CONNCHECK_TIMEOUT);
|
||||
tsip_dialog_invite_ice_timers_set(self, (self->required.ice ? -1 : TSIP_DIALOG_INVITE_ICE_CONNCHECK_TIMEOUT));
|
||||
}
|
||||
|
||||
/* alert the user */
|
||||
|
@ -772,7 +772,7 @@ int x0000_Any_2_Any_X_i2xxINVITEorUPDATE(va_list *app)
|
|||
|
||||
// starts ICE timers now that both parties received the "candidates"
|
||||
if(tsip_dialog_invite_ice_is_enabled(self)){
|
||||
tsip_dialog_invite_ice_timers_set(self, TSIP_DIALOG_INVITE_ICE_CONNCHECK_TIMEOUT);
|
||||
tsip_dialog_invite_ice_timers_set(self, (self->required.ice ? -1 : TSIP_DIALOG_INVITE_ICE_CONNCHECK_TIMEOUT));
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
@ -960,7 +960,6 @@ int tsip_dialog_invite_msession_configure(tsip_dialog_invite_t *self)
|
|||
{
|
||||
tmedia_srtp_mode_t srtp_mode;
|
||||
tsk_bool_t is_rtcweb_enabled;
|
||||
static const tsk_bool_t use_rtcp = tsk_true; // FIXME: For now we don't use 'dialog->use_rtcp' which is set to 'false' to disable RTCP in ICE and force using RTCP-MUX
|
||||
|
||||
if(!self || !self->msession_mgr){
|
||||
TSK_DEBUG_ERROR("Invalid parameter");
|
||||
|
@ -970,10 +969,13 @@ int tsip_dialog_invite_msession_configure(tsip_dialog_invite_t *self)
|
|||
is_rtcweb_enabled = (((tsip_ssession_t*)TSIP_DIALOG(self)->ss)->media.profile == tmedia_profile_rtcweb);
|
||||
srtp_mode = is_rtcweb_enabled ? tmedia_srtp_mode_mandatory : ((tsip_ssession_t*)TSIP_DIALOG(self)->ss)->media.srtp_mode;
|
||||
|
||||
|
||||
|
||||
return tmedia_session_mgr_set(self->msession_mgr,
|
||||
TMEDIA_SESSION_SET_INT32(self->msession_mgr->type, "srtp-mode", srtp_mode),
|
||||
TMEDIA_SESSION_SET_INT32(self->msession_mgr->type, "avpf-enabled", is_rtcweb_enabled), // Otherwise will be negociated using SDPCapNeg (RFC 5939)
|
||||
TMEDIA_SESSION_SET_INT32(self->msession_mgr->type, "rtcp-enabled", use_rtcp),
|
||||
TMEDIA_SESSION_SET_INT32(self->msession_mgr->type, "rtcp-enabled", self->use_rtcp),
|
||||
TMEDIA_SESSION_SET_INT32(self->msession_mgr->type, "rtcpmux-enabled", self->use_rtcpmux),
|
||||
tsk_null);
|
||||
}
|
||||
|
||||
|
@ -1038,7 +1040,7 @@ int send_INVITEorUPDATE(tsip_dialog_invite_t *self, tsk_bool_t is_INVITE, tsk_bo
|
|||
|
||||
/* Session timers */
|
||||
if(self->stimers.timer.timeout){
|
||||
if(self->require.timer){
|
||||
if(self->required.timer){
|
||||
tsip_message_add_headers(request,
|
||||
TSIP_HEADER_SESSION_EXPIRES_VA_ARGS(self->stimers.timer.timeout, !self->stimers.is_refresher),
|
||||
TSIP_HEADER_REQUIRE_VA_ARGS("timer"),
|
||||
|
@ -1063,7 +1065,7 @@ int send_INVITEorUPDATE(tsip_dialog_invite_t *self, tsk_bool_t is_INVITE, tsk_bo
|
|||
}
|
||||
|
||||
/* 100rel */
|
||||
if(self->require._100rel){
|
||||
if(self->required._100rel){
|
||||
tsip_message_add_headers(request,
|
||||
TSIP_HEADER_REQUIRE_VA_ARGS("100rel"),
|
||||
tsk_null
|
||||
|
@ -1077,7 +1079,7 @@ int send_INVITEorUPDATE(tsip_dialog_invite_t *self, tsk_bool_t is_INVITE, tsk_bo
|
|||
}
|
||||
|
||||
/* QoS */
|
||||
if(self->require.precondition){
|
||||
if(self->required.precondition){
|
||||
tsip_message_add_headers(request,
|
||||
TSIP_HEADER_REQUIRE_VA_ARGS("precondition"),
|
||||
tsk_null
|
||||
|
@ -1434,7 +1436,7 @@ int send_RESPONSE(tsip_dialog_invite_t *self, const tsip_request_t* request, sho
|
|||
if((response = tsip_dialog_response_new(TSIP_DIALOG(self), code, phrase, request))){
|
||||
if(TSIP_REQUEST_IS_INVITE(request) || TSIP_REQUEST_IS_UPDATE(request)){
|
||||
/* Session timers (for 2xx to INVITE or UPDATE) */
|
||||
if(self->require.timer){
|
||||
if(self->required.timer){
|
||||
tsip_message_add_headers(response,
|
||||
TSIP_HEADER_REQUIRE_VA_ARGS("timer"),
|
||||
TSIP_HEADER_SESSION_EXPIRES_VA_ARGS(self->stimers.timer.timeout, tsk_striequals(self->stimers.refresher, "uas")),
|
||||
|
@ -1464,7 +1466,7 @@ int send_RESPONSE(tsip_dialog_invite_t *self, const tsip_request_t* request, sho
|
|||
/* 180 Ringing */
|
||||
/* 183 Session in Progress */
|
||||
if(code == 180 || code == 183){
|
||||
if(self->require._100rel){
|
||||
if(self->required._100rel){
|
||||
if(self->rseq == 0){
|
||||
self->rseq = TSK_ABS((rand() ^ rand()) + 1);
|
||||
}
|
||||
|
@ -1486,7 +1488,7 @@ int send_RESPONSE(tsip_dialog_invite_t *self, const tsip_request_t* request, sho
|
|||
|
||||
/* Precondition */
|
||||
if(code == 180 || code == 183){
|
||||
if(self->require.precondition){
|
||||
if(self->required.precondition){
|
||||
tsip_message_add_headers(response,
|
||||
TSIP_HEADER_REQUIRE_VA_ARGS("precondition"),
|
||||
tsk_null
|
||||
|
@ -1515,7 +1517,7 @@ int send_RESPONSE(tsip_dialog_invite_t *self, const tsip_request_t* request, sho
|
|||
);
|
||||
}
|
||||
else if(TSIP_REQUEST_IS_REFER(request)){
|
||||
if(self->require.norefersub){
|
||||
if(self->required.norefersub){
|
||||
tsip_message_add_headers(response,
|
||||
TSIP_HEADER_REQUIRE_VA_ARGS("norefersub"),
|
||||
tsk_null
|
||||
|
@ -1634,9 +1636,12 @@ static tsk_object_t* tsip_dialog_invite_ctor(tsk_object_t * self, va_list * app)
|
|||
/* default values */
|
||||
dialog->supported._100rel = ((tsip_ssession_t*)ss)->media.enable_100rel;
|
||||
dialog->supported.norefersub = tsk_true;
|
||||
dialog->supported.ice = (((tsip_ssession_t*)ss)->media.profile == tmedia_profile_rtcweb) ? tsk_true : ((tsip_ssession_t*)ss)->media.enable_ice;
|
||||
dialog->required.ice = (((tsip_ssession_t*)ss)->media.profile == tmedia_profile_rtcweb);
|
||||
dialog->supported.ice = (dialog->required.ice || ((tsip_ssession_t*)ss)->media.enable_ice);
|
||||
dialog->ice.is_jingle = (((tsip_ssession_t*)ss)->media.profile == tmedia_profile_rtcweb);
|
||||
dialog->use_rtcp = tsk_false; // FIXME: this is used for ICE neg. For now we always use "rtcp-mux"
|
||||
dialog->use_rtcp = (((tsip_ssession_t*)ss)->media.profile == tmedia_profile_rtcweb) ? tsk_true : ((tsip_ssession_t*)ss)->media.enable_rtcp;
|
||||
dialog->use_rtcpmux = (((tsip_ssession_t*)ss)->media.profile == tmedia_profile_rtcweb) ? tsk_true : ((tsip_ssession_t*)ss)->media.enable_rtcpmux;
|
||||
|
||||
dialog->ice.last_action_id = tsk_fsm_state_none;
|
||||
dialog->refersub = tsk_true;
|
||||
// ... do the same for preconditions, replaces, ....
|
||||
|
|
|
@ -179,7 +179,7 @@ int c0000_Started_2_Outgoing_X_oINVITE(va_list *app)
|
|||
self->qos.strength = TSIP_DIALOG_GET_SS(self)->media.qos.strength;
|
||||
tmedia_session_mgr_set_qos(self->msession_mgr, self->qos.type, self->qos.strength);
|
||||
self->supported.precondition = (self->qos.strength == tmedia_qos_strength_optional);
|
||||
self->require.precondition = (self->qos.strength == tmedia_qos_strength_mandatory);
|
||||
self->required.precondition = (self->qos.strength == tmedia_qos_strength_mandatory);
|
||||
|
||||
/* send the request */
|
||||
ret = send_INVITE(self, tsk_false);
|
||||
|
@ -225,7 +225,7 @@ int c0000_Outgoing_2_Connected_X_i2xxINVITE(va_list *app)
|
|||
|
||||
// starts ICE timers now that both parties received the "candidates"
|
||||
if(tsip_dialog_invite_ice_is_enabled(self)){
|
||||
tsip_dialog_invite_ice_timers_set(self, TSIP_DIALOG_INVITE_ICE_CONNCHECK_TIMEOUT);
|
||||
tsip_dialog_invite_ice_timers_set(self, (self->required.ice ? -1 : TSIP_DIALOG_INVITE_ICE_CONNCHECK_TIMEOUT));
|
||||
}
|
||||
|
||||
/* Alert the user (session) */
|
||||
|
|
|
@ -181,7 +181,7 @@ static int x0400_oECTing_2_oECTing_X_i2xx(va_list *app)
|
|||
self->refersub = Refer_Sub->sub;
|
||||
}
|
||||
if(tsip_message_required(response, "norefersub")){
|
||||
self->require.norefersub = tsk_true;
|
||||
self->required.norefersub = tsk_true;
|
||||
}
|
||||
|
||||
return TSIP_DIALOG_INVITE_SIGNAL(self, tsip_o_ect_accepted,
|
||||
|
|
|
@ -126,6 +126,7 @@ static int tsip_dialog_invite_ice_create_ctx(tsip_dialog_invite_t * self, tmedia
|
|||
return -2;
|
||||
}
|
||||
tnet_ice_ctx_set_stun(self->ice.ctx_audio, "stun.l.google.com", 19302, "Doubango", "bossiel@yahoo.fr", "stun-password"); //FIXME
|
||||
tnet_ice_ctx_set_rtcpmux(self->ice.ctx_audio, self->use_rtcpmux);
|
||||
}
|
||||
if(!self->ice.ctx_video && (media_type & tmedia_video)){
|
||||
self->ice.ctx_video = tnet_ice_ctx_create(self->ice.is_jingle, TNET_SOCKET_TYPE_IS_IPV6(TSIP_DIALOG_GET_STACK(self)->network.proxy_cscf_type),
|
||||
|
@ -135,6 +136,7 @@ static int tsip_dialog_invite_ice_create_ctx(tsip_dialog_invite_t * self, tmedia
|
|||
return -2;
|
||||
}
|
||||
tnet_ice_ctx_set_stun(self->ice.ctx_video, "stun.l.google.com", 19302, "Doubango", "bossiel@yahoo.fr", "stun-password"); // FIXME
|
||||
tnet_ice_ctx_set_rtcpmux(self->ice.ctx_video, self->use_rtcpmux);
|
||||
}
|
||||
|
||||
// "none" comparison is used to exclude the "first call"
|
||||
|
@ -277,6 +279,7 @@ int tsip_dialog_invite_ice_process_ro(tsip_dialog_invite_t * self, const tsdp_me
|
|||
const char* sess_ufrag = tsk_null;
|
||||
const char* sess_pwd = tsk_null;
|
||||
int ret = 0, i;
|
||||
struct tnet_ice_ctx_s *ctx;
|
||||
|
||||
if(!self || !sdp_ro){
|
||||
TSK_DEBUG_ERROR("Invalid parameter");
|
||||
|
@ -307,6 +310,8 @@ int tsip_dialog_invite_ice_process_ro(tsip_dialog_invite_t * self, const tsdp_me
|
|||
for(i = 0; i < 2; ++i){
|
||||
if((M = tsdp_message_find_media(sdp_ro, i==0 ? "audio": "video"))){
|
||||
const char *ufrag = sess_ufrag, *pwd = sess_pwd;
|
||||
tsk_bool_t remote_use_rtcpmux = (tsdp_header_M_findA(M, "rtcp-mux") != tsk_null);
|
||||
ctx = (i==0 ? self->ice.ctx_audio : self->ice.ctx_video);
|
||||
ice_remote_candidates = tsk_null;
|
||||
index = 0;
|
||||
if((A = tsdp_header_M_findA(M, "ice-ufrag"))){
|
||||
|
@ -321,8 +326,10 @@ int tsip_dialog_invite_ice_process_ro(tsip_dialog_invite_t * self, const tsdp_me
|
|||
}
|
||||
// ICE processing will be automatically stopped if the remote candidates are not valid
|
||||
// ICE-CONTROLLING role if we are the offerer
|
||||
ret = tnet_ice_ctx_set_remote_candidates(i==0 ? self->ice.ctx_audio : self->ice.ctx_video, ice_remote_candidates, ufrag, pwd, !is_remote_offer, self->ice.is_jingle);
|
||||
ret = tnet_ice_ctx_set_remote_candidates(ctx, ice_remote_candidates, ufrag, pwd, !is_remote_offer, self->ice.is_jingle);
|
||||
TSK_SAFE_FREE(ice_remote_candidates);
|
||||
// Now that 'rtcp-mux' option have been updated by the session pass the value to the ICE ctx
|
||||
ret = tnet_ice_ctx_set_rtcpmux(ctx, (self->use_rtcpmux && remote_use_rtcpmux));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -318,7 +318,7 @@ int s0000_Started_2_Ringing_X_iINVITE(va_list *app)
|
|||
|
||||
// add "require:100rel" tag if the incoming INVITE contains "100rel" tag in "supported" header
|
||||
if(self->last_iInvite && (tsip_message_supported(self->last_iInvite, "100rel") || tsip_message_required(self->last_iInvite, "100rel")) && self->supported._100rel){
|
||||
self->require._100rel = tsk_true;
|
||||
self->required._100rel = tsk_true;
|
||||
}
|
||||
|
||||
// add "require:timer" tag if incoming INVITE contains "timer" tag in "supported" header and session timers is enabled
|
||||
|
@ -328,7 +328,7 @@ int s0000_Started_2_Ringing_X_iINVITE(va_list *app)
|
|||
self->stimers.timer.timeout = hdr_SessionExpires->delta_seconds;
|
||||
tsk_strupdate(&self->stimers.refresher, hdr_SessionExpires->refresher_uas ? "uas" : "uac");
|
||||
self->stimers.is_refresher = tsk_striequals(self->stimers.refresher, "uas");
|
||||
self->require.timer = tsk_true;
|
||||
self->required.timer = tsk_true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -372,8 +372,8 @@ int s0000_Started_2_InProgress_X_iINVITE(va_list *app)
|
|||
transaction MUST be between 1 and 2**31 - 1.
|
||||
*/
|
||||
self->rseq = (rand() ^ rand()) % (0x00000001 << 31);
|
||||
self->require._100rel = tsk_true;
|
||||
self->require.precondition = (tsip_message_supported(self->last_iInvite, "precondition") || tsip_message_required(self->last_iInvite, "precondition"));
|
||||
self->required._100rel = tsk_true;
|
||||
self->required.precondition = (tsip_message_supported(self->last_iInvite, "precondition") || tsip_message_required(self->last_iInvite, "precondition"));
|
||||
send_RESPONSE(self, request, 183, "Session in Progress", tsk_true);
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -254,13 +254,13 @@ int tsip_dialog_invite_stimers_handle(tsip_dialog_invite_t* self, const tsip_mes
|
|||
tsk_strupdate(&self->stimers.refresher, hdr_SessionExpires->refresher_uas ? "uas" : "uac");
|
||||
self->stimers.is_refresher = tsk_striequals(self->stimers.refresher, "uac");
|
||||
self->supported.timer = (self->stimers.timer.timeout != 0);
|
||||
self->require.timer = self->supported.timer;
|
||||
self->required.timer = self->supported.timer;
|
||||
}
|
||||
}
|
||||
else{
|
||||
self->stimers.timer.timeout = 0; /* turned-off */
|
||||
self->supported.timer = tsk_false;
|
||||
self->require.timer = tsk_false;
|
||||
self->required.timer = tsk_false;
|
||||
ret = send_RESPONSE(self, message, 481, "Session-Expires header is missing");
|
||||
return 0;
|
||||
}
|
||||
|
@ -277,7 +277,7 @@ int tsip_dialog_invite_stimers_handle(tsip_dialog_invite_t* self, const tsip_mes
|
|||
*/
|
||||
self->stimers.timer.timeout = 0; /* turned-off */
|
||||
self->supported.timer = tsk_false;
|
||||
self->require.timer = tsk_false;
|
||||
self->required.timer = tsk_false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -255,18 +255,10 @@ int __tsip_ssession_set(tsip_ssession_t *self, va_list *app)
|
|||
// (tmedia_srtp_mode_t)SRTP_MODE_ENUM
|
||||
self->media.srtp_mode = va_arg(*app, tmedia_srtp_mode_t);
|
||||
break;
|
||||
case mstype_set_100rel:
|
||||
self->media.enable_100rel = tsk_true;
|
||||
break;
|
||||
case mstype_unset_100rel:
|
||||
self->media.enable_100rel = tsk_false;
|
||||
break;
|
||||
case mstype_set_ice:
|
||||
self->media.enable_ice = tsk_true;
|
||||
break;
|
||||
case mstype_unset_ice:
|
||||
self->media.enable_ice = tsk_false;
|
||||
break;
|
||||
case mstype_set_100rel: self->media.enable_100rel = va_arg(*app, tsk_bool_t); break;
|
||||
case mstype_set_ice: self->media.enable_ice = va_arg(*app, tsk_bool_t); break;
|
||||
case mstype_set_rtcp: self->media.enable_rtcp = va_arg(*app, tsk_bool_t); break;
|
||||
case mstype_set_rtcpmux: self->media.enable_rtcpmux = va_arg(*app, tsk_bool_t); break;
|
||||
case mstype_set_qos:
|
||||
{ /* (tmedia_qos_stype_t)TYPE_ENUM, (tmedia_qos_strength_t)STRENGTH_ENUM */
|
||||
self->media.qos.type = va_arg(*app, tmedia_qos_stype_t);
|
||||
|
@ -577,6 +569,8 @@ static tsk_object_t* tsip_ssession_ctor(tsk_object_t * self, va_list * app)
|
|||
ss->media.srtp_mode = tmedia_defaults_get_srtp_mode();
|
||||
ss->media.enable_100rel = tmedia_defaults_get_100rel_enabled();
|
||||
ss->media.enable_ice = tmedia_defaults_get_ice_enabled();
|
||||
ss->media.enable_rtcp = tmedia_defaults_get_rtcp_enabled();
|
||||
ss->media.enable_rtcpmux = tmedia_defaults_get_rtcpmux_enabled();
|
||||
ss->media.type = tmedia_none;
|
||||
ss->media.qos.type = tmedia_qos_stype_none;
|
||||
ss->media.qos.strength = tmedia_qos_strength_none;
|
||||
|
|
Loading…
Reference in New Issue