Skip to content
Snippets Groups Projects
Commit 1b36722c authored by Rafaël Carré's avatar Rafaël Carré
Browse files

IAXVoIPLink::getAccountPtr : simplify

parent 139f3642
No related branches found
No related tags found
No related merge requests found
...@@ -427,7 +427,7 @@ IAXVoIPLink::sendRegister (std::string id UNUSED) throw(VoipLinkException) ...@@ -427,7 +427,7 @@ IAXVoIPLink::sendRegister (std::string id UNUSED) throw(VoipLinkException)
{ {
_debug ("IAX: Sending registration"); _debug ("IAX: Sending registration");
IAXAccount *account = dynamic_cast<IAXAccount *> (getAccountPtr()); IAXAccount *account = getAccountPtr();
if (!account) { if (!account) {
throw VoipLinkException("Account is NULL in send register"); throw VoipLinkException("Account is NULL in send register");
...@@ -473,7 +473,7 @@ IAXVoIPLink::sendUnregister (std::string id UNUSED) throw(VoipLinkException) ...@@ -473,7 +473,7 @@ IAXVoIPLink::sendUnregister (std::string id UNUSED) throw(VoipLinkException)
{ {
_debug ("IAXVoipLink: Send unregister"); _debug ("IAXVoipLink: Send unregister");
IAXAccount *account = dynamic_cast<IAXAccount*> (getAccountPtr()); IAXAccount *account = getAccountPtr();
if (!account) { if (!account) {
throw VoipLinkException("Account is NULL in send unregister"); throw VoipLinkException("Account is NULL in send unregister");
...@@ -759,7 +759,7 @@ IAXVoIPLink::iaxOutgoingInvite (IAXCall* call) ...@@ -759,7 +759,7 @@ IAXVoIPLink::iaxOutgoingInvite (IAXCall* call)
call->setSession (newsession); call->setSession (newsession);
account = dynamic_cast<IAXAccount*> (getAccountPtr()); account = getAccountPtr();
username = account->getUsername(); username = account->getUsername();
strNum = username + ":" + account->getPassword() + "@" + account->getHostname() + "/" + call->getPeerNumber(); strNum = username + ":" + account->getPassword() + "@" + account->getHostname() + "/" + call->getPeerNumber();
...@@ -1248,7 +1248,7 @@ void IAXVoIPLink::updateAudiolayer (void) ...@@ -1248,7 +1248,7 @@ void IAXVoIPLink::updateAudiolayer (void)
_mutexIAX.leaveMutex(); _mutexIAX.leaveMutex();
} }
Account* IAXVoIPLink::getAccountPtr (void) IAXAccount* IAXVoIPLink::getAccountPtr (void)
{ {
return Manager::instance().getAccount (_accountID); return dynamic_cast<IAXAccount *> (Manager::instance().getAccount (_accountID));
} }
...@@ -48,6 +48,8 @@ class IAXCall; ...@@ -48,6 +48,8 @@ class IAXCall;
class AudioCodec; class AudioCodec;
class AudioLayer; class AudioLayer;
class IAXAccount;
/** /**
* @file iaxvoiplink.h * @file iaxvoiplink.h
* @brief VoIPLink contains a thread that listen to external events * @brief VoIPLink contains a thread that listen to external events
...@@ -218,7 +220,7 @@ class IAXVoIPLink : public VoIPLink ...@@ -218,7 +220,7 @@ class IAXVoIPLink : public VoIPLink
private: private:
Account* getAccountPtr (void); IAXAccount* getAccountPtr (void);
/* /*
* Decode the message count IAX send. * Decode the message count IAX send.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment