Commit 0de55dd2 authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #8357: fixed make check

parent 80d4ae8d
......@@ -38,7 +38,7 @@ static const char * const orderKey = "order";
static const char * const audioApiKey = "audioApi";
static const char * const historyLimitKey = "historyLimit";
static const char * const historyMaxCallsKey = "historyMaxCalls";
static const char * const notifyMailsKey = "notifyMails";
static const char * const notifyMailsKey = "notifyMails";
static const char * const zoneToneChoiceKey = "zoneToneChoice";
static const char * const registrationExpireKey = "registrationExpire";
static const char * const portNumKey = "portNum";
......
......@@ -695,13 +695,14 @@ void Sdp::setMediaTransportInfoFromRemoteSdp()
remoteIpAddr_ = std::string(activeRemoteSession_->conn->addr.ptr, activeRemoteSession_->conn->addr.slen);
for (unsigned i = 0; i < activeRemoteSession_->media_count; ++i)
if (pj_stricmp2 (&activeRemoteSession_->media[i]->desc.media, "audio") == 0)
for (unsigned i = 0; i < activeRemoteSession_->media_count; ++i) {
if (pj_stricmp2(&activeRemoteSession_->media[i]->desc.media, "audio") == 0)
remoteAudioPort_ = activeRemoteSession_->media[i]->desc.port;
#ifdef SFL_VIDEO
else if (pj_stricmp2 (&activeRemoteSession_->media[i]->desc.media, "video") == 0)
else if (pj_stricmp2(&activeRemoteSession_->media[i]->desc.media, "video") == 0)
remoteVideoPort_ = activeRemoteSession_->media[i]->desc.port;
#endif
}
}
void Sdp::getRemoteSdpCryptoFromOffer(const pjmedia_sdp_session* remote_sdp, CryptoOffer& crypto_offer)
......
......@@ -183,7 +183,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);
......@@ -289,7 +289,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);
......
......@@ -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";
......@@ -223,7 +222,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;
}
......
......@@ -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);
......
......@@ -117,11 +117,11 @@ static const char *sdp_reinvite = "v=0\r\n"
#endif
;
static const char *const LOCALHOST = "localhost";
void SDPTest::setUp()
{
pj_caching_pool_init(&poolCache_, &pj_pool_factory_default_policy, 0);
testPool_ = pj_pool_create(&poolCache_.factory, "sdptest", 4000, 4000, NULL);
session_ = new Sdp(testPool_);
......@@ -134,7 +134,6 @@ void SDPTest::tearDown()
pj_pool_release(testPool_);
}
void SDPTest::testInitialOfferFirstCodec()
{
std::cout << "------------ SDPTest::testInitialOfferFirstCodec --------------" << std::endl;
......@@ -143,7 +142,6 @@ void SDPTest::testInitialOfferFirstCodec()
CPPUNIT_ASSERT(session_->getRemoteIP().empty());
std::vector<int> codecSelection;
pjmedia_sdp_session *remoteAnswer;
codecSelection.push_back(PAYLOAD_CODEC_ULAW);
codecSelection.push_back(PAYLOAD_CODEC_ALAW);
......@@ -155,7 +153,7 @@ void SDPTest::testInitialOfferFirstCodec()
videoCodecs.push_back("H263");
#endif
session_->setLocalIP("127.0.0.1");
session_->setLocalIP(LOCALHOST);
#ifdef SFL_VIDEO
session_->createOffer(codecSelection, videoCodecs);
......@@ -163,15 +161,15 @@ void SDPTest::testInitialOfferFirstCodec()
session_->createOffer(codecSelection);
#endif
// pjmedia_sdp_parse(testPool_, test[0].offer_answer[0].sdp2, strlen(test[0].offer_answer[0].sdp2), &remoteAnswer);
pjmedia_sdp_parse(testPool_, (char*)sdp_answer1, strlen(sdp_answer1), &remoteAnswer);
pjmedia_sdp_session *remoteAnswer;
pjmedia_sdp_parse(testPool_, (char*) sdp_answer1, strlen(sdp_answer1), &remoteAnswer);
session_->receivingAnswerAfterInitialOffer(remoteAnswer);
session_->startNegotiation();
session_->setMediaTransportInfoFromRemoteSdp();
CPPUNIT_ASSERT(session_->getLocalIP() == "127.0.0.1");
CPPUNIT_ASSERT(session_->getLocalIP() == LOCALHOST);
CPPUNIT_ASSERT(session_->getRemoteIP() == "host.example.com");
}
......@@ -195,9 +193,9 @@ void SDPTest::testInitialAnswerFirstCodec()
videoCodecs.push_back("H263");
#endif
pjmedia_sdp_parse(testPool_, (char*)sdp_offer1, strlen(sdp_offer1), &remoteOffer);
pjmedia_sdp_parse(testPool_, (char*) sdp_offer1, strlen(sdp_offer1), &remoteOffer);
session_->setLocalIP("127.0.0.1");
session_->setLocalIP(LOCALHOST);
#ifdef SFL_VIDEO
session_->receiveOffer(remoteOffer, codecSelection, videoCodecs);
......@@ -209,7 +207,7 @@ void SDPTest::testInitialAnswerFirstCodec()
session_->setMediaTransportInfoFromRemoteSdp();
CPPUNIT_ASSERT(session_->getLocalIP() == "127.0.0.1");
CPPUNIT_ASSERT(session_->getLocalIP() == LOCALHOST);
CPPUNIT_ASSERT(session_->getRemoteIP() == "host.example.com");
}
......@@ -232,7 +230,7 @@ void SDPTest::testInitialOfferLastCodec()
videoCodecs.push_back("H263");
#endif
session_->setLocalIP("127.0.0.1");
session_->setLocalIP(LOCALHOST);
#ifdef SFL_VIDEO
session_->createOffer(codecSelection, videoCodecs);
......@@ -248,7 +246,7 @@ void SDPTest::testInitialOfferLastCodec()
session_->setMediaTransportInfoFromRemoteSdp();
CPPUNIT_ASSERT(session_->getLocalIP() == "127.0.0.1");
CPPUNIT_ASSERT(session_->getLocalIP() == LOCALHOST);
CPPUNIT_ASSERT(session_->getRemoteIP() == "host.example.com");
}
......@@ -274,7 +272,7 @@ void SDPTest::testInitialAnswerLastCodec()
pjmedia_sdp_parse(testPool_, (char*)sdp_offer2, strlen(sdp_offer2), &remoteOffer);
session_->setLocalIP("127.0.0.1");
session_->setLocalIP(LOCALHOST);
#ifdef SFL_VIDEO
session_->receiveOffer(remoteOffer, codecSelection, videoCodecs);
......@@ -286,7 +284,7 @@ void SDPTest::testInitialAnswerLastCodec()
session_->setMediaTransportInfoFromRemoteSdp();
CPPUNIT_ASSERT(session_->getLocalIP() == "127.0.0.1");
CPPUNIT_ASSERT(session_->getLocalIP() == LOCALHOST);
CPPUNIT_ASSERT(session_->getRemoteIP() == "host.example.com");
}
......@@ -299,9 +297,6 @@ void SDPTest::testReinvite()
CPPUNIT_ASSERT(session_->getRemoteIP().empty());
std::vector<int> codecSelection;
pjmedia_sdp_session *remoteAnswer;
pjmedia_sdp_session *reinviteOffer;
codecSelection.push_back(PAYLOAD_CODEC_ULAW);
codecSelection.push_back(PAYLOAD_CODEC_ALAW);
codecSelection.push_back(PAYLOAD_CODEC_G722);
......@@ -312,7 +307,7 @@ void SDPTest::testReinvite()
videoCodecs.push_back("H263");
#endif
session_->setLocalIP("127.0.0.1");
session_->setLocalIP(LOCALHOST);
#ifdef SFL_VIDEO
session_->createOffer(codecSelection, videoCodecs);
......@@ -320,17 +315,19 @@ void SDPTest::testReinvite()
session_->createOffer(codecSelection);
#endif
pjmedia_sdp_session *remoteAnswer;
// pjmedia_sdp_parse(testPool_, test[0].offer_answer[0].sdp2, strlen(test[0].offer_answer[0].sdp2), &remoteAnswer);
pjmedia_sdp_parse(testPool_, (char*)sdp_answer1, strlen(sdp_answer1), &remoteAnswer);
pjmedia_sdp_parse(testPool_, (char*) sdp_answer1, strlen(sdp_answer1), &remoteAnswer);
session_->receivingAnswerAfterInitialOffer(remoteAnswer);
session_->startNegotiation();
session_->setMediaTransportInfoFromRemoteSdp();
CPPUNIT_ASSERT(session_->getLocalIP() == "127.0.0.1");
CPPUNIT_ASSERT(session_->getLocalIP() == LOCALHOST);
CPPUNIT_ASSERT(session_->getRemoteIP() == "host.example.com");
pjmedia_sdp_session *reinviteOffer;
pjmedia_sdp_parse(testPool_, (char*) sdp_reinvite, strlen(sdp_reinvite), &reinviteOffer);
#ifdef SFL_VIDEO
session_->receiveOffer(reinviteOffer, codecSelection, videoCodecs);
......
Supports Markdown
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