~ubuntu-branches/ubuntu/utopic/sipwitch/utopic

« back to all changes in this revision

Viewing changes to server/messages.cpp

  • Committer: Package Import Robot
  • Author(s): Jonas Smedegaard
  • Date: 2012-06-25 16:55:59 UTC
  • Revision ID: package-import@ubuntu.com-20120625165559-3g3z1w6qxysi9t08
* New upstream release.

* Update upstream source URL.
* Extend copyright coverage of packaging.
* Add Vcs-* URLs to control file.
* Unfuzz patch 1001.

Show diffs side-by-side

added added

removed removed

Lines of Context:
90
90
        key = sp->getId();
91
91
        value = sp->getPointer();
92
92
        if(key && value) {
93
 
            if(!stricmp(key, "keysize") && !is_configured())
 
93
            if(!stricmp(key, "keysize") && !isConfigured())
94
94
                keysize = atoi(value);
95
95
            else if(!stricmp(key, "expires"))
96
96
                duration = atoi(value) * 60;
98
98
        sp.next();
99
99
    }
100
100
 
101
 
    if(is_configured())
 
101
    if(isConfigured())
102
102
        return;
103
103
 
104
104
    msgs = new LinkedObject*[keysize];
216
216
    osip_message_t *im = NULL;
217
217
    int error = SIP_BAD_REQUEST;
218
218
 
219
 
    EXOSIP_LOCK
220
 
    eXosip_message_build_request(OPTION_CONTEXT &im, "MESSAGE", to, msg->from, NULL);
 
219
    eXosip_lock();
 
220
    eXosip_message_build_request(&im, "MESSAGE", to, msg->from, NULL);
221
221
    if(im && digest) {
222
222
        char *authbuf = new char[1024];
223
223
        stringbuf<64> response;
255
255
        osip_message_set_body(im, msg->body, msg->msglen);
256
256
        osip_message_set_content_type(im, msg->type);
257
257
        stack::siplog(im);
258
 
        if(!eXosip_message_send_request(OPTION_CONTEXT im))
 
258
        if(!eXosip_message_send_request(im))
259
259
            error = SIP_OK;
260
260
    }
261
 
    EXOSIP_UNLOCK
 
261
    eXosip_unlock();
262
262
    return error;
263
263
}
264
264
 
290
290
            stack::sipAddress(&tp->address, to + 1, msg->user, sizeof(to) - 6);
291
291
            to[0] = '<';
292
292
            String::add(to, sizeof(to), ";lr>");
293
 
            EXOSIP_LOCK
 
293
            eXosip_lock();
294
294
            im = NULL;
295
 
            eXosip_message_build_request(OPTION_CONTEXT &im, "MESSAGE", tp->contact, msg->from, to);
 
295
            eXosip_message_build_request(&im, "MESSAGE", tp->contact, msg->from, to);
296
296
            if(im != NULL) {
297
297
                stack::sipAddress(&tp->address, to + 1, msg->user, sizeof(to) - 2);
298
298
                to[0] = '<';
305
305
                osip_message_set_body(im, msg->body, msg->msglen);
306
306
                osip_message_set_content_type(im, msg->type);
307
307
                stack::siplog(im);
308
 
                if(!eXosip_message_send_request(OPTION_CONTEXT im))
 
308
                if(!eXosip_message_send_request(im))
309
309
                    ++msgcount;
310
310
            }
311
 
            EXOSIP_UNLOCK
 
311
            eXosip_unlock();
312
312
        }
313
313
        tp.next();
314
314
    }