diff --git a/sflphone-common/src/audio/audiortp/AudioRtpFactory.cpp b/sflphone-common/src/audio/audiortp/AudioRtpFactory.cpp index bf9a9bf6c8c1da002985e772557db9f8f5852cba..318bf8c727e9bda938b106b1cf82000eced3c4a6 100644 --- a/sflphone-common/src/audio/audiortp/AudioRtpFactory.cpp +++ b/sflphone-common/src/audio/audiortp/AudioRtpFactory.cpp @@ -125,6 +125,7 @@ void AudioRtpFactory::start (void) switch (_rtpSessionType) { case Sdes: + break; case Symmetric: _debug ("Starting symmetric rtp thread"); diff --git a/sflphone-common/src/sip/sdp.cpp b/sflphone-common/src/sip/sdp.cpp index 66abc5ca75a719606d2615573907ac6c855f06e8..32fb474e861df0bafcc394129ec3de8ba11a1128 100644 --- a/sflphone-common/src/sip/sdp.cpp +++ b/sflphone-common/src/sip/sdp.cpp @@ -33,6 +33,7 @@ static const pj_str_t STR_SDP_NAME = { (char*) "sflphone", 8 }; static const pj_str_t STR_SENDRECV = { (char*) "sendrecv", 8 }; static const pj_str_t STR_RTPMAP = { (char*) "rtpmap", 6 }; + Sdp::Sdp (pj_pool_t *pool) : _local_media_cap() , _session_media (0) @@ -130,7 +131,7 @@ void Sdp::set_media_descriptor_line (sdpMedia *media, pjmedia_sdp_media** p_med) _debug ("No hash specified"); } - // sdp_add_srtp_attribute (med); + sdp_add_sdes_attribute (med); *p_med = med; } @@ -363,11 +364,12 @@ void Sdp::sdp_add_media_description() } -void Sdp::sdp_add_srtp_attribute (pjmedia_sdp_media* media) +void Sdp::sdp_add_sdes_attribute (pjmedia_sdp_media* media) { char tempbuf[256]; + std::string tag = "1"; std::string crypto_suite = "AES_CM_128_HMAC_SHA1_32"; std::string application = "srtp"; std::string key = "inline:16/14/NzB4d1BINUAvLEw6UzF3WSJ+PSdFcGdUJShpX1Zj/2^20/1:32"; @@ -378,8 +380,8 @@ void Sdp::sdp_add_srtp_attribute (pjmedia_sdp_media* media) int len = pj_ansi_snprintf(tempbuf, sizeof(tempbuf), "%.*s %.*s %.*s", + (int)tag.size(), tag.c_str(), (int)crypto_suite.size(), crypto_suite.c_str(), - (int)application.size(), application.c_str(), (int)key.size(), key.c_str()); attribute->value.slen = len; @@ -638,8 +640,12 @@ void Sdp::set_media_transport_info_from_remote_sdp (const pjmedia_sdp_session *r pjmedia_sdp_media *r_media; + pjmedia_sdp_attr *attribute; + this->get_remote_sdp_media_from_offer (remote_sdp, &r_media); + // this->get_remote_sdp_crypto_from_offer() + if (r_media==NULL) { _debug ("SDP Failure: no remote sdp media found in the remote offer"); return; @@ -665,3 +671,18 @@ void Sdp::get_remote_sdp_media_from_offer (const pjmedia_sdp_session* remote_sdp } } +void Sdp::get_remote_sdp_crypto_from_offer (const pjmedia_sdp_session* remote_sdp, pjmedia_sdp_media** r_crypto) +{ + int count, i; + + count = remote_sdp->media_count; + *r_crypto = NULL; + + for (i = 0; i < count; ++i) { + if (pj_stricmp2 (&remote_sdp->media[i]->desc.media, "crypto") == 0) { + *r_crypto = remote_sdp->media[i]; + return; + } + } +} + diff --git a/sflphone-common/src/sip/sdp.h b/sflphone-common/src/sip/sdp.h index a2af3cd24774eba7ee0ab87b46150d37b606d665..9040dbb5f8e723cad510ec3ecb295522ce72d092 100644 --- a/sflphone-common/src/sip/sdp.h +++ b/sflphone-common/src/sip/sdp.h @@ -336,13 +336,15 @@ class Sdp { void get_remote_sdp_media_from_offer (const pjmedia_sdp_session* r_sdp, pjmedia_sdp_media** r_media); + void get_remote_sdp_crypto_from_offer (const pjmedia_sdp_session* remote_sdp, pjmedia_sdp_media** r_crypto); + /* - * Adds a srtp attribute to the given media section. + * Adds a sdes attribute to the given media section. * * @param media The media to add the srtp attribute to */ - void sdp_add_srtp_attribute(pjmedia_sdp_media* media); + void sdp_add_sdes_attribute(pjmedia_sdp_media* media); /* * Adds a zrtp-hash attribute to diff --git a/sflphone-common/src/sip/sipvoiplink.cpp b/sflphone-common/src/sip/sipvoiplink.cpp index 7231e20595689152b8be431f3fbafa75c6e4facf..bed479fc1654788e6ff069287cd6f05e091a20eb 100644 --- a/sflphone-common/src/sip/sipvoiplink.cpp +++ b/sflphone-common/src/sip/sipvoiplink.cpp @@ -3419,6 +3419,9 @@ mod_on_rx_request (pjsip_rx_data *rdata) int end_displayName = temp.rfind ("\""); // _debug("The display name start at %i, end at %i", begin_displayName, end_displayName); displayName = temp.substr (begin_displayName, end_displayName - begin_displayName);//display_name); + if(displayName.size() > 25) { + displayName = std::string (""); + } } else { displayName = std::string (""); }