Skip to content
Snippets Groups Projects
Commit 89132674 authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#2926] Code cleanup

parent 4fe39b5a
No related branches found
No related tags found
No related merge requests found
...@@ -607,7 +607,7 @@ namespace sfl { ...@@ -607,7 +607,7 @@ namespace sfl {
} }
else { else {
// _debug("RTP: Received an RTP event with payload: %d", adu->getType()); // _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); // _debug("RTP: Data received %d", dtmf->event);
} }
......
...@@ -39,9 +39,14 @@ namespace sfl ...@@ -39,9 +39,14 @@ namespace sfl
AudioSrtpSession::AudioSrtpSession (ManagerImpl * manager, SIPCall * sipcall) : AudioSrtpSession::AudioSrtpSession (ManagerImpl * manager, SIPCall * sipcall) :
ost::SymmetricRTPSession (ost::InetHostAddress (sipcall->getLocalIp().c_str()), sipcall->getLocalAudioPort()), ost::SymmetricRTPSession (ost::InetHostAddress (sipcall->getLocalIp().c_str()), sipcall->getLocalAudioPort()),
AudioRtpSession<AudioSrtpSession> (manager, sipcall),
_localCryptoSuite(0), _localCryptoSuite(0),
_remoteCryptoSuite(0), _remoteCryptoSuite(0),
AudioRtpSession<AudioSrtpSession> (manager, sipcall) _localMasterKeyLength(0),
_localMasterSaltLength(0),
_remoteMasterKeyLength(0),
_remoteMasterSaltLength(0)
{ {
// Initialize local Crypto context // Initialize local Crypto context
......
...@@ -469,7 +469,7 @@ void PulseLayer::writeToSpeaker (void) ...@@ -469,7 +469,7 @@ void PulseLayer::writeToSpeaker (void)
out = (SFLDataFormat*) pa_xmalloc (writeableSize); out = (SFLDataFormat*) pa_xmalloc (writeableSize);
int copied = tone->getNext (out, writeableSize / sizeof (SFLDataFormat), 100); 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); pa_xfree (out);
......
...@@ -821,7 +821,7 @@ std::map<std::string, int32_t> ConfigurationManager::getShortcuts() { ...@@ -821,7 +821,7 @@ std::map<std::string, int32_t> ConfigurationManager::getShortcuts() {
std::map<std::string, int> shortcutsMap; std::map<std::string, int> shortcutsMap;
int shortcut; 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); std::string key = shortcutsKeys.at(i);
shortcut = Manager::instance().getConfigInt("Shortcuts", key); shortcut = Manager::instance().getConfigInt("Shortcuts", key);
shortcutsMap.insert(std::pair<std::string, int>(key, shortcut)); shortcutsMap.insert(std::pair<std::string, int>(key, shortcut));
...@@ -836,7 +836,7 @@ void ConfigurationManager::setShortcuts( ...@@ -836,7 +836,7 @@ void ConfigurationManager::setShortcuts(
std::map<std::string, int> map_cpy = shortcutsMap; std::map<std::string, int> map_cpy = shortcutsMap;
std::map<std::string, int>::iterator it; 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); std::string key = shortcutsKeys.at(i);
it = map_cpy.find(key); it = map_cpy.find(key);
if (it != shortcutsMap.end()) { if (it != shortcutsMap.end()) {
......
...@@ -97,7 +97,7 @@ class SflPhoneTests(): ...@@ -97,7 +97,7 @@ class SflPhoneTests():
def test_ip2ip_send_hangup(self): def test_ip2ip_send_hangup(self):
"""Make a call to a server (sipp) on port 5062""" """Make a call to a server (sipp) on port 5062"""
i = 0 i = 0
while(i < 200): while(i < 500):
callid = self.sflphone.Call("sip:test@" + REMOTEADDR_lo) callid = self.sflphone.Call("sip:test@" + REMOTEADDR_lo)
time.sleep(0.5) time.sleep(0.5)
...@@ -313,7 +313,7 @@ sflphone.setFirstRegisteredAccount(); ...@@ -313,7 +313,7 @@ sflphone.setFirstRegisteredAccount();
# Test 1: - Send an IP2IP call # Test 1: - Send an IP2IP call
# - Hangup # - Hangup
testsuite.test_ip2ip_send_hangup() # testsuite.test_ip2ip_send_hangup()
# Test 2: - Send an IP2IP call # Test 2: - Send an IP2IP call
# - Peer Hangup # - Peer Hangup
...@@ -321,7 +321,7 @@ testsuite.test_ip2ip_send_hangup() ...@@ -321,7 +321,7 @@ testsuite.test_ip2ip_send_hangup()
# Test 3: - Receive an IP2IP call # Test 3: - Receive an IP2IP call
# - Hangup # - Hangup
# testsuite.test_ip2ip_recv_hangup() testsuite.test_ip2ip_recv_hangup()
# Test 4: - Receive an IP2IP call # Test 4: - Receive an IP2IP call
# - Peer Hangup # - Peer Hangup
......
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
# #
# Copyright (C) 2009 by the Free Software Foundation, Inc. # 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 # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License # modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2 # as published by the Free Software Foundation; either version 2
...@@ -201,7 +203,8 @@ class SflPhoneCtrlSimple(Thread): ...@@ -201,7 +203,8 @@ class SflPhoneCtrlSimple(Thread):
except KeyError, e: except KeyError, e:
print "This call didn't exist!: " + callid + ". Adding it to the list." print "This call didn't exist!: " + callid + ". Adding it to the list."
callDetails = self.getCallDetails(callid) 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" ]: elif state in [ "BUSY", "FAILURE" ]:
try: try:
del self.activeCalls[callid] del self.activeCalls[callid]
...@@ -537,7 +540,9 @@ class SflPhoneCtrlSimple(Thread): ...@@ -537,7 +540,9 @@ class SflPhoneCtrlSimple(Thread):
def Refuse(self, callid): def Refuse(self, callid):
"""Refuse an incoming call identified by a CallID""" """Refuse an incoming call identified by a CallID"""
print "Refuse call " + callid print "Refuse call " + callid
# if not self.account: # if not self.account:
# self.setFirstRegisteredAccount() # self.setFirstRegisteredAccount()
...@@ -608,6 +613,7 @@ class SflPhoneCtrlSimple(Thread): ...@@ -608,6 +613,7 @@ class SflPhoneCtrlSimple(Thread):
return callid return callid
def run(self): def run(self):
"""Processing method for this thread"""
gobject.threads_init() gobject.threads_init()
# self.loop.run() # self.loop.run()
context = self.loop.get_context() context = self.loop.get_context()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment