Removed SIP MIME classes, use engine provided ones.

git-svn-id: http://voip.null.ro/svn/yate@1411 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2007-07-26 23:47:29 +00:00
parent 9594fb6fee
commit 6a96997584
7 changed files with 43 additions and 446 deletions

View File

@ -13,7 +13,7 @@ INCFILES := @top_srcdir@/yateclass.h @srcdir@/yatesip.h @srcdir@/util.h
PROGS=
LIBS = libyatesip.a
OBJS = util.o engine.o body.o message.o transaction.o
OBJS = util.o engine.o message.o transaction.o
LOCALFLAGS =
LOCALLIBS =

View File

@ -1,240 +0,0 @@
/**
* body.cpp
* Yet Another SIP Stack
* This file is part of the YATE Project http://YATE.null.ro
*
* Yet Another Telephony Engine - a fully featured software PBX and IVR
* Copyright (C) 2004-2006 Null Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <yatesip.h>
#include "util.h"
#include <string.h>
#include <stdlib.h>
using namespace TelEngine;
SIPBody::SIPBody(const String& type)
: m_type(type)
{
DDebug(DebugAll,"SIPBody::SIPBody('%s') [%p]",m_type.c_str(),this);
}
SIPBody::~SIPBody()
{
DDebug(DebugAll,"SIPBody::~SIPBody() '%s' [%p]",m_type.c_str(),this);
}
const DataBlock& SIPBody::getBody() const
{
if (m_body.null())
buildBody();
return m_body;
}
SIPBody* SIPBody::build(const char* buf, int len, const String& type)
{
DDebug(DebugAll,"SIPBody::build(%p,%d,'%s')",buf,len,type.c_str());
if ((len <= 0) || !buf)
return 0;
if (type == "application/sdp")
return new SDPBody(type,buf,len);
if (type == "application/dtmf-relay")
return new SIPLinesBody(type,buf,len);
if (type.startsWith("text/") || (type == "application/dtmf"))
return new SIPStringBody(type,buf,len);
return new SIPBinaryBody(type,buf,len);
}
SDPBody::SDPBody()
: SIPBody("application/sdp")
{
}
SDPBody::SDPBody(const String& type, const char* buf, int len)
: SIPBody(type)
{
while (len > 0) {
String* line = getUnfoldedLine(&buf,&len);
int eq = line->find('=');
if (eq > 0)
m_lines.append(new NamedString(line->substr(0,eq),line->substr(eq+1)));
line->destruct();
}
}
SDPBody::SDPBody(const SDPBody& original)
: SIPBody(original.getType())
{
const ObjList* l = &original.m_lines;
for (; l; l = l->next()) {
const NamedString* t = static_cast<NamedString*>(l->get());
if (t)
m_lines.append(new NamedString(t->name(),*t));
}
}
SDPBody::~SDPBody()
{
}
void SDPBody::buildBody() const
{
DDebug(DebugAll,"SDPBody::buildBody() [%p]",this);
const ObjList* l = &m_lines;
for (; l; l = l->next()) {
const NamedString* t = static_cast<NamedString*>(l->get());
if (t) {
String line;
line << t->name() << "=" << *t << "\r\n";
m_body += line;
}
}
}
SIPBody* SDPBody::clone() const
{
return new SDPBody(*this);
}
const NamedString* SDPBody::getLine(const char* name) const
{
if (!(name && *name))
return 0;
const ObjList* l = &m_lines;
for (; l; l = l->next()) {
const NamedString* t = static_cast<NamedString*>(l->get());
if (t && (t->name() &= name))
return t;
}
return 0;
}
const NamedString* SDPBody::getNextLine(const NamedString* line) const
{
if (!line)
return 0;
const ObjList* l = m_lines.find(line);
if (!l)
return 0;
l = l->next();
for (; l; l = l->next()) {
const NamedString* t = static_cast<NamedString*>(l->get());
if (t && (t->name() &= line->name()))
return t;
}
return 0;
}
SIPBinaryBody::SIPBinaryBody(const String& type, const char* buf, int len)
: SIPBody(type)
{
m_body.assign((void*)buf,len);
}
SIPBinaryBody::SIPBinaryBody(const SIPBinaryBody& original)
: SIPBody(original.getType())
{
m_body = original.m_body;
}
SIPBinaryBody::~SIPBinaryBody()
{
}
void SIPBinaryBody::buildBody() const
{
DDebug(DebugAll,"SIPBinaryBody::buildBody() [%p]",this);
// nothing to do
}
SIPBody* SIPBinaryBody::clone() const
{
return new SIPBinaryBody(*this);
}
SIPStringBody::SIPStringBody(const String& type, const char* buf, int len)
: SIPBody(type), m_text(buf,len)
{
}
SIPStringBody::SIPStringBody(const SIPStringBody& original)
: SIPBody(original.getType()), m_text(original.m_text)
{
}
SIPStringBody::~SIPStringBody()
{
}
void SIPStringBody::buildBody() const
{
DDebug(DebugAll,"SIPStringBody::buildBody() [%p]",this);
m_body.assign((void*)m_text.c_str(),m_text.length());
}
SIPBody* SIPStringBody::clone() const
{
return new SIPStringBody(*this);
}
SIPLinesBody::SIPLinesBody(const String& type, const char* buf, int len)
: SIPBody(type)
{
while (len > 0)
m_lines.append(getUnfoldedLine(&buf,&len));
}
SIPLinesBody::SIPLinesBody(const SIPLinesBody& original)
: SIPBody(original.getType())
{
const ObjList* l = &original.m_lines;
for (; l; l = l->next()) {
const String* s = static_cast<String*>(l->get());
if (s)
m_lines.append(new String(*s));
}
}
SIPLinesBody::~SIPLinesBody()
{
}
void SIPLinesBody::buildBody() const
{
DDebug(DebugAll,"SIPLinesBody::buildBody() [%p]",this);
const ObjList* l = &m_lines;
for (; l; l = l->next()) {
const String* s = static_cast<String*>(l->get());
if (s) {
String line;
line << *s << "\r\n";
m_body += line;
}
}
}
SIPBody* SIPLinesBody::clone() const
{
return new SIPLinesBody(*this);
}
/* vi: set ts=8 sw=4 sts=4 noet: */

