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
Branches
Tags
No related merge requests found
......@@ -427,7 +427,7 @@ IAXVoIPLink::sendRegister (std::string id UNUSED) throw(VoipLinkException)
{
_debug ("IAX: Sending registration");
IAXAccount *account = dynamic_cast<IAXAccount *> (getAccountPtr());
IAXAccount *account = getAccountPtr();
if (!account) {
throw VoipLinkException("Account is NULL in send register");
......@@ -473,7 +473,7 @@ IAXVoIPLink::sendUnregister (std::string id UNUSED) throw(VoipLinkException)
{
_debug ("IAXVoipLink: Send unregister");
IAXAccount *account = dynamic_cast<IAXAccount*> (getAccountPtr());
IAXAccount *account = getAccountPtr();
if (!account) {
throw VoipLinkException("Account is NULL in send unregister");
......@@ -759,7 +759,7 @@ IAXVoIPLink::iaxOutgoingInvite (IAXCall* call)
call->setSession (newsession);
account = dynamic_cast<IAXAccount*> (getAccountPtr());
account = getAccountPtr();
username = account->getUsername();
strNum = username + ":" + account->getPassword() + "@" + account->getHostname() + "/" + call->getPeerNumber();
......@@ -1248,7 +1248,7 @@ void IAXVoIPLink::updateAudiolayer (void)
_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;
class AudioCodec;
class AudioLayer;
class IAXAccount;
/**
* @file iaxvoiplink.h
* @brief VoIPLink contains a thread that listen to external events
......@@ -218,7 +220,7 @@ class IAXVoIPLink : public VoIPLink
private:
Account* getAccountPtr (void);
IAXAccount* getAccountPtr (void);
/*
* 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