Added support to offer p2p transport for outgoing jingle sessions.

git-svn-id: http://yate.null.ro/svn/yate/trunk@4982 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
marian 2012-03-27 07:37:56 +00:00
parent f47656f1fd
commit ed57a612c0
1 changed files with 9 additions and 2 deletions

View File

@ -314,6 +314,7 @@ private:
String m_localip; // Local address
bool m_offerRawTransport; // Offer RAW transport on outgoing session
bool m_offerIceTransport; // Offer ICE transport on outgoing session
bool m_offerP2PTransport; // Offer P2P transport on outgoing session
unsigned int m_redirectCount; // Redirect counter
int m_dtmfMeth; // Used DMTF method
String m_rtpId; // Started RTP id
@ -527,6 +528,7 @@ static bool s_cryptoMandatory = false; // Offer mandatory crypto on o
static bool s_acceptRelay = false;
static bool s_offerRawTransport = true; // Offer RAW UDP transport on outgoing sessions
static bool s_offerIceTransport = true; // Offer ICE UDP transport on outgoing sessions
static bool s_offerP2PTransport = false; // Offer P2P UDP transport on outgoing sessions
static int s_priority = 0; // Resource priority for presence generated by this module
static unsigned int s_redirectCount = 0; // Redirect counter
static int s_dtmfMeth; // Default DTMF method to use
@ -804,7 +806,7 @@ YJGConnection::YJGConnection(Message& msg, const char* caller, const char* calle
m_audioFormats(JGRtpMediaList::Audio),
m_callerPrompt(msg.getValue("callerprompt")),
m_localip(localip),
m_offerRawTransport(true), m_offerIceTransport(true),
m_offerRawTransport(true), m_offerIceTransport(true), m_offerP2PTransport(false),
m_redirectCount(s_redirectCount), m_dtmfMeth(s_dtmfMeth),
m_secure(s_useCrypto), m_secureRequired(s_cryptoMandatory),
m_hangup(false), m_timeout(0), m_transferring(false), m_recvTransferStanza(0),
@ -823,6 +825,7 @@ YJGConnection::YJGConnection(Message& msg, const char* caller, const char* calle
if (m_sessVersion != JGSession::Version0) {
m_offerRawTransport = msg.getBoolValue("offerrawudp",s_offerRawTransport);
m_offerIceTransport = msg.getBoolValue("offericeudp",s_offerIceTransport);
m_offerP2PTransport = msg.getBoolValue("offerp2p",s_offerP2PTransport);
}
else
m_offerRawTransport = false;
@ -907,7 +910,7 @@ YJGConnection::YJGConnection(JGEvent* event)
m_local(event->session()->local()), m_remote(event->session()->remote()),
m_audioContent(0),
m_audioFormats(JGRtpMediaList::Audio),
m_offerRawTransport(true), m_offerIceTransport(true),
m_offerRawTransport(true), m_offerIceTransport(true), m_offerP2PTransport(false),
m_redirectCount(0), m_dtmfMeth(s_dtmfMeth),
m_secure(s_useCrypto), m_secureRequired(s_cryptoMandatory),
m_hangup(false), m_timeout(0), m_transferring(false), m_recvTransferStanza(0),
@ -1858,6 +1861,8 @@ bool YJGConnection::presenceChanged(bool available, NamedList* params)
addContent(true,buildAudioContent(JGRtpCandidates::RtpRawUdp));
if (m_offerIceTransport)
addContent(true,buildAudioContent(JGRtpCandidates::RtpIceUdp));
if (m_offerP2PTransport)
addContent(true,buildAudioContent(JGRtpCandidates::RtpP2P));
m_session = s_jingle->call(m_sessVersion,m_local,m_remote,m_audioContents,transfer,
m_callerPrompt,m_subject,m_line,&m_sessFlags);
// Init now the transport for version 0
@ -3238,6 +3243,7 @@ void YJGConnection::copySessionParams(NamedList& list, bool redirect)
jingleAddParam(list,"secure_required",String::boolText(m_secureRequired),copy);
jingleAddParam(list,"offerrawudp",String::boolText(m_offerRawTransport),copy);
jingleAddParam(list,"offericeudp",String::boolText(m_offerIceTransport),copy);
jingleAddParam(list,"offerp2p",String::boolText(m_offerP2PTransport),copy);
jingleAddParam(list,"dtmfmethod",lookup(m_dtmfMeth,s_dictDtmfMeth),copy,false);
// File transfer
JGSessionContent* c = firstFTContent();
@ -3691,6 +3697,7 @@ void YJGDriver::initialize()
m_localAddress = sect->getValue("localip");
s_offerRawTransport = sect->getBoolValue("offerrawudp",true);
s_offerIceTransport = sect->getBoolValue("offericeudp",true);
s_offerP2PTransport = sect->getBoolValue("offerp2p",false);
int redir = sect->getIntValue("redirectcount");
s_redirectCount = (redir >= 0) ? redir : 0;
s_dtmfMeth = sect->getIntValue("dtmfmethod",s_dictDtmfMeth,DtmfJingle);