View File

@ -563,7 +563,7 @@ bool SIPMessage::parse(const char* buf, int len)
DDebug(DebugAll,"SIPMessage::parse(%p,%d) [%p]",buf,len,this);
String* line = 0;
while (len > 0) {
line = getUnfoldedLine(&buf,&len);
line = MimeBody::getUnfoldedLine(buf,len);
if (!line->null())
break;
// Skip any initial empty lines
@ -579,7 +579,7 @@ bool SIPMessage::parse(const char* buf, int len)
String content;
int clen = -1;
while (len > 0) {
line = getUnfoldedLine(&buf,&len);
line = MimeBody::getUnfoldedLine(buf,len);
if (line->null()) {
// Found end of headers
line->destruct();
@ -633,7 +633,7 @@ bool SIPMessage::parse(const char* buf, int len)
len = clen;
}
}
body = SIPBody::build(buf,len,content);
body = MimeBody::build(buf,len,content);
DDebug(DebugAll,"SIPMessage::parse %d header lines, body %p",
header.count(),body);
return true;
@ -767,7 +767,7 @@ const DataBlock& SIPMessage::getBuffer() const
return m_data;
}
void SIPMessage::setBody(SIPBody* newbody)
void SIPMessage::setBody(MimeBody* newbody)
{
if (newbody == body)
return;

View File

@ -27,79 +27,6 @@
namespace TelEngine {
// Utility function, checks if a character is a folded line continuation
bool isContinuationBlank(char c)
{
return ((c == ' ') || (c == '\t'));
}
// Utility function, returns an unfolded line and advances the pointer
String* getUnfoldedLine(const char** buf, int* len)
{
String* res = new String;
const char* b = *buf;
const char* s = b;
int l = *len;
int e = 0;
for (;(l > 0); ++b, --l) {
bool goOut = false;
switch (*b) {
case '\r':
// CR is optional but skip over it if exists
if ((l > 0) && (b[1] == '\n')) {
++b;
--l;
}
case '\n':
++b;
--l;
{
String line(s,e);
*res << line;
}
// Skip over any continuation characters at start of next line
goOut = true;
while ((l > 0) && isContinuationBlank(b[0])) {
++b;
--l;
goOut = false;
}
s = b;
e = 0;
if (!goOut) {
--b;
++l;
}
break;
case '\0':
// Should not happen - but let's accept what we got
Debug(DebugMild,"Unexpected NUL character while unfolding lines");
*res << s;
goOut = true;
// End parsing
b += l;
l = 0;
e = 0;
break;
default:
// Just count this character - we'll pick it later
++e;
}
// Exit without adjusting p and l
if (goOut)
break;
}
*buf = b;
*len = l;
// Collect any leftover characters
if (e) {
String line(s,e);
*res << line;
}
res->trimBlanks();
return res;
}
static const char* compactForms[] = {
"a", "Accept-Contact",
"u", "Allow-Events",

View File

@ -25,12 +25,6 @@
namespace TelEngine {
// Utility function, checks if a character is a line continuation blank
bool isContinuationBlank(char c);
// Utility function, returns an unfolded line and advances the pointer
String* getUnfoldedLine(const char** buf, int* len);
// Utility function, returns an uncompacted header name
const char* uncompactForm(const char* header);

View File

@ -25,6 +25,7 @@
#define __YATESIP_H
#include <yateclass.h>
#include <yatemime.h>
#ifdef _WINDOWS
@ -83,91 +84,6 @@ protected:
int m_partyPort;
};
class YSIP_API SIPBody : public GenObject
{
YCLASS(SIPBody,GenObject)
public:
SIPBody(const String& type);
virtual ~SIPBody();
inline const String& getType() const
{ return m_type; }
static SIPBody* build(const char* buf, int len, const String& type);
const DataBlock& getBody() const;
virtual bool isSDP() const
{ return false; }
virtual SIPBody* clone() const = 0;
protected:
virtual void buildBody() const = 0;
String m_type;
mutable DataBlock m_body;
};
class YSIP_API SDPBody : public SIPBody
{
YCLASS(SDPBody,SIPBody)
public:
SDPBody();
SDPBody(const String& type, const char* buf, int len);
virtual ~SDPBody();
virtual bool isSDP() const
{ return true; }
virtual SIPBody* clone() const;
inline const ObjList& lines() const
{ return m_lines; }
inline void addLine(const char* name, const char* value = 0)
{ m_lines.append(new NamedString(name,value)); }
const NamedString* getLine(const char* name) const;
const NamedString* getNextLine(const NamedString* line) const;
protected:
SDPBody(const SDPBody& original);
virtual void buildBody() const;
ObjList m_lines;
};
class YSIP_API SIPBinaryBody : public SIPBody
{
YCLASS(SIPBinaryBody,SIPBody)
public:
SIPBinaryBody(const String& type, const char* buf, int len);
virtual ~SIPBinaryBody();
virtual SIPBody* clone() const;
protected:
SIPBinaryBody(const SIPBinaryBody& original);
virtual void buildBody() const;
};
class YSIP_API SIPStringBody : public SIPBody
{
YCLASS(SIPStringBody,SIPBody)
public:
SIPStringBody(const String& type, const char* buf, int len = -1);
virtual ~SIPStringBody();
virtual SIPBody* clone() const;
inline const String& text() const
{ return m_text; }
protected:
SIPStringBody(const SIPStringBody& original);
virtual void buildBody() const;
String m_text;
};
class YSIP_API SIPLinesBody : public SIPBody
{
YCLASS(SIPLinesBody,SIPBody)
public:
SIPLinesBody(const String& type, const char* buf, int len);
virtual ~SIPLinesBody();
virtual SIPBody* clone() const;
inline const ObjList& lines() const
{ return m_lines; }
inline void addLine(const char* line)
{ m_lines.append(new String(line)); }
protected:
SIPLinesBody(const SIPLinesBody& original);
virtual void buildBody() const;
ObjList m_lines;
};
class YSIP_API SIPHeaderLine : public NamedString
{
public:
@ -457,7 +373,7 @@ public:
/**
* Set a new body for this message
*/
void setBody(SIPBody* newbody = 0);
void setBody(MimeBody* newbody = 0);
/**
* Sip Version
@ -493,7 +409,7 @@ public:
* All the body related things should be here, including the entire body and
* the parsed body.
*/
SIPBody* body;
MimeBody* body;
protected:
bool parse(const char* buf, int len);

View File

@ -368,14 +368,14 @@ private:
SIPMessage* createDlgMsg(const char* method, const char* uri = 0);
bool emitPRACK(const SIPMessage* msg);
bool dispatchRtp(NetMedia* media, const char* addr, bool start, bool pick);
SDPBody* createSDP(const char* addr = 0, ObjList* mediaList = 0);
SDPBody* createProvisionalSDP(Message& msg);
SDPBody* createPasstroughSDP(Message& msg, bool update = true);
SDPBody* createRtpSDP(const char* addr, const Message& msg);
SDPBody* createRtpSDP(bool start = false);
MimeSdpBody* createSDP(const char* addr = 0, ObjList* mediaList = 0);
MimeSdpBody* createProvisionalSDP(Message& msg);
MimeSdpBody* createPasstroughSDP(Message& msg, bool update = true);
MimeSdpBody* createRtpSDP(const char* addr, const Message& msg);
MimeSdpBody* createRtpSDP(bool start = false);
bool startRtp();
bool addSdpParams(Message& msg, const SIPBody* body);
bool addRtpParams(Message& msg, const String& natAddr, const SIPBody* body);
bool addSdpParams(Message& msg, const MimeBody* body);
bool addRtpParams(Message& msg, const String& natAddr, const MimeBody* body);
bool startClientReInvite(Message& msg);
bool initUnattendedTransfer(Message*& msg, SIPMessage*& sipNotify, const SIPMessage* sipRefer, const SIPHeaderLine* refHdr);
@ -505,7 +505,7 @@ static int s_expires_def = EXPIRES_DEF;
static int s_expires_max = EXPIRES_MAX;
// Parse a SDP and return a possibly filtered list of SDP media
static ObjList* parseSDP(const SDPBody* sdp, String& addr, ObjList* oldMedia = 0, const char* media = 0)
static ObjList* parseSDP(const MimeSdpBody* sdp, String& addr, ObjList* oldMedia = 0, const char* media = 0)
{
const NamedString* c = sdp->getLine("c");
if (c) {
@ -1635,7 +1635,7 @@ void YateSIPRefer::run()
ok = route();
// Send response
String s(ok ? "SIP/2.0 200 OK\r\n" : "SIP/2.0 603 Declined\r\n");
m_sipNotify->setBody(new SIPStringBody("message/sipfrag;version=2.0",s));
m_sipNotify->setBody(new MimeStringBody("message/sipfrag;version=2.0",s));
plugin.ep()->engine()->addMessage(m_sipNotify);
// Notify termination to transferor
plugin.lock();
@ -1768,7 +1768,7 @@ YateSIPConnection::YateSIPConnection(SIPEvent* ev, SIPTransaction* tr)
m->addParam("device",ev->getMessage()->getHeaderValue("User-Agent"));
copySipHeaders(*m,*ev->getMessage());
if (ev->getMessage()->body && ev->getMessage()->body->isSDP()) {
setMedia(parseSDP(static_cast<SDPBody*>(ev->getMessage()->body),m_rtpAddr,m_rtpMedia));
setMedia(parseSDP(static_cast<MimeSdpBody*>(ev->getMessage()->body),m_rtpAddr,m_rtpMedia));
if (m_rtpMedia) {
m_rtpForward = true;
// guess if the call comes from behind a NAT
@ -1897,7 +1897,7 @@ YateSIPConnection::YateSIPConnection(Message& msg, const String& uri, const char
m->addHeader(hl);
}
SDPBody* sdp = createPasstroughSDP(msg);
MimeSdpBody* sdp = createPasstroughSDP(msg);
if (!sdp)
sdp = createRtpSDP(m_host,msg);
m->setBody(sdp);
@ -2128,7 +2128,7 @@ bool YateSIPConnection::emitPRACK(const SIPMessage* msg)
}
// Creates a SDP for provisional (1xx) messages
SDPBody* YateSIPConnection::createProvisionalSDP(Message& msg)
MimeSdpBody* YateSIPConnection::createProvisionalSDP(Message& msg)
{
if (m_rtpForward)
return createPasstroughSDP(msg);
@ -2141,7 +2141,7 @@ SDPBody* YateSIPConnection::createProvisionalSDP(Message& msg)
}
// Creates a SDP from RTP address data present in message
SDPBody* YateSIPConnection::createPasstroughSDP(Message& msg, bool update)
MimeSdpBody* YateSIPConnection::createPasstroughSDP(Message& msg, bool update)
{
String tmp = msg.getValue("rtp_forward");
msg.clearParam("rtp_forward");
@ -2152,7 +2152,7 @@ SDPBody* YateSIPConnection::createPasstroughSDP(Message& msg, bool update)
m_sdpForward = m_sdpForward || s_forward_sdp;
if (m_sdpForward) {
msg.setParam("rtp_forward","accepted");
return new SDPBody("application/sdp",raw->safe(),raw->length());
return new MimeSdpBody("application/sdp",raw->safe(),raw->length());
}
}
String addr(msg.getValue("rtp_addr"));
@ -2206,7 +2206,7 @@ SDPBody* YateSIPConnection::createPasstroughSDP(Message& msg, bool update)
if (!lst)
return 0;
SDPBody* sdp = createSDP(addr,lst);
MimeSdpBody* sdp = createSDP(addr,lst);
if (update) {
m_rtpLocalAddr = addr;
setMedia(lst);
@ -2264,7 +2264,7 @@ bool YateSIPConnection::dispatchRtp(NetMedia* media, const char* addr, bool star
}
// Creates a set of unstarted external RTP channels from remote addr and builds SDP from them
SDPBody* YateSIPConnection::createRtpSDP(const char* addr, const Message& msg)
MimeSdpBody* YateSIPConnection::createRtpSDP(const char* addr, const Message& msg)
{
bool defaults = true;
@ -2330,7 +2330,7 @@ SDPBody* YateSIPConnection::createRtpSDP(const char* addr, const Message& msg)
}
// Creates a set of started external RTP channels from remote addr and builds SDP from them
SDPBody* YateSIPConnection::createRtpSDP(bool start)
MimeSdpBody* YateSIPConnection::createRtpSDP(bool start)
{
if (m_rtpAddr.null()) {
m_mediaStatus = MediaMuted;
@ -2363,7 +2363,7 @@ bool YateSIPConnection::startRtp()
}
// Creates a SDP body from transport address and list of media descriptors
SDPBody* YateSIPConnection::createSDP(const char* addr, ObjList* mediaList)
MimeSdpBody* YateSIPConnection::createSDP(const char* addr, ObjList* mediaList)
{
DDebug(this,DebugAll,"YateSIPConnection::createSDP('%s',%p) [%p]",
addr,mediaList,this);
@ -2383,7 +2383,7 @@ SDPBody* YateSIPConnection::createSDP(const char* addr, ObjList* mediaList)
String conn;
conn << "IN IP4 " << (addr ? addr : "0.0.0.0");
SDPBody* sdp = new SDPBody;
MimeSdpBody* sdp = new MimeSdpBody;
sdp->addLine("v","0");
sdp->addLine("o",origin);
sdp->addLine("s","SIP Call");
@ -2471,7 +2471,7 @@ SDPBody* YateSIPConnection::createSDP(const char* addr, ObjList* mediaList)
}
// Add raw SDP forwarding parameter to a message
bool YateSIPConnection::addSdpParams(Message& msg, const SIPBody* body)
bool YateSIPConnection::addSdpParams(Message& msg, const MimeBody* body)
{
if (m_sdpForward && body && body->isSDP()) {
const DataBlock& raw = body->getBody();
@ -2484,7 +2484,7 @@ bool YateSIPConnection::addSdpParams(Message& msg, const SIPBody* body)
}
// Add RTP forwarding parameters to a message
bool YateSIPConnection::addRtpParams(Message& msg, const String& natAddr, const SIPBody* body)
bool YateSIPConnection::addRtpParams(Message& msg, const String& natAddr, const MimeBody* body)
{
if (!(m_rtpMedia && m_rtpAddr))
return false;
@ -2552,7 +2552,7 @@ bool YateSIPConnection::process(SIPEvent* ev)
String natAddr;
if (msg->body && msg->body->isSDP()) {
DDebug(this,DebugInfo,"YateSIPConnection got SDP [%p]",this);
setMedia(parseSDP(static_cast<SDPBody*>(msg->body),m_rtpAddr,m_rtpMedia));
setMedia(parseSDP(static_cast<MimeSdpBody*>(msg->body),m_rtpAddr,m_rtpMedia));
// guess if the call comes from behind a NAT
if (s_auto_nat && isNatBetween(m_rtpAddr,m_host)) {
Debug(this,DebugInfo,"RTP NAT detected: private '%s' public '%s'",
@ -2666,7 +2666,7 @@ bool YateSIPConnection::processTransaction2(SIPEvent* ev, const SIPMessage* msg,
if (code < 300) {
while (msg->body && msg->body->isSDP()) {
String addr;
ObjList* lst = parseSDP(static_cast<SDPBody*>(msg->body),addr);
ObjList* lst = parseSDP(static_cast<MimeSdpBody*>(msg->body),addr);
if (!lst)
break;
if ((addr == m_rtpAddr) || isNatBetween(addr,m_host)) {
@ -2711,7 +2711,7 @@ bool YateSIPConnection::processTransaction2(SIPEvent* ev, const SIPMessage* msg,
String natAddr;
if (msg->body && msg->body->isSDP()) {
DDebug(this,DebugInfo,"YateSIPConnection got reINVITE SDP [%p]",this);
setMedia(parseSDP(static_cast<SDPBody*>(msg->body),m_rtpAddr,m_rtpMedia));
setMedia(parseSDP(static_cast<MimeSdpBody*>(msg->body),m_rtpAddr,m_rtpMedia));
// guess if the call comes from behind a NAT
if (s_auto_nat && isNatBetween(m_rtpAddr,m_host)) {
Debug(this,DebugInfo,"RTP NAT detected: private '%s' public '%s'",
@ -2757,7 +2757,7 @@ void YateSIPConnection::reInvite(SIPTransaction* t)
if (m_rtpForward) {
String addr;
String natAddr;
ObjList* lst = parseSDP(static_cast<SDPBody*>(t->initialMessage()->body),addr);
ObjList* lst = parseSDP(static_cast<MimeSdpBody*>(t->initialMessage()->body),addr);
if (!lst)
break;
// guess if the call comes from behind a NAT
@ -2798,7 +2798,7 @@ void YateSIPConnection::reInvite(SIPTransaction* t)
if (m_mediaStatus == MediaMissing)
break;
String addr;
ObjList* lst = parseSDP(static_cast<SDPBody*>(t->initialMessage()->body),addr);
ObjList* lst = parseSDP(static_cast<MimeSdpBody*>(t->initialMessage()->body),addr);
if (!lst)
break;
// guess if the call comes from behind a NAT
@ -2822,7 +2822,7 @@ void YateSIPConnection::reInvite(SIPTransaction* t)
clearEndpoint();
SIPMessage* m = new SIPMessage(t->initialMessage(), 200);
SDPBody* sdp = createRtpSDP(true);
MimeSdpBody* sdp = createRtpSDP(true);
m->setBody(sdp);
t->setResponse(m);
m->deref();
@ -2894,8 +2894,8 @@ void YateSIPConnection::doInfo(SIPTransaction* t)
return;
DDebug(this,DebugAll,"YateSIPConnection::doInfo(%p) [%p]",t,this);
int sig = -1;
const SIPLinesBody* lb = YOBJECT(SIPLinesBody,t->initialMessage()->body);
const SIPStringBody* sb = YOBJECT(SIPStringBody,t->initialMessage()->body);
const MimeLinesBody* lb = YOBJECT(MimeLinesBody,t->initialMessage()->body);
const MimeStringBody* sb = YOBJECT(MimeStringBody,t->initialMessage()->body);
if (lb && (lb->getType() == "application/dtmf-relay")) {
const ObjList* l = lb->lines().skipNull();
for (; l; l = l->skipNext()) {
@ -3019,7 +3019,7 @@ bool YateSIPConnection::msgAnswered(Message& msg)
Lock lock(driver());
if (m_tr && (m_tr->getState() == SIPTransaction::Process)) {
SIPMessage* m = new SIPMessage(m_tr->initialMessage(), 200);
SDPBody* sdp = createPasstroughSDP(msg);
MimeSdpBody* sdp = createPasstroughSDP(msg);
if (!sdp) {
m_rtpForward = false;
// normally don't start RTP yet, only when we get the ACK
@ -3071,7 +3071,7 @@ bool YateSIPConnection::msgTone(Message& msg, const char* tone)
if (m) {
String tmp;
tmp << "Signal=" << i << "\r\n";
m->setBody(new SIPStringBody("application/dtmf-relay",tmp));
m->setBody(new MimeStringBody("application/dtmf-relay",tmp));
plugin.ep()->engine()->addMessage(m);
m->deref();
}
@ -3100,7 +3100,7 @@ bool YateSIPConnection::msgText(Message& msg, const char* text)
return false;
SIPMessage* m = createDlgMsg("MESSAGE");
if (m) {
m->setBody(new SIPStringBody("text/plain",text));
m->setBody(new MimeStringBody("text/plain",text));
plugin.ep()->engine()->addMessage(m);
m->deref();
return true;
@ -3154,7 +3154,7 @@ bool YateSIPConnection::msgUpdate(Message& msg)
if (*oper == "notify") {
bool rtpSave = m_rtpForward;
m_rtpForward = msg.getBoolValue("rtp_forward",m_rtpForward);
SDPBody* sdp = createPasstroughSDP(msg);
MimeSdpBody* sdp = createPasstroughSDP(msg);
if (!sdp) {
m_rtpForward = rtpSave;
m_tr2->setResponse(500,"Server failed to build the SDP");
@ -3291,7 +3291,7 @@ bool YateSIPConnection::startClientReInvite(Message& msg)
// this is the point of no return
if (hadRtp)
clearEndpoint();
SDPBody* sdp = createPasstroughSDP(msg,false);
MimeSdpBody* sdp = createPasstroughSDP(msg,false);
if (!sdp) {
msg.setParam("error","failure");
msg.setParam("reason","Could not build the SDP");
@ -3794,7 +3794,7 @@ bool SipHandler::received(Message &msg)
const char* type = msg.getValue("xsip_type");
const char* body = msg.getValue("xsip_body");
if (type && body)
sip->setBody(new SIPStringBody(type,body,-1));
sip->setBody(new MimeStringBody(type,body,-1));
sip->complete(plugin.ep()->engine(),msg.getValue("user"),msg.getValue("domain"));
if (!msg.getBoolValue("wait")) {
// no answer requested - start transaction and forget