14 #include "simanager.h"
16 #include "siprofilehandler.h"
17 #include "sihandler.h"
18 #include "clientbase.h"
25 : m_parent( parent ), m_advertise( advertise )
27 if( m_parent && m_advertise )
30 if( m_parent->
disco() )
37 if( m_parent && m_advertise )
41 if( m_parent->
disco() )
47 Tag* child1,
Tag* child2,
const std::string& mimetype )
49 if( !m_parent || !sih )
52 const std::string&
id = m_parent->
getID();
53 const std::string& id2 = m_parent->
getID();
59 Tag* si =
new Tag( iq,
"si" );
62 if( mimetype.empty() )
76 m_parent->
trackID(
this,
id, OfferSI );
88 Tag* si =
new Tag( iq,
"si" );
103 Tag* error =
new Tag( iq,
"error" );
110 new Tag( error,
"no-valid-streams",
"xmlns",
XMLNS_SI );
112 new Tag( error,
"bad-profile",
"xmlns",
XMLNS_SI );
126 m_parent->
send( iq );
131 if( !sih || profile.empty() )
134 m_handlers[profile] = sih;
136 if( m_parent && m_advertise && m_parent->
disco() )
142 if( profile.empty() )
145 m_handlers.erase( profile );
147 if( m_parent && m_advertise && m_parent->
disco() )
153 TrackMap::iterator it = m_track.find( stanza->
id() );
154 if( it != m_track.end() )
161 HandlerMap::const_iterator it = m_handlers.find( profile );
162 if( it != m_handlers.end() && (*it).second )
166 (*it).second->handleSIRequest( stanza->
from(), stanza->
id(), profile, si, p, f );
179 if( context == OfferSI )
181 TrackMap::iterator it = m_track.find( stanza->
id() );
182 if( it != m_track.end() )
192 (*it).second.sih->handleSIRequestResult( stanza->
from(), (*it).second.sid, si, ptag, fneg );
199 if( context == OfferSI )
201 TrackMap::iterator it = m_track.find( stanza->
id() );
202 if( it != m_track.end() )
204 (*it).second.sih->handleSIRequestError( stanza, (*it).second.sid );