Commit 46bc39b4 authored by Emmanuel Milou's avatar Emmanuel Milou

Merge branch 'master' of...

Merge branch 'master' of git+ssh://repos-sflphone-git@git.sflphone.org/var/repos/sflphone/git/sflphone
parents c3c6b8f0 63e5e7cb
......@@ -607,7 +607,7 @@ namespace sfl {
}
else {
// _debug("RTP: Received an RTP event with payload: %d", adu->getType());
ost::RTPPacket::RFC2833Payload *dtmf = (ost::RTPPacket::RFC2833Payload *)adu->getData();
// ost::RTPPacket::RFC2833Payload *dtmf = (ost::RTPPacket::RFC2833Payload *)adu->getData();
// _debug("RTP: Data received %d", dtmf->event);
}
......
......@@ -39,9 +39,14 @@ namespace sfl
AudioSrtpSession::AudioSrtpSession (ManagerImpl * manager, SIPCall * sipcall) :
ost::SymmetricRTPSession (ost::InetHostAddress (sipcall->getLocalIp().c_str()), sipcall->getLocalAudioPort()),
_localCryptoSuite(0),
_remoteCryptoSuite(0),
AudioRtpSession<AudioSrtpSession> (manager, sipcall)
AudioRtpSession<AudioSrtpSession> (manager, sipcall),
_localCryptoSuite(0),
_remoteCryptoSuite(0),
_localMasterKeyLength(0),
_localMasterSaltLength(0),
_remoteMasterKeyLength(0),
_remoteMasterSaltLength(0)
{
// Initialize local Crypto context
......
......@@ -69,57 +69,57 @@ namespace sfl {
AudioSrtpSession(ManagerImpl * manager, SIPCall * sipcall);
std::vector<std::string> getLocalCryptoInfo(void);
std::vector<std::string> getLocalCryptoInfo(void);
void setRemoteCryptoInfo(sfl::SdesNegotiator& nego);
void setRemoteCryptoInfo(sfl::SdesNegotiator& nego);
private:
void initializeLocalMasterKey(void);
void initializeLocalMasterSalt(void);
void initializeLocalMasterSalt(void);
void initializeRemoteCryptoContext(void);
void initializeRemoteCryptoContext(void);
void initializeLocalCryptoContext(void);
void initializeLocalCryptoContext(void);
std::string getBase64ConcatenatedKeys();
std::string getBase64ConcatenatedKeys();
void unBase64ConcatenatedKeys(std::string base64keys);
void unBase64ConcatenatedKeys(std::string base64keys);
char* encodeBase64(unsigned char *input, int length);
char* encodeBase64(unsigned char *input, int length);
char* decodeBase64(unsigned char *input, int length, int *length_out);
char* decodeBase64(unsigned char *input, int length, int *length_out);
/** Default local crypto suite is AES_CM_128_HMAC_SHA1_80*/
int _localCryptoSuite;
/** Default local crypto suite is AES_CM_128_HMAC_SHA1_80*/
int _localCryptoSuite;
/** Remote crypto suite is initialized at AES_CM_128_HMAC_SHA1_80*/
int _remoteCryptoSuite;
/** Remote crypto suite is initialized at AES_CM_128_HMAC_SHA1_80*/
int _remoteCryptoSuite;
uint8 _localMasterKey[16];
/** local master key length in byte */
int _localMasterKeyLength;
/** local master key length in byte */
int _localMasterKeyLength;
uint8 _localMasterSalt[14];
uint8 _localMasterSalt[14];
/** local master salt length in byte */
int _localMasterSaltLength;
/** local master salt length in byte */
int _localMasterSaltLength;
uint8 _remoteMasterKey[16];
uint8 _remoteMasterKey[16];
/** remote master key length in byte */
int _remoteMasterKeyLength;
/** remote master key length in byte */
int _remoteMasterKeyLength;
uint8 _remoteMasterSalt[14];
uint8 _remoteMasterSalt[14];
/** remote master salt length in byte */
int _remoteMasterSaltLength;
/** remote master salt length in byte */
int _remoteMasterSaltLength;
ost::CryptoContext* _remoteCryptoCtx;
ost::CryptoContext* _remoteCryptoCtx;
ost::CryptoContext* _localCryptoCtx;
ost::CryptoContext* _localCryptoCtx;
};
}
......
......@@ -198,7 +198,7 @@ AudioStream::createStream (pa_context* c)
attributes->minreq = (uint32_t) -1;
pa_threaded_mainloop_lock(_mainloop);
pa_stream_connect_playback (s , NULL , attributes, (pa_stream_flags_t)(PA_STREAM_ADJUST_LATENCY|PA_STREAM_AUTO_TIMING_UPDATE), &_volume, NULL);
pa_stream_connect_playback (s , NULL , attributes, (pa_stream_flags_t)(PA_STREAM_ADJUST_LATENCY|PA_STREAM_AUTO_TIMING_UPDATE), NULL, NULL);
pa_threaded_mainloop_unlock(_mainloop);
} else if (_streamType == CAPTURE_STREAM) {
......
......@@ -469,7 +469,7 @@ void PulseLayer::writeToSpeaker (void)
out = (SFLDataFormat*) pa_xmalloc (writeableSize);
int copied = tone->getNext (out, writeableSize / sizeof (SFLDataFormat), 100);
int returnValue = pa_stream_write (playback->pulseStream(), out, copied * sizeof (SFLDataFormat), NULL, 0, PA_SEEK_RELATIVE);
pa_stream_write (playback->pulseStream(), out, copied * sizeof (SFLDataFormat), NULL, 0, PA_SEEK_RELATIVE);
pa_xfree (out);
......
......@@ -821,7 +821,7 @@ std::map<std::string, int32_t> ConfigurationManager::getShortcuts() {
std::map<std::string, int> shortcutsMap;
int shortcut;
for (int i = 0; i < shortcutsKeys.size(); i++) {
for (int i = 0; i < (int)shortcutsKeys.size(); i++) {
std::string key = shortcutsKeys.at(i);
shortcut = Manager::instance().getConfigInt("Shortcuts", key);
shortcutsMap.insert(std::pair<std::string, int>(key, shortcut));
......@@ -836,7 +836,7 @@ void ConfigurationManager::setShortcuts(
std::map<std::string, int> map_cpy = shortcutsMap;
std::map<std::string, int>::iterator it;
for (int i = 0; i < shortcutsKeys.size(); i++) {
for (int i = 0; i < (int)shortcutsKeys.size(); i++) {
std::string key = shortcutsKeys.at(i);
it = map_cpy.find(key);
if (it != shortcutsMap.end()) {
......
......@@ -3520,7 +3520,7 @@ mod_on_rx_request (pjsip_rx_data *rdata)
}
_debug ("UserAgent: The receiver is: %s@%s", userName.data(), server.data());
_debug ("UserAgent: The callee account id is %s", account_id.c_str());
_debug ("UserAgent: The callee account is %s", account_id.c_str());
/* Now, it is the time to find the information of the caller */
uri = rdata->msg_info.from->uri;
......@@ -3534,6 +3534,13 @@ mod_on_rx_request (pjsip_rx_data *rdata)
std::string peerNumber (tmp, length);
//Remove sip: prefix
size_t found = peerNumber.find("sip:");
if (found!=std::string::npos)
peerNumber.erase(found, found+4);
_debug("UserAgent: Peer number: %s", peerNumber.c_str());
// Get the server voicemail notification
// Catch the NOTIFY message
if (rdata->msg_info.msg->line.req.method.id == PJSIP_OTHER_METHOD) {
......@@ -3662,6 +3669,8 @@ mod_on_rx_request (pjsip_rx_data *rdata)
call->setDisplayName (displayName);
call->initRecFileName();
_debug("UserAgent: DisplayName: %s", displayName.c_str());
// Have to do some stuff with the SDP
// Set the codec map, IP, peer number and so on... for the SIPCall object
......@@ -3704,7 +3713,6 @@ mod_on_rx_request (pjsip_rx_data *rdata)
// Explicitly set the transport, set_transport methods increment transport's reference counter
status = pjsip_dlg_set_transport (dialog, tp);
PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1);
// Associate the call in the invite session
......@@ -3713,11 +3721,9 @@ mod_on_rx_request (pjsip_rx_data *rdata)
// Send a 180 Ringing response
_info ("UserAgent: Send a 180 Ringing response");
status = pjsip_inv_initial_answer (inv, rdata, PJSIP_SC_RINGING, NULL, NULL, &tdata);
PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1);
status = pjsip_inv_send_msg (inv, tdata);
PJ_ASSERT_RETURN (status == PJ_SUCCESS, 1);
// Associate invite session to the current call
......
......@@ -97,7 +97,7 @@ class SflPhoneTests():
def test_ip2ip_send_hangup(self):
"""Make a call to a server (sipp) on port 5062"""
i = 0
while(i < 200):
while(i < 500):
callid = self.sflphone.Call("sip:test@" + REMOTEADDR_lo)
time.sleep(0.5)
......@@ -313,7 +313,7 @@ sflphone.setFirstRegisteredAccount();
# Test 1: - Send an IP2IP call
# - Hangup
testsuite.test_ip2ip_send_hangup()
# testsuite.test_ip2ip_send_hangup()
# Test 2: - Send an IP2IP call
# - Peer Hangup
......@@ -321,7 +321,7 @@ testsuite.test_ip2ip_send_hangup()
# Test 3: - Receive an IP2IP call
# - Hangup
# testsuite.test_ip2ip_recv_hangup()
testsuite.test_ip2ip_recv_hangup()
# Test 4: - Receive an IP2IP call
# - Peer Hangup
......
......@@ -2,6 +2,8 @@
#
# Copyright (C) 2009 by the Free Software Foundation, Inc.
#
# Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com>
#
# 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
......@@ -201,7 +203,8 @@ class SflPhoneCtrlSimple(Thread):
except KeyError, e:
print "This call didn't exist!: " + callid + ". Adding it to the list."
callDetails = self.getCallDetails(callid)
self.activeCalls[callid] = {'Account': callDetails['ACCOUNTID'], 'To': callDetails['PEER_NUMBER'], 'State': state }
self.activeCalls[callid] = {'Account': callDetails['ACCOUNTID'],
'To': callDetails['PEER_NUMBER'], 'State': state }
elif state in [ "BUSY", "FAILURE" ]:
try:
del self.activeCalls[callid]
......@@ -537,7 +540,9 @@ class SflPhoneCtrlSimple(Thread):
def Refuse(self, callid):
"""Refuse an incoming call identified by a CallID"""
print "Refuse call " + callid
# if not self.account:
# self.setFirstRegisteredAccount()
......@@ -608,6 +613,7 @@ class SflPhoneCtrlSimple(Thread):
return callid
def run(self):
"""Processing method for this thread"""
gobject.threads_init()
# self.loop.run()
context = self.loop.get_context()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment