Skip to content
Snippets Groups Projects
Commit f20261ba authored by yanmorin's avatar yanmorin
Browse files

Bad hack for incoming call...
parent aa709ec5
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
TEMPLATE = app TEMPLATE = app
TARGET += TARGET +=
DEPENDPATH += . DEPENDPATH += .
INCLUDEPATH += . INCLUDEPATH += /usr/lib/qt4/include/Qt/
QT += network QT += network
#CONFIG += debug #CONFIG += debug
......
...@@ -37,7 +37,7 @@ RequestFactory::create(const std::string& requestLine) ...@@ -37,7 +37,7 @@ RequestFactory::create(const std::string& requestLine)
iter = tList.begin(); iter = tList.begin();
// there is atleast a second token (the sequenceId) // 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; std::string sequenceId = *iter;
tList.pop_front(); tList.pop_front();
try { try {
......
...@@ -556,6 +556,22 @@ SipVoIPLink::getEvent (void) ...@@ -556,6 +556,22 @@ SipVoIPLink::getEvent (void)
switch (event->type) { switch (event->type) {
// IP-Phone user receives a new call // IP-Phone user receives a new call
case EXOSIP_CALL_INVITE: // 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 // Set local random port for incoming call
if (!Manager::instance().useStun()) { if (!Manager::instance().useStun()) {
setLocalPort(RANDOM_LOCAL_PORT); setLocalPort(RANDOM_LOCAL_PORT);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment