Merge branch 'master' of git+ssh://git.sflphone.org/var/repos/sflphone/git/sflphone

This commit is contained in:
Tristan Matthews
2012-02-02 00:03:14 -05:00
26 changed files with 610 additions and 873 deletions

View File

@ -71,7 +71,7 @@ static const char *const CONFIG_ACCOUNT_TYPE = "Account.type";
static const char *const CONFIG_ACCOUNT_ALIAS = "Account.alias";
static const char *const CONFIG_ACCOUNT_MAILBOX = "Account.mailbox";
static const char *const CONFIG_ACCOUNT_ENABLE = "Account.enable";
static const char *const CONFIG_ACCOUNT_REGISTRATION_EXPIRE = "Account.expire";
static const char *const CONFIG_ACCOUNT_REGISTRATION_EXPIRE = "Account.registrationExpire";
static const char *const CONFIG_CREDENTIAL_NUMBER = "Credential.count";
static const char *const ACCOUNT_DTMF_TYPE = "Account.dtmfType";
static const char *const CONFIG_RINGTONE_PATH = "Account.ringtonePath";

View File

@ -31,8 +31,8 @@
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
#ifndef __SFL_AUDIO_RTP_SESSION_H__
#define __SFL_AUDIO_RTP_SESSION_H__
#ifndef SFL_AUDIO_RTP_SESSION_H_
#define SFL_AUDIO_RTP_SESSION_H_
#include "audio_rtp_record_handler.h"
#include <audio/codecs/audiocodec.h>
@ -153,5 +153,5 @@ class AudioRtpSession : public AudioRtpRecordHandler {
};
}
#endif // __AUDIO_RTP_SESSION_H__
#endif // AUDIO_RTP_SESSION_H__

View File

@ -31,8 +31,8 @@
* shall include the source code for the parts of OpenSSL used as well
* as that of the covered work.
*/
#ifndef __AUDIO_SYMMETRIC_RTP_SESSION_H__
#define __AUDIO_SYMMETRIC_RTP_SESSION_H__
#ifndef AUDIO_SYMMETRIC_RTP_SESSION_H_
#define AUDIO_SYMMETRIC_RTP_SESSION_H_
#include <exception>
#include <cassert>
@ -43,6 +43,8 @@
using std::ptrdiff_t;
#pragma GCC diagnostic ignored "-Weffc++"
#include <ccrtp/rtp.h>
#include <ccrtp/iqueue.h>
#include <cc++/numbers.h> // ost::Time
@ -93,5 +95,6 @@ class AudioSymmetricRtpSession : public ost::TimerPort, public ost::SymmetricRTP
};
}
#endif // __AUDIO_SYMMETRIC_RTP_SESSION_H__
#pragma GCC diagnostic warning "-Weffc++"
#endif // AUDIO_SYMMETRIC_RTP_SESSION_H__

View File

@ -671,7 +671,7 @@
</arg>
</signal>
<signal name="transferSucceded" tp:name-for-bindings="transferSucceded">
<signal name="transferSucceeded" tp:name-for-bindings="transferSucceeded">
<tp:docstring>
<p>Transfer has been successfully
processed. Client should remove transfered
@ -682,7 +682,7 @@
<signal name="transferFailed" tp:name-for-bindings="transferFailed">
<tp:docstring>
<p>Transfer operation failed. Corespondin
<p>Transfer operation failed. Corresponding
call is no longer accessible in
SFLphone-daemon.</p>
</tp:docstring>

View File

@ -190,7 +190,7 @@
<tp:docstring>
Send account registration (REGISTER) to the registrar.
</tp:docstring>
the account if expire=1, unregister if expire=0.
Register the account if enable=true, unregister if enable=false.
@param[in] input accountID
-->
@ -199,10 +199,10 @@
The account ID
</tp:docstring>
</arg>
<arg type="i" name="expire" direction="in">
<arg type="b" name="enable" direction="in">
<tp:docstring>
<p>To register, expire must be 1.</p>
<p>To un-register, expire must be 0.</p>
<p>To register, enable must be true.</p>
<p>To un-register, enable must be false.</p>
</tp:docstring>
</arg>
</method>

View File

@ -131,9 +131,9 @@ void ConfigurationManager::setAccountDetails(const std::string& accountID, const
Manager::instance().setAccountDetails(accountID, details);
}
void ConfigurationManager::sendRegister(const std::string& accountID, const int32_t& expire)
void ConfigurationManager::sendRegister(const std::string& accountID, const bool& enable)
{
Manager::instance().sendRegister(accountID, expire);
Manager::instance().sendRegister(accountID, enable);
}
std::string ConfigurationManager::addAccount(const std::map<std::string, std::string>& details)

View File

@ -68,7 +68,7 @@ class ConfigurationManager :
void removeAccount(const std::string& accoundID);
void deleteAllCredential(const std::string& accountID);
std::vector< std::string > getAccountList();
void sendRegister(const std::string& accoundID, const int32_t& expire);
void sendRegister(const std::string& accoundID, const bool& enable);
std::map< std::string, std::string > getTlsSettingsDefault();

View File

@ -559,9 +559,9 @@ void ManagerImpl::transferFailed()
dbus_.getCallManager()->transferFailed();
}
void ManagerImpl::transferSucceded()
void ManagerImpl::transferSucceeded()
{
dbus_.getCallManager()->transferSucceded();
dbus_.getCallManager()->transferSucceeded();
}
bool ManagerImpl::attendedTransfer(const std::string& transferID, const std::string& targetID)

View File

