diff --git a/sflphone-common/src/iax/iaxvoiplink.cpp b/sflphone-common/src/iax/iaxvoiplink.cpp index 373bf29a99afacc0f96f9ac292e9a73c3745364a..934ea17de5ef681517d818d33aa13a44da65175e 100644 --- a/sflphone-common/src/iax/iaxvoiplink.cpp +++ b/sflphone-common/src/iax/iaxvoiplink.cpp @@ -630,11 +630,19 @@ IAXVoIPLink::carryingDTMFdigits (const CallID& id, char code) std::string IAXVoIPLink::getCurrentCodecName() { - IAXCall *call = getIAXCall (Manager::instance().getCurrentCallId()); + IAXCall *call = NULL; + AudioCodec *ac = NULL; + std::string name = ""; - AudioCodec *ac = call->getCodecMap().getCodec (call->getAudioCodec()); + call = getIAXCall (Manager::instance().getCurrentCallId()); - return ac->getCodecName(); + if(call) + ac = call->getCodecMap().getCodec (call->getAudioCodec()); + + if(ac) + name = ac->getCodecName(); + + return name; }