Provide the entire SDPMedia to the mediaChanged() mthod, not only the name of the media.
Add the "rtpid" parameter to the chan.rtp message if the media id() is available. git-svn-id: http://yate.null.ro/svn/yate/trunk@2832 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
parent
fb6762b981
commit
381bb557b6
|
@ -581,6 +581,8 @@ Message* SDPSession::buildChanRtp(SDPMedia* media, const char* addr, bool start,
|
|||
Message* m = buildChanRtp(context);
|
||||
if (!m)
|
||||
return 0;
|
||||
if (media->id())
|
||||
m->addParam("rtpid",media->id());
|
||||
m->addParam("media",*media);
|
||||
m->addParam("transport",media->transport());
|
||||
m->addParam("direction","bidir");
|
||||
|
@ -731,9 +733,10 @@ ObjList* SDPSession::updateRtpSDP(const NamedList& params, String& rtpAddr, ObjL
|
|||
}
|
||||
|
||||
// Media changed notification.
|
||||
void SDPSession::mediaChanged(const String& name)
|
||||
void SDPSession::mediaChanged(const SDPMedia& media)
|
||||
{
|
||||
XDebug(m_parser,DebugAll,"SDPSession::mediaChanged(%s) [%p]",name.c_str(),this);
|
||||
XDebug(m_parser,DebugAll,"SDPSession::mediaChanged('%s' %p)%s%s [%p]",
|
||||
media.c_str(),&media,(media.id() ? " id=" : ""),media.id().safe(),this);
|
||||
}
|
||||
|
||||
}; // namespace TelEngine
|
||||
|
|
|
@ -583,9 +583,9 @@ protected:
|
|||
/**
|
||||
* Media changed notification.
|
||||
* This method is called when setting new media and an old one changed
|
||||
* @param name Changed media name
|
||||
* @param media Old media that changed
|
||||
*/
|
||||
virtual void mediaChanged(const String& name);
|
||||
virtual void mediaChanged(const SDPMedia& media);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -187,11 +187,8 @@ protected:
|
|||
virtual Message* buildChanRtp(SDPMedia* media, const char* addr, bool start, RefObject* context)
|
||||
{
|
||||
Message* m = SDPSession::buildChanRtp(media,addr,start,context);
|
||||
if (m) {
|
||||
if (start && media->id())
|
||||
m->addParam("rtpid",media->id());
|
||||
if (m)
|
||||
m->addParam("mgcp_allowed",String::boolText(false));
|
||||
}
|
||||
return m;
|
||||
}
|
||||
private:
|
||||
|
|
|
@ -325,7 +325,7 @@ public:
|
|||
protected:
|
||||
virtual Message* buildChanRtp(RefObject* context);
|
||||
MimeSdpBody* createProvisionalSDP(Message& msg);
|
||||
virtual void mediaChanged(const String& name);
|
||||
virtual void mediaChanged(const SDPMedia& media);
|
||||
|
||||
private:
|
||||
virtual void statusParams(String& str);
|
||||
|
@ -2255,10 +2255,11 @@ Message* YateSIPConnection::buildChanRtp(RefObject* context)
|
|||
}
|
||||
|
||||
// Media changed notification, reimplemented from SDPSession
|
||||
void YateSIPConnection::mediaChanged(const String& name)
|
||||
void YateSIPConnection::mediaChanged(const SDPMedia& media)
|
||||
{
|
||||
SDPSession::mediaChanged(media);
|
||||
// Clear the data endpoint, will be rebuilt later if required
|
||||
clearEndpoint(name);
|
||||
clearEndpoint(media);
|
||||
}
|
||||
|
||||
// Process SIP events belonging to this connection
|
||||
|
|
Loading…
Reference in New Issue