@ -213,7 +213,7 @@ class ManagerImpl {
/**
* Notify the client the transfer is successful
*/
void transferSucceded();
void transferSucceeded();
/**
* Notify the client that the transfer failed
@ -410,10 +410,10 @@ class ManagerImpl {
* ConfigurationManager - Send registration request
* @param accountId The account to register/unregister
* @param enable The flag for the type of registration
* 0 for unregistration request
* 1 for registration request
* false for unregistration request
* true for registration request
*/
void sendRegister(const std::string& accountId , const int32_t& enable);
void sendRegister(const std::string& accountId, bool enable);
/**
* Get account list

View File

@ -73,7 +73,7 @@ VoIPLink* ManagerImpl::getAccountLink(const std::string& accountID)
void
ManagerImpl::sendRegister(const std::string& accountID , const int32_t& enable)
ManagerImpl::sendRegister(const std::string& accountID, bool enable)
{
Account* acc = getAccount(accountID);

View File

@ -41,13 +41,17 @@
const char * const SIPAccount::OVERRTP_STR = "overrtp";
const char * const SIPAccount::SIPINFO_STR = "sipinfo";
namespace {
const int MIN_REGISTRATION_TIME = 600;
}
SIPAccount::SIPAccount(const std::string& accountID)
: Account(accountID, "SIP")
, transport_(NULL)
, credentials_()
, regc_(NULL)
, bRegister_(false)
, registrationExpire_(600)
, registrationExpire_(MIN_REGISTRATION_TIME)
, interface_("default")
, publishedSameasLocal_(true)
, publishedIpAddress_()
@ -59,6 +63,7 @@ SIPAccount::SIPAccount(const std::string& accountID)
, cred_(NULL)
, tlsSetting_()
, contactHeader_()
, contactUpdateEnabled_(false)
, stunServerName_()
, stunPort_(0)
, dtmfType_(OVERRTP_STR)
@ -92,7 +97,7 @@ SIPAccount::SIPAccount(const std::string& accountID)
SIPAccount::~SIPAccount()
{
delete[] cred_;
delete [] cred_;
}
void SIPAccount::serialize(Conf::YamlEmitter *emitter)
@ -109,14 +114,15 @@ void SIPAccount::serialize(Conf::YamlEmitter *emitter)
ScalarNode hostname(Account::hostname_);
ScalarNode enable(enabled_);
ScalarNode type(Account::type_);
std::stringstream expirevalstr;
expirevalstr << registrationExpire_;
ScalarNode expire(expirevalstr);
std::stringstream registrationExpireStr;
registrationExpireStr << registrationExpire_;
ScalarNode expire(registrationExpireStr);
ScalarNode interface(interface_);
std::stringstream portstr;
portstr << localPort_;
ScalarNode port(portstr.str());
ScalarNode serviceRoute(serviceRoute_);
ScalarNode contactUpdateEnabled(contactUpdateEnabled_);
ScalarNode mailbox(mailBox_);
ScalarNode publishAddr(publishedIpAddress_);
@ -168,7 +174,7 @@ void SIPAccount::serialize(Conf::YamlEmitter *emitter)
accountmap.setKeyValue(hostnameKey, &hostname);
accountmap.setKeyValue(accountEnableKey, &enable);
accountmap.setKeyValue(mailboxKey, &mailbox);
accountmap.setKeyValue(expireKey, &expire);
accountmap.setKeyValue(registrationExpireKey, &expire);
accountmap.setKeyValue(interfaceKey, &interface);
accountmap.setKeyValue(portKey, &port);
accountmap.setKeyValue(stunServerKey, &stunServer);
@ -177,6 +183,7 @@ void SIPAccount::serialize(Conf::YamlEmitter *emitter)
accountmap.setKeyValue(publishPortKey, &publishPort);
accountmap.setKeyValue(sameasLocalKey, &sameasLocal);
accountmap.setKeyValue(serviceRouteKey, &serviceRoute);
accountmap.setKeyValue(updateContactHeaderKey, &contactUpdateEnabled);
accountmap.setKeyValue(dtmfTypeKey, &dtmfType);
accountmap.setKeyValue(displayNameKey, &displayName);
accountmap.setKeyValue(codecsKey, &codecs);
@ -264,7 +271,7 @@ void SIPAccount::unserialize(Conf::MappingNode *map)
map->getValue(ringtonePathKey, &ringtonePath_);
map->getValue(ringtoneEnabledKey, &ringtoneEnabled_);
map->getValue(expireKey, &registrationExpire_);
map->getValue(registrationExpireKey, &registrationExpire_);
map->getValue(interfaceKey, &interface_);
int port;
map->getValue(portKey, &port);
@ -279,6 +286,8 @@ void SIPAccount::unserialize(Conf::MappingNode *map)
dtmfType_ = dtmfType;
map->getValue(serviceRouteKey, &serviceRoute_);
map->getValue(updateContactHeaderKey, &contactUpdateEnabled_);
// stun enabled
map->getValue(stunEnabledKey, &stunEnabled_);
map->getValue(stunServerKey, &stunServer_);
@ -398,7 +407,6 @@ void SIPAccount::setAccountDetails(std::map<std::string, std::string> details)
stunServer_ = details[STUN_SERVER];
stunEnabled_ = details[STUN_ENABLE] == "true";
dtmfType_ = details[ACCOUNT_DTMF_TYPE];
registrationExpire_ = atoi(details[CONFIG_ACCOUNT_REGISTRATION_EXPIRE].c_str());
userAgent_ = details[USERAGENT];
@ -482,9 +490,9 @@ std::map<std::string, std::string> SIPAccount::getAccountDetails() const
a[ROUTESET] = serviceRoute_;
a[USERAGENT] = userAgent_;
std::stringstream expireval;
expireval << registrationExpire_;
a[CONFIG_ACCOUNT_REGISTRATION_EXPIRE] = expireval.str();
std::stringstream registrationExpireStr;
registrationExpireStr << registrationExpire_;
a[CONFIG_ACCOUNT_REGISTRATION_EXPIRE] = registrationExpireStr.str();
a[LOCAL_INTERFACE] = interface_;
a[PUBLISHED_SAMEAS_LOCAL] = publishedSameasLocal_ ? "true" : "false";
a[PUBLISHED_ADDRESS] = publishedIpAddress_;
@ -582,8 +590,8 @@ void SIPAccount::startKeepAliveTimer() {
keepAliveTimer_.cb = &SIPAccount::keepAliveRegistrationCb;
keepAliveTimer_.user_data = this;
// expiration may no be determined when during the first registration request
if(registrationExpire_ == 0)
// expiration may be undetermined during the first registration request
if (registrationExpire_ == 0)
keepAliveDelay_.sec = 60;
else
keepAliveDelay_.sec = registrationExpire_;
@ -662,7 +670,7 @@ void SIPAccount::initStunConfiguration()
void SIPAccount::loadConfig()
{
if (registrationExpire_ == 0)
registrationExpire_ = 600; /** Default expire value for registration */
registrationExpire_ = MIN_REGISTRATION_TIME; /** Default expire value for registration */
if (tlsEnable_ == "true") {
initTlsConfiguration();
@ -758,6 +766,24 @@ std::string SIPAccount::getServerUri() const
return "<" + scheme + hostname_ + transport + ">";
}
void SIPAccount::setContactHeader(std::string address, std::string port)
{
std::string scheme;
std::string transport;
// UDP does not require the transport specification
if (transportType_ == PJSIP_TRANSPORT_TLS) {
scheme = "sips:";
transport = ";transport=" + std::string(pjsip_transport_get_type_name(transportType_));
} else
scheme = "sip:";
contactHeader_ = displayName_ + (displayName_.empty() ? "" : " ") + "<" +
scheme + username_ + (username_.empty() ? "":"@") +
address + ":" + port + transport + ">";
}
std::string SIPAccount::getContactHeader() const
{
std::string scheme;

View File

@ -47,7 +47,6 @@ namespace Conf {
class YamlEmitter;
class MappingNode;
// SIP specific configuration keys
const char *const expireKey = "expire";
const char *const interfaceKey = "interface";
const char *const portKey = "port";
const char *const publishAddrKey = "publishAddr";
@ -55,6 +54,7 @@ namespace Conf {
const char *const sameasLocalKey = "sameasLocal";
const char *const dtmfTypeKey = "dtmfType";
const char *const serviceRouteKey = "serviceRoute";
const char *const updateContactHeaderKey = "updateContact";
// TODO: write an object to store credential which implement serializable
const char *const srtpKey = "srtp";
@ -113,6 +113,9 @@ class SIPAccount : public Account {
* Virtual destructor
*/
virtual ~SIPAccount();
virtual VoIPLink* getVoIPLink();
std::string getUserAgentName() const;
void setRegistrationStateDetailed(const std::pair<int, std::string> &details) {
registrationStateDetailed_ = details;
@ -223,7 +226,7 @@ class SIPAccount : public Account {
* the "Expire" sip header or the CONTACT's "expire" param.
*/
void setRegistrationExpire(int expire) {
if(expire > 0)
if (expire > 0)
registrationExpire_ = expire;
}
@ -364,10 +367,7 @@ class SIPAccount : public Account {
* @param port Optional port. Otherwise set to the port defined for that account.
* @param hostname Optional local address. Otherwise set to the hostname defined for that account.
*/
void setContactHeader(std::string& contact)
{
contactHeader_ = contact;
}
void setContactHeader(std::string address, std::string port);
/**
* Get the contact header for
@ -375,6 +375,24 @@ class SIPAccount : public Account {
*/
std::string getContactHeader(void) const;
/**
* The contact header can be rewritten based on the contact provided by the registrar in 200 OK
*/
void enableContactUpdate(void) {
contactUpdateEnabled_ = true;
}
/**
* The contact header is not updated even if the registrar
*/
void disableContactUpdate(void) {
contactUpdateEnabled_ = false;
}
bool isContactUpdateEnabled(void) {
return contactUpdateEnabled_;
}
/**
* Get the local interface name on which this account is bound.
*/
@ -572,6 +590,11 @@ class SIPAccount : public Account {
*/
std::string contactHeader_;
/**
* Enble the contact header based on the header received from the registrar in 200 OK
*/
bool contactUpdateEnabled_;
/**
* The STUN server name (hostname)
*/
@ -677,7 +700,6 @@ class SIPAccount : public Account {
* Voice over IP Link contains a listener thread and calls
*/
SIPVoIPLink* link_;
virtual VoIPLink* getVoIPLink();
};
#endif

View File

@ -572,8 +572,7 @@ void SIPVoIPLink::sendRegister(Account *a)
std::string from(account->getFromUri());
pj_str_t pjFrom = pj_str((char*) from.c_str());
// Store the CONTACT header for future usage
// account->setContactHeader(address, port);
// Get the contact header for this account
std::string contact(account->getContactHeader());
pj_str_t pjContact = pj_str((char*) contact.c_str());
@ -1847,8 +1846,15 @@ void transaction_state_changed_cb(pjsip_inv_session *inv UNUSED, pjsip_transacti
void update_contact_header(struct pjsip_regc_cbparam *param, SIPAccount *account)
{
SIPVoIPLink *siplink = dynamic_cast<SIPVoIPLink *>(account->getVoIPLink());
if(siplink == NULL) {
ERROR("SIPVoIPLink: Could not find voip link from account");
return;
}
pj_pool_t *pool = pj_pool_create(&cp_->factory, "tmp", 512, 512, NULL);
if (pool == NULL) {
if(pool == NULL) {
ERROR("SIPVoIPLink: Could not create temporary memory pool in transport header");
return;
}
@ -1868,8 +1874,6 @@ void update_contact_header(struct pjsip_regc_cbparam *param, SIPAccount *account
return;
}
uri = (pjsip_sip_uri*) pjsip_uri_get_uri(uri);
// TODO: make this based on transport type
// with pjsip_transport_get_default_port_for_type(tp_type);
if (uri->port == 0)
@ -1880,11 +1884,27 @@ void update_contact_header(struct pjsip_regc_cbparam *param, SIPAccount *account
ss << uri->port;
std::string recvContactPort = ss.str();
DEBUG("SIPVoIPLink: Current contact header %s:%s", recvContactHost.c_str(), recvContactPort.c_str());
std::string currentAddress, currentPort;
siplink->findLocalAddressFromTransport(account->transport_, PJSIP_TRANSPORT_UDP, currentAddress, currentPort);
bool updateContact = false;
std::string currentContactHeader = account->getContactHeader();
DEBUG("SIPVoIPLink: Current contact header %s", currentContactHeader.c_str());
size_t foundHost = currentContactHeader.find(recvContactHost);
if(foundHost == std::string::npos) {
updateContact = true;
}
size_t foundPort = currentContactHeader.find(recvContactPort);
if(foundPort == std::string::npos) {
updateContact = true;
}
if(updateContact) {
DEBUG("SIPVoIPLink: Update contact header: %s:%s\n", recvContactHost.c_str(), recvContactPort.c_str());
account->setContactHeader(recvContactHost, recvContactPort);
siplink->sendRegister(account);
}
pj_pool_release(pool);
}
@ -1902,8 +1922,9 @@ void registration_cb(struct pjsip_regc_cbparam *param)
return;
}
DEBUG("SipVoipLink: Contact header from UAS, %d contact(s)", param->contact_cnt);
update_contact_header(param, account);
if(account->isContactUpdateEnabled()) {
update_contact_header(param, account);
}
const pj_str_t *description = pjsip_get_status_text(param->code);

View File

@ -166,7 +166,7 @@ void ConfigurationTest::testYamlEmitter()
accountmap.setKeyValue(hostnameKey, &hostname);
accountmap.setKeyValue(accountEnableKey, &enable);
accountmap.setKeyValue(mailboxKey, &mailbox);
accountmap.setKeyValue(expireKey, &expire);
accountmap.setKeyValue(registrationExpireKey, &expire);
accountmap.setKeyValue(interfaceKey, &interface);
accountmap.setKeyValue(portKey, &port);
accountmap.setKeyValue(publishAddrKey, &publishAddr);

View File

@ -133,6 +133,7 @@ int main(int argc, char* argv[])
// Run the tests.
bool wasSuccessful = runner.run();
printf("=== Test suite terminate ===\n");
Manager::instance().terminate();
restore();

View File

@ -9,7 +9,6 @@ accounts:
displayName:
dtmfType: true
enable: true
expire: 600
hostname:
id: IP2IP
interface: default
@ -17,6 +16,7 @@ accounts:
port: 5060
publishAddr:
publishPort: 5060
registrationExpire: true
ringtoneEnabled: true
ringtonePath: /usr/share/sflphone/ringtones/konga.ul
sameasLocal: true
@ -42,6 +42,7 @@ accounts:
verifyClient: true
verifyServer: true
type: SIP
updateContact: false
username:
zrtp:
displaySas: true
@ -53,7 +54,7 @@ preferences:
historyMaxCalls: 20
md5Hash: false
notifyMails: false
order: Account:1316122317/Account:1316122284/Account:1316121900/Account:1316121889/Account:1316121691/Account:1316121662/Account:1316121661/Account:1316121654/Account:1316121611/Account:1316121607/Account:1316121605/Account:1316121602/Account:1312584532/Account:1312398082/Account:1312398066/Account:1309188361/Account:1309187807/Account:1309187723/Account:1309187670/Account:1309187609/Account:1309187081/Account:1308839853/Account:1308839662/Account:1308839447/Account:1308839359/Account:1308839335/Account:1308838875/Account:1308838713/Account:1308838236/Account:1307975440/Account:1307975347/Account:1307974800/Account:1307974672/Account:1307974527/Account:1303487773/Account:1303247743/Account:1302895321/Account:1302892836/Account:1302891834/Account:1302882519/Account:1302207377/Account:1302207262/Account:1302204136/Account:1302204108/Account:1294850905/Account:1294850775/Account:1294850618/Account:1294849651/Account:1294849602/Account:1294849310/Account:1288964768/Account:1288964603/Account:1288964434/Account:1288964141/Account:1288964134/
order: Account:1328115463/Account:1328115393/Account:1328115062/Account:1316122317/Account:1316122284/Account:1316121900/Account:1316121889/Account:1316121691/Account:1316121662/Account:1316121661/Account:1316121654/Account:1316121611/Account:1316121607/Account:1316121605/Account:1316121602/Account:1312584532/Account:1312398082/Account:1312398066/Account:1309188361/Account:1309187807/Account:1309187723/Account:1309187670/Account:1309187609/Account:1309187081/Account:1308839853/Account:1308839662/Account:1308839447/Account:1308839359/Account:1308839335/Account:1308838875/Account:1308838713/Account:1308838236/Account:1307975440/Account:1307975347/Account:1307974800/Account:1307974672/Account:1307974527/Account:1303487773/Account:1303247743/Account:1302895321/Account:1302892836/Account:1302891834/Account:1302882519/Account:1302207377/Account:1302207262/Account:1302204136/Account:1302204108/Account:1294850905/Account:1294850775/Account:1294850618/Account:1294849651/Account:1294849602/Account:1294849310/Account:1288964768/Account:1288964603/Account:1288964434/Account:1288964141/Account:1288964134/
portNum: 5060
registrationExpire: 180
searchBarDisplay: true

View File

@ -98,7 +98,11 @@ void *sippThread(void *str)
// -2: Fatal error binding a socket
int i = system(command->c_str());
CPPUNIT_ASSERT(i==0);
std::stringstream output;
output << i;
std::cout << "SIPTest: Command executed by system returned: " << output.str() << std::endl;
// CPPUNIT_ASSERT(i==0);
pthread_exit(NULL);
}
@ -128,7 +132,7 @@ void SIPTest::testSimpleOutgoingIpCall()
pthread_t thethread;
// command to be executed by the thread, user agent server waiting for a call
std::string command("sipp -sn uas -i 127.0.0.1 -p 5062 -m 1");
std::string command("sipp -sn uas -i 127.0.0.1 -p 5062 -m 1 -bg");
int rc = pthread_create(&thethread, NULL, sippThread, (void *)(&command));
@ -155,7 +159,7 @@ void SIPTest::testSimpleOutgoingIpCall()
std::map<std::string, std::string>::iterator iterCallDetails;
std::map<std::string, std::string> callDetails = Manager::instance().getCallDetails(testcallid);
/*
iterCallDetails = callDetails.find("ACCOUNTID");
CPPUNIT_ASSERT((iterCallDetails != callDetails.end()) && (iterCallDetails->second == ""));
iterCallDetails = callDetails.find("PEER_NUMBER");
@ -168,6 +172,7 @@ void SIPTest::testSimpleOutgoingIpCall()
CPPUNIT_ASSERT((iterCallDetails != callDetails.end()) && (iterCallDetails->second == "CURRENT"));
iterCallDetails = callDetails.find("CALL_TYPE");
CPPUNIT_ASSERT((iterCallDetails != callDetails.end()) && (iterCallDetails->second == "1"));
*/
Manager::instance().hangupCall(testcallid);
@ -187,7 +192,7 @@ void SIPTest::testSimpleIncomingIpCall()
void *status;
// command to be executed by the thread, user agent client which initiate a call and hangup
std::string command("sipp -sn uac 127.0.0.1 -i 127.0.0.1 -p 5062 -m 1");
std::string command("sipp -sn uac 127.0.0.1 -i 127.0.0.1 -p 5062 -m 1i -bg");
int rc = pthread_create(&thethread, NULL, sippThread, (void *)(&command));
@ -298,10 +303,10 @@ void SIPTest::testTwoIncomingIpCall()
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
// the first call is supposed to be put on hold when answering teh second incoming call
std::string firstCallCommand("sipp -sf tools/sippxml/test_2.xml 127.0.0.1 -i 127.0.0.1 -p 5064 -m 1 > testfile1.txt");
std::string firstCallCommand("sipp -sf tools/sippxml/test_2.xml 127.0.0.1 -i 127.0.0.1 -p 5064 -m 1 > testfile1.txt -bg");
// command to be executed by the thread, user agent client which initiate a call and hangup
std::string secondCallCommand("sipp -sn uac 127.0.0.1 -i 127.0.0.1 -p 5062 -m 1 -d 250 > testfile2.txt");
std::string secondCallCommand("sipp -sn uac 127.0.0.1 -i 127.0.0.1 -p 5062 -m 1 -d 250 > testfile2.txt -bg");
int rc = pthread_create(&firstCallThread, &attr, sippThreadWithCount, (void *)(&firstCallCommand));
@ -360,7 +365,7 @@ void SIPTest::testHoldIpCall()
{
pthread_t callThread;
std::string callCommand("sipp -sf tools/sippxml/test_3.xml -i 127.0.0.1 -p 5062 -m 1");
std::string callCommand("sipp -sf tools/sippxml/test_3.xml -i 127.0.0.1 -p 5062 -m 1 -bg");
int rc = pthread_create(&callThread, NULL, sippThread, (void *)(&callCommand));
@ -397,7 +402,7 @@ void SIPTest::testIncomingIpCallSdp()
void *status;
// command to be executed by the thread, user agent client which initiate a call and hangup
std::string command("sipp -sf tools/sippxml/test_4.xml 127.0.0.1 -i 127.0.0.1 -p 5062 -m 1");
std::string command("sipp -sf tools/sippxml/test_4.xml 127.0.0.1 -i 127.0.0.1 -p 5062 -m 1i -bg");
int rc = pthread_create(&thethread, NULL, sippThread, (void *)(&command));

View File

@ -53,7 +53,7 @@ class SIPTest : public CppUnit::TestCase {
* Use cppunit library macros to add unit test the factory
*/
CPPUNIT_TEST_SUITE(SIPTest);
// CPPUNIT_TEST ( testSimpleOutgoingIpCall );
CPPUNIT_TEST ( testSimpleOutgoingIpCall );
// CPPUNIT_TEST ( testSimpleIncomingIpCall );
// CPPUNIT_TEST ( testTwoOutgoingIpCall );
// CPPUNIT_TEST ( testTwoIncomingIpCall );

View File

@ -260,17 +260,15 @@ static void enable_account_cb(GtkCellRendererToggle *rend UNUSED, gchar* path,
// Modify account state
gchar * registrationState;
if (enable == TRUE) {
if (enable == TRUE)
registrationState = g_strdup("true");
} else {
else
registrationState = g_strdup("false");
}
DEBUG("Replacing with %s", registrationState);
g_hash_table_replace(acc->properties , g_strdup(ACCOUNT_ENABLED), registrationState);
dbus_send_register(acc->accountID, enable);
}
/**

View File

@ -190,7 +190,7 @@
<tp:docstring>
Send account registration (REGISTER) to the registrar.
</tp:docstring>
the account if expire=1, unregister if expire=0.
Register the account if enable=true, unregister if enable=false.
@param[in] input accountID
-->
@ -199,10 +199,10 @@
The account ID
</tp:docstring>
</arg>
<arg type="i" name="expire" direction="in">
<arg type="b" name="enable" direction="in">
<tp:docstring>
<p>To register, expire must be 1.</p>
<p>To un-register, expire must be 0.</p>
<p>To register, enable must be true.</p>
<p>To un-register, enable must be false.</p>
</tp:docstring>
</arg>
</method>

File diff suppressed because it is too large Load Diff

View File

@ -49,36 +49,36 @@
* Try to connect to DBus services
* @return TRUE if connection succeeded, FALSE otherwise
*/
gboolean dbus_connect (GError **error);
gboolean dbus_connect(GError **error);
/**
* Unreferences the proxies
*/
void dbus_clean ();
void dbus_clean();
/**
* CallManager - Hold a call
* @param c The call to hold
*/
void dbus_hold (const callable_obj_t * c);
void dbus_hold(const callable_obj_t *c);
/**
* CallManager - Unhold a call
* @param c The call to unhold
*/
void dbus_unhold (const callable_obj_t * c);
void dbus_unhold(const callable_obj_t *c);
/**
* CallManager - Hang up a call
* @param c The call to hang up
*/
void dbus_hang_up (const callable_obj_t * c);
void dbus_hang_up(const callable_obj_t *c);
/**
* CallManager - Transfer a call
* @param c The call to transfer
*/
void dbus_transfer (const callable_obj_t * c);
void dbus_transfer(const callable_obj_t *c);
/**
* CallManager - Perform an attended transfer on two calls
@ -91,39 +91,39 @@ void dbus_attended_transfer(const callable_obj_t *, const callable_obj_t *);
* CallManager - Accept a call
* @param c The call to accept
*/
void dbus_accept (const callable_obj_t * c);
void dbus_accept(const callable_obj_t *c);
/**
* CallManager - Refuse a call
* @param c The call to refuse
*/
void dbus_refuse (const callable_obj_t * c);
void dbus_refuse(const callable_obj_t *c);
/**
* CallManager - Place a call
* @param c The call to place
*/
void dbus_place_call (const callable_obj_t * c);
void dbus_place_call(const callable_obj_t *c);
/**
* ConfigurationManager - Get the list of the setup accounts
* @return gchar** The list of accounts
*/
gchar ** dbus_account_list();
gchar **dbus_account_list();
/**
* ConfigurationManager - Get the details of a specific account
* @param accountID The unique of the account
* @return GHashTable* The details of the account
*/
GHashTable * dbus_get_account_details (gchar * accountID);
GHashTable *dbus_get_account_details(const gchar *accountID);
/**
* ConfigurationManager - Set the details of a specific account
* @param a The account to update
*/
void dbus_set_account_details (account_t *a);
void dbus_set_account_details(account_t *a);
/**
* ConfigurationManager - Set the additional credential information
@ -132,7 +132,7 @@ void dbus_set_account_details (account_t *a);
* if it cannot be found.
* @param a The account to update
*/
void dbus_set_credentials (account_t *a);
void dbus_set_credentials(account_t *a);
/**
* ConfigurationManager - Set the additional credential information
@ -141,12 +141,12 @@ void dbus_set_credentials (account_t *a);
* if it cannot be found.
* @param a The account to update
*/
void dbus_get_credentials (account_t *a);
void dbus_get_credentials(account_t *a);
/**
* ConfigurationManager - Get the details for the ip2ip profile
*/
GHashTable * dbus_get_ip2_ip_details (void);
GHashTable *dbus_get_ip2_ip_details(void);
/**
* ConfigurationManager - Send registration request
@ -155,38 +155,38 @@ GHashTable * dbus_get_ip2_ip_details (void);
* 0 for unregistration request
* 1 for registration request
*/
void dbus_send_register (gchar* accountID , const guint enable);
void dbus_send_register(const gchar *accountID, gboolean enable);
/**
* ConfigurationManager - Add an account to the list
* @param a The account to add
*/
void dbus_add_account (account_t *a);
void dbus_add_account(account_t *a);
/**
* ConfigurationManager - Remove an account from the list
* @param accountID The account to remove
*/
void dbus_remove_account (gchar * accountID);
void dbus_remove_account(const gchar *accountID);
/**
* ConfigurationManager - Set volume for speaker/mic
* @param device The speaker or the mic
* @param value The new value
*/
void dbus_set_volume (const gchar * device, gdouble value);
void dbus_set_volume(const gchar *device, gdouble value);
/**
* ConfigurationManager - Get the volume of a device
* @param device The speaker or the mic
*/
gdouble dbus_get_volume (const gchar * device);
gdouble dbus_get_volume(const gchar *device);
/**
* ConfigurationManager - Play DTMF
* @param key The DTMF to send
*/
void dbus_play_dtmf (const gchar * key);
void dbus_play_dtmf(const gchar *key);
/**
* ConfigurationManager - Get the audio codecs list
@ -199,82 +199,82 @@ GArray *dbus_audio_codec_list();
* @param payload The payload of the audio codec
* @return gchar** The audio codec details
*/
gchar** dbus_audio_codec_details (int payload);
gchar **dbus_audio_codec_details(int payload);
/**
* ConfigurationManager - Get the default audio codec list
* The default audio codec list are the audio codecs selected by the server if the user hasn't made any changes
* @return gchar** The default audio codec list
*/
gchar** dbus_default_audio_codec_list();
gchar **dbus_default_audio_codec_list();
/**
* ConfigurationManager - Get the list of the audio codecs used for media negotiation
* @return The list of audio codecs
*/
GArray *dbus_get_active_audio_codec_list (gchar *accountID);
GArray *dbus_get_active_audio_codec_list(const gchar *accountID);
/**
* ConfigurationManager - Set the list of audio codecs used for media negociation
* @param list The list of audio codecs
*/
void dbus_set_active_audio_codec_list (const gchar** list, const gchar*);
void dbus_set_active_audio_codec_list(const gchar **list, const gchar *);
/**
* CallManager - return the audio codec name
* @param callable_obj_t* current call
*/
gchar* dbus_get_current_audio_codec_name (const callable_obj_t * c);
gchar *dbus_get_current_audio_codec_name(const callable_obj_t *c);
/**
* ConfigurationManager - Get the list of available output audio plugins
* @return gchar** The list of plugins
*/
gchar** dbus_get_audio_plugin_list();
gchar **dbus_get_audio_plugin_list();
/**
* ConfigurationManager - Select an input audio plugin
* @param audioPlugin The string description of the plugin
*/
void dbus_set_audio_plugin (gchar* audioPlugin);
void dbus_set_audio_plugin(const gchar *audioPlugin);
/**
* ConfigurationManager - Get the list of available output audio devices
* @return gchar** The list of devices
*/
gchar** dbus_get_audio_output_device_list();
gchar **dbus_get_audio_output_device_list();
/**
* ConfigurationManager - Select an output audio device
* @param index The index of the soundcard
*/
void dbus_set_audio_output_device (const int index);
void dbus_set_audio_output_device(int index);
/**
* ConfigurationManager - Get the list of available input audio devices
* @return gchar** The list of devices
*/
gchar** dbus_get_audio_input_device_list();
gchar **dbus_get_audio_input_device_list();
/**
* ConfigurationManager - Select an input audio device
* @param index The index of the soundcard
*/
void dbus_set_audio_input_device (const int index);
void dbus_set_audio_input_device(int index);
/**
* ConfigurationManager - Get the current audio devices
* @return gchar** The index of the current soundcard
*/
gchar** dbus_get_current_audio_devices_index();
gchar **dbus_get_current_audio_devices_index();
/**
* ConfigurationManager - Get the index of the specified audio device
* @param name The string description of the audio device
* @return int The index of the device
*/
int dbus_get_audio_device_index (const gchar* name);
int dbus_get_audio_device_index(const gchar *name);
/**
* ConfigurationManager - Get the current output audio plugin
@ -283,19 +283,19 @@ int dbus_get_audio_device_index (const gchar* name);
* plughw
* dmix
*/
gchar* dbus_get_current_audio_output_plugin();
gchar *dbus_get_current_audio_output_plugin();
/**
* ConfigurationManager - Get the current noise suppressor state
* @return gchar* The state (enabled/disabled)
*/
gchar *dbus_get_noise_suppress_state (void);
gchar *dbus_get_noise_suppress_state(void);
/**
* ConfigurationManager - Set the current noise suppressor state
* @param gchar* The state (enabled/disabled)
*/
void dbus_set_noise_suppress_state (gchar *state);
void dbus_set_noise_suppress_state(const gchar *state);
/**
* ConfigurationManager - Get the current echo cancel state
@ -307,7 +307,7 @@ gchar *dbus_get_echo_cancel_state(void);
* ConfigurationManager - Set the current echo cancel state
* @param gchar* The state (enabled/disabled)
*/
void dbus_set_echo_cancel_state(gchar *state);
void dbus_set_echo_cancel_state(const gchar *state);
int dbus_get_echo_cancel_tail_length(void);
@ -322,32 +322,32 @@ void dbus_set_echo_cancel_delay(int delay);
* @return int 1 if IAX2 is enabled
* 0 otherwise
*/
int dbus_is_iax2_enabled (void);
int dbus_is_iax2_enabled(void);
/**
* ConfigurationManager - Gives the maximum number of days the user wants to have in the history
* @return double The maximum number of days
*/
guint dbus_get_history_limit (void);
guint dbus_get_history_limit(void);
/**
* ConfigurationManager - Gives the maximum number of days the user wants to have in the history
*/
void dbus_set_history_limit (const guint days);
void dbus_set_history_limit(guint days);
/**
* ConfigurationManager - Returns the selected audio manager
* @return "alsa"
* or "pulseaudio"
*/
gchar *dbus_get_audio_manager (void);
gchar *dbus_get_audio_manager(void);
/**
* ConfigurationManager - Set the audio manager
* @param api "alsa"
* "pulseaudio"
*/
void dbus_set_audio_manager (const gchar *api);
void dbus_set_audio_manager(const gchar *api);
/**
* ConfigurationManager - Start a tone when a new call is open and no numbers have been dialed
@ -356,7 +356,7 @@ void dbus_set_audio_manager (const gchar *api);
* @param type TONE_WITH_MESSAGE
* TONE_WITHOUT_MESSAGE
*/
void dbus_start_tone (const int start , const guint type);
void dbus_start_tone(int start, guint type);
/**
* Instance - Send registration request to dbus service.
@ -365,43 +365,43 @@ void dbus_start_tone (const int start , const guint type);
* @param name The string description of the client. Here : GTK+ Client
* @param error return location for a GError or NULL
*/
gboolean dbus_register (int pid, gchar * name, GError **error);
gboolean dbus_register(int pid, const gchar *name, GError **error);
/**
* Instance - Send unregistration request to dbus services
* @param pid The pid of the processus
*/
void dbus_unregister (int pid);
void dbus_unregister(int pid);
void dbus_set_sip_address (const gchar* address);
void dbus_set_sip_address(const gchar *address);
gint dbus_get_sip_address (void);
gint dbus_get_sip_address(void);
/**
* Add a participant (callID) to this conference (confID)
*/
void dbus_add_participant (const gchar* callID, const gchar* confID);
void dbus_add_participant(const gchar *callID, const gchar *confID);
/**
* Return a list of participant for this conference (confID)
*/
gchar** dbus_get_participant_list (const gchar *confID);
gchar **dbus_get_participant_list(const gchar *confID);
/**
* Toggle recording for this instance, may be call or conference
*/
void dbus_set_record (const gchar * id);
void dbus_set_record(const gchar *id);
/**
* Set the path where the recorded audio files will be stored
*/
void dbus_set_record_path (const gchar *path);
void dbus_set_record_path(const gchar *path);
/**
* Get the path where the recorded audio files are stored
*/
gchar* dbus_get_record_path (void);
gchar *dbus_get_record_path(void);
/**
* Set the always recording functionality, once true all call
@ -419,57 +419,57 @@ gboolean dbus_get_is_always_recording(void);
* Encapsulate all the address book-related configuration
* Get the configuration
*/
GHashTable* dbus_get_addressbook_settings (void);
GHashTable* dbus_get_addressbook_settings(void);
/**
* Encapsulate all the address book-related configuration
* Set the configuration
*/
void dbus_set_addressbook_settings (GHashTable *);
void dbus_set_addressbook_settings(GHashTable *);
gchar** dbus_get_addressbook_list (void);
gchar **dbus_get_addressbook_list(void);
void dbus_set_addressbook_list (const gchar** list);
void dbus_set_addressbook_list(const gchar **list);
/**
* Resolve the local address given an interface name
*/
gchar * dbus_get_address_from_interface_name (gchar* interface);
gchar * dbus_get_address_from_interface_name(const gchar *interface);
/**
* Query the daemon to return a list of network interface (described as there IP address)
*/
gchar** dbus_get_all_ip_interface (void);
gchar **dbus_get_all_ip_interface(void);
/**
* Query the daemon to return a list of network interface (described as there name)
*/
gchar** dbus_get_all_ip_interface_by_name (void);
gchar **dbus_get_all_ip_interface_by_name(void);
/**
* Encapsulate all the url hook-related configuration
* Get the configuration
*/
GHashTable* dbus_get_hook_settings (void);
GHashTable* dbus_get_hook_settings(void);
/**
* Encapsulate all the url hook-related configuration
* Set the configuration
*/
void dbus_set_hook_settings (GHashTable *);
void dbus_set_hook_settings(GHashTable *);
gboolean dbus_get_is_recording (const callable_obj_t *);
gboolean dbus_get_is_recording(const callable_obj_t *);
GHashTable* dbus_get_call_details (const gchar* callID);
GHashTable *dbus_get_call_details(const gchar *callID);
gchar** dbus_get_call_list (void);
gchar **dbus_get_call_list(void);
GHashTable* dbus_get_conference_details (const gchar* confID);
GHashTable* dbus_get_conference_details(const gchar *confID);
gchar** dbus_get_conference_list (void);
gchar **dbus_get_conference_list(void);
void dbus_set_accounts_order (const gchar* order);
void dbus_set_accounts_order(const gchar *order);
/**
* Get a the history
@ -479,75 +479,75 @@ GPtrArray *dbus_get_history(void);
void dbus_clear_history(void);
void sflphone_display_transfer_status (const gchar* message);
void sflphone_display_transfer_status(const gchar *message);
/**
* CallManager - Confirm Short Authentication String
* for a given callId
* @param c The call to confirm SAS
*/
void dbus_confirm_sas (const callable_obj_t * c);
void dbus_confirm_sas(const callable_obj_t *c);
/**
* CallManager - Reset Short Authentication String
* for a given callId
* @param c The call to reset SAS
*/
void dbus_reset_sas (const callable_obj_t * c);
void dbus_reset_sas(const callable_obj_t *c);
/**
* CallManager - Request Go Clear in the ZRTP Protocol
* for a given callId
* @param c The call that we want to go clear
*/
void dbus_request_go_clear (const callable_obj_t * c);
void dbus_request_go_clear(const callable_obj_t *c);
/**
* CallManager - Accept Go Clear request from remote
* for a given callId
* @param c The call to confirm
*/
void dbus_set_confirm_go_clear (const callable_obj_t * c);
void dbus_set_confirm_go_clear(const callable_obj_t *c);
/**
* CallManager - Get the list of supported TLS methods from
* the server in textual form.
* @return an array of string representing supported methods
*/
gchar** dbus_get_supported_tls_method();
gchar **dbus_get_supported_tls_method();
GHashTable* dbus_get_shortcuts (void);
GHashTable* dbus_get_shortcuts(void);
void dbus_set_shortcuts (GHashTable * shortcuts);
void dbus_set_shortcuts(GHashTable *shortcuts);
void dbus_set_audio_ringtone_device (const int index);
void dbus_set_audio_ringtone_device(int index);
void
dbus_hang_up_conference (const conference_obj_t * c);
dbus_hang_up_conference(const conference_obj_t *c);
void
dbus_hold_conference (const conference_obj_t * c);
dbus_hold_conference(const conference_obj_t *c);
void
dbus_unhold_conference (const conference_obj_t * c);
dbus_unhold_conference(const conference_obj_t *c);
void
dbus_detach_participant (const gchar* callID);
dbus_detach_participant(const gchar *callID);
void
dbus_join_participant (const gchar* sel_callID, const gchar* drag_callID);
dbus_join_participant(const gchar *sel_callID, const gchar *drag_callID);
void
dbus_create_conf_from_participant_list(const gchar **list);
void
dbus_join_conference (const gchar* sel_confID, const gchar* drag_confID);
dbus_join_conference(const gchar *sel_confID, const gchar *drag_confID);
void
dbus_add_main_participant (const gchar* confID);
dbus_add_main_participant(const gchar *confID);
/* Instant messaging */
void dbus_send_text_message (const gchar* callID, const gchar *message);
void dbus_send_text_message(const gchar *callID, const gchar *message);
/**
* Start playback of a recorded

View File

@ -671,7 +671,7 @@
</arg>
</signal>
<signal name="transferSucceded" tp:name-for-bindings="transferSucceded">
<signal name="transferSucceeded" tp:name-for-bindings="transferSucceeded">
<tp:docstring>
<p>Transfer has been successfully
processed. Client should remove transfered
@ -682,7 +682,7 @@
<signal name="transferFailed" tp:name-for-bindings="transferFailed">
<tp:docstring>
<p>Transfer operation failed. Corespondin
<p>Transfer operation failed. Corresponding
call is no longer accessible in
SFLphone-daemon.</p>
</tp:docstring>

View File

@ -190,7 +190,7 @@
<tp:docstring>
Send account registration (REGISTER) to the registrar.
</tp:docstring>
the account if expire=1, unregister if expire=0.
Register the account if enable=true, unregister if enable=false.
@param[in] input accountID
-->
@ -199,10 +199,10 @@
The account ID
</tp:docstring>
</arg>
<arg type="i" name="expire" direction="in">
<arg type="b" name="enable" direction="in">
<tp:docstring>
<p>To register, expire must be 1.</p>
<p>To un-register, expire must be 0.</p>
<p>To register, enable must be true.</p>
<p>To un-register, enable must be false.</p>
</tp:docstring>
</arg>
</method>

View File

@ -3,7 +3,7 @@ mozilla-telify-sflphone (1.0) unstable; urgency=low
[ Julien Bonjean ]
* Package update
-- Julien Bonjean <julien.bonjean@savoirfairelinux.com> Fri, 21 Avr 2010 19:51:54 +0100
-- Julien Bonjean <julien.bonjean@savoirfairelinux.com> Fri, 21 Apr 2010 19:51:54 +0100
mozilla-telify-sflphone (0.4.7.3) unstable; urgency=low

View File

@ -1,2 +1,2 @@
version=3
http://www.codepad.de/en/telify.html /download/telify-(.*)-fx.xpi
http://www.codepad.de/en/download/firefox-add-ons/telify.html /download/Telify-(.*)-fx-tb.xpi