Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions libs/yiax/yateiax.h
Original file line number Diff line number Diff line change
Expand Up @@ -2101,6 +2101,24 @@ class YIAX_API IAXTransaction : public RefObject, public Mutex
inline bool sendProgress()
{ return sendConnected(IAXFullFrame::Proceeding); }

/**
* Send a KEYRADIO frame to remote peer
* This method is thread safe
* @return False if the current transaction state is not Connected
*/

inline bool sendKeyRadio()
{ return sendConnected(IAXFullFrame::KeyRadio); }

/**
* Send a UNKEYRADIO frame to remote peer
* This method is thread safe
* @return False if the current transaction state is not Connected
*/

inline bool sendUnkeyRadio()
{ return sendConnected(IAXFullFrame::UnkeyRadio); }

/**
* Send an ACCEPT/REGACK frame to remote peer
* This method is thread safe
Expand Down
22 changes: 22 additions & 0 deletions modules/yiaxchan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,8 @@ class YIAXConnection : public Channel
virtual bool msgAnswered(Message& msg);
virtual bool msgTone(Message& msg, const char* tone);
virtual bool msgText(Message& msg, const char* text);
virtual bool keyRadio();
virtual bool unkeyRadio();
virtual void disconnected(bool final, const char* reason);
bool disconnect(const char* reason = 0);
inline IAXTransaction* transaction() const
Expand Down Expand Up @@ -2648,6 +2650,26 @@ bool YIAXConnection::msgText(Message& msg, const char* text)
return false;
}

bool YIAXConnection::keyRadio()
{
Lock lock(&m_mutexTrans);
if (m_transaction) {
m_transaction->sendKeyRadio();
return true;
}
return false;
}

bool YIAXConnection::unkeyRadio()
{
Lock lock(&m_mutexTrans);
if (m_transaction) {
m_transaction->sendUnkeyRadio();
return true;
}
return false;
}

void YIAXConnection::disconnected(bool final, const char* reason)
{
DDebug(this,DebugAll,"Disconnected. Final: %s . Reason: '%s' [%p]",
Expand Down