* #25295: sip: update published address for STUN

This commit is contained in:
Tristan Matthews
2013-06-12 14:05:39 -04:00
parent cd4d4488e4
commit 20c74f99df
2 changed files with 7 additions and 1 deletions

View File

@ -439,6 +439,11 @@ class SIPAccount : public Account {
return publishedIpAddress_;
}
void setPublishedAddress(const std::string &ip_addr) {
publishedIpAddress_ = ip_addr;
}
std::string getServiceRoute() const {
return serviceRoute_;
}

View File

@ -189,7 +189,7 @@ pj_bool_t transaction_response_cb(pjsip_rx_data *rdata)
return PJ_FALSE;
}
void updateSDPFromSTUN(SIPCall &call, const SIPAccount &account, const SipTransport &transport)
void updateSDPFromSTUN(SIPCall &call, SIPAccount &account, const SipTransport &transport)
{
std::vector<long> socketDescriptors(call.getAudioRtp().getSocketDescriptors());
@ -199,6 +199,7 @@ void updateSDPFromSTUN(SIPCall &call, const SIPAccount &account, const SipTransp
// FIXME: get video sockets
stunPorts.resize(4);
account.setPublishedAddress(pj_inet_ntoa(stunPorts[0].sin_addr));
call.getLocalSDP()->updatePorts(stunPorts);
} catch (const std::runtime_error &e) {
ERROR("%s", e.what());