From 702b84452098fc16f9e8d2159b37eaa3ed85fd98 Mon Sep 17 00:00:00 2001
From: yanmorin <yanmorin>
Date: Wed, 5 Oct 2005 21:51:58 +0000
Subject: [PATCH] Call/SipCall pointer to enable jerome to compile

---
 src/config/config.cpp |  2 +-
 src/sipvoiplink.cpp   | 13 +++++++------
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/src/config/config.cpp b/src/config/config.cpp
index 77e4d0f182..8a52ab83d5 100644
--- a/src/config/config.cpp
+++ b/src/config/config.cpp
@@ -64,7 +64,7 @@ ConfigTree::addConfigTreeItem(const std::string& section, const ConfigTreeItem i
     iter = _sections.find(section);
   }
   // be prudent here
-  if (iter!=NULL && iter != _sections.end()) {
+  if (iter != NULL && iter != _sections.end()) {
     std::string name = item.getName();
 
     if ( iter->second->find(name) == iter->second->end()) {
diff --git a/src/sipvoiplink.cpp b/src/sipvoiplink.cpp
index b815973c9e..fd41020e4f 100644
--- a/src/sipvoiplink.cpp
+++ b/src/sipvoiplink.cpp
@@ -550,6 +550,8 @@ SipVoIPLink::getEvent (void)
   eXosip_event_t *event;
   short id;
   char *name;
+  Call *call = NULL;
+  SipCall *sipcall = NULL;
 
   event = eXosip_event_wait (0, 50);
   eXosip_lock();
@@ -583,7 +585,7 @@ SipVoIPLink::getEvent (void)
 
     // Generate id
     id = Manager::instance().generateNewCallId();
-    Manager::instance().pushBackNewCall(id, Incoming);
+    call = Manager::instance().pushBackNewCall(id, Incoming);
     _debug("Incoming Call with id %d [cid = %d, did = %d]\n",
 	   id, event->cid, event->did);
     _debug("Local audio port: %d\n", _localPort);
@@ -592,22 +594,22 @@ SipVoIPLink::getEvent (void)
     osip_from_t *from;
     osip_from_init(&from);
 
+    sipcall = getSipCall(id);
     if (event->request != NULL) {
       char *tmp = NULL;
 
       osip_from_to_str (event->request->from, &tmp);
       if (tmp != NULL) {
-        snprintf (getSipCall(id)->getRemoteUri(), 256, "%s", tmp);
+        snprintf (sipcall->getRemoteUri(), 256, "%s", tmp);
         osip_free (tmp);
       }
     }
-    osip_from_parse(from, getSipCall(id)->getRemoteUri());
+    osip_from_parse(from, sipcall->getRemoteUri());
     name = osip_from_get_displayname(from);
 
     //Don't need this display text message now that we send the name
     //inside the Manager to the gui
     //Manager::instance().displayTextMessage(id, name);
-    Call *call = Manager::instance().getCall(id);
     if ( call != NULL) {
       call->setCallerIdName(name);
       osip_uri_t* url = osip_from_get_url(from);
@@ -622,7 +624,6 @@ SipVoIPLink::getEvent (void)
     _debug("From: %s\n", name);
     osip_from_free(from);
 
-    SipCall *sipcall = getSipCall(id);
     // Associate an audio port with a call
     sipcall->setLocalAudioPort(_localPort);
     sipcall->setLocalIp(getLocalIpAddress());
@@ -648,7 +649,7 @@ SipVoIPLink::getEvent (void)
     if (id == 0) {
       id = findCallIdInitial(event);
     }
-    SipCall *sipcall = getSipCall(id);
+    sipcall = getSipCall(id);
     if ( sipcall ) {
       _debug("Call is answered [id = %d, cid = %d, did = %d], localport=%d\n", 
 	   id, event->cid, event->did,sipcall->getLocalAudioPort());
-- 
GitLab