Commit ff37d557 authored by Tristan Matthews's avatar Tristan Matthews

* #9910: SIP: cleanup

parent bf28b8a9
......@@ -400,7 +400,7 @@ void SIPAccount::setAccountDetails(std::map<std::string, std::string> details)
publishedIpAddress_ = details[CONFIG_PUBLISHED_ADDRESS];
localPort_ = atoi(details[CONFIG_LOCAL_PORT].c_str());
publishedPort_ = atoi(details[CONFIG_PUBLISHED_PORT].c_str());
if(stunServer_ != details[CONFIG_STUN_SERVER]) {
if (stunServer_ != details[CONFIG_STUN_SERVER]) {
DEBUG("Stun server changed!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
link_->sipTransport.destroyStunResolver(stunServer_);
// pj_stun_sock_destroy(pj_stun_sock *stun_sock);
......
......@@ -469,7 +469,7 @@ class SIPAccount : public Account {
* @param The public IPV4 address in the standard dot notation.
* @return void
*/
void setPublishedAddress(const std::string& publishedIpAddress) {
void setPublishedAddress(const std::string &publishedIpAddress) {
publishedIpAddress_ = publishedIpAddress;
}
......@@ -497,11 +497,11 @@ class SIPAccount : public Account {
return zrtpHelloHash_;
}
void setReceivedParameter(std::string received) {
void setReceivedParameter(const std::string &received) {
receivedParameter_ = received;
}
std::string getReceivedParameter() {
std::string getReceivedParameter() const {
return receivedParameter_;
}
......
......@@ -1563,13 +1563,12 @@ void update_contact_header(pjsip_regc_cbparam *param, SIPAccount *account)
pj_pool_release(pool);
}
static void looksForReceivedParameter(pjsip_regc_cbparam *param, SIPAccount *account) {
void lookForReceivedParameter(pjsip_regc_cbparam *param, SIPAccount *account)
{
pj_str_t receivedValue = param->rdata->msg_info.via->recvd_param;
std::string publicIpFromReceived = "";
ERROR("looksForReceivedParameter");
if(receivedValue.slen) {
publicIpFromReceived = std::string(receivedValue.ptr, receivedValue.slen);
if (receivedValue.slen) {
std::string publicIpFromReceived(receivedValue.ptr, receivedValue.slen);
DEBUG("Cool received received parameter... uhhh?, the value is %s", publicIpFromReceived.c_str());
account->setReceivedParameter(publicIpFromReceived);
}
......@@ -1614,7 +1613,7 @@ void registration_cb(pjsip_regc_cbparam *param)
if (param->code < 0 || param->code >= 300) {
switch (param->code) {
case 606:
looksForReceivedParameter(param, account);
lookForReceivedParameter(param, account);
account->setRegistrationState(ErrorNotAcceptable);
break;
......
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