Bad hack for incoming call...

This commit is contained in:
yanmorin
2005-09-30 21:16:02 +00:00
parent aa709ec5cc
commit f20261ba72
3 changed files with 18 additions and 2 deletions

View File

@ -5,7 +5,7 @@
TEMPLATE = app
TARGET +=
DEPENDPATH += .
INCLUDEPATH += .
INCLUDEPATH += /usr/lib/qt4/include/Qt/
QT += network
#CONFIG += debug

View File

@ -37,7 +37,7 @@ RequestFactory::create(const std::string& requestLine)
iter = tList.begin();
// there is atleast a second token (the sequenceId)
if (iter != tList.end() && iter->find("seq") == 0 ) {
if (iter != tList.end() && iter->size() != 0 ) {
std::string sequenceId = *iter;
tList.pop_front();
try {

View File

@ -556,6 +556,22 @@ SipVoIPLink::getEvent (void)
switch (event->type) {
// IP-Phone user receives a new call
case EXOSIP_CALL_INVITE: //
// TODO: remove this hack, when there is no
// buffer overflow in event->request->bodies->body...
if (event->request!=NULL && event->request->bodies!=NULL) {
if (!osip_list_eol (event->request->bodies, 0)) {
osip_body_t* t = (osip_body_t *)osip_list_get (event->request->bodies, 0);
if (t!=NULL && t->body!=NULL) {
char *lastnewline = strrchr(t->body, '\n');
if (lastnewline != NULL ) {
lastnewline++;
if (*lastnewline != '\0') {
_debug("EXOSIP_CALL_INVITE: request error patched\n"); }
*lastnewline = '\0';
}
}
}
}
// Set local random port for incoming call
if (!Manager::instance().useStun()) {
setLocalPort(RANDOM_LOCAL_PORT);