Update the fax reason in phase B too, we may never reach phase E.

Added separate reason variable, simplified complete() code.


git-svn-id: http://yate.null.ro/svn/yate/trunk@4408 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2011-05-25 18:25:46 +00:00
parent a289194c67
commit 9906a5da8e
1 changed files with 11 additions and 10 deletions

View File

@ -202,6 +202,7 @@ private:
void updateInfo(t30_state_t* t30, const char* reason = 0);
String m_localId;
String m_remoteId;
String m_reason;
Type m_type;
int m_t38version;
bool m_sender;
@ -408,14 +409,17 @@ void FaxWrapper::phaseB(int result)
// Called after transferring a page
void FaxWrapper::phaseD(int result)
{
const char* err = t30_completion_code_to_str(result);
Debug(this,DebugInfo,"Phase D code 0x%X: %s [%p]",
result,t30_completion_code_to_str(result),this);
result,err,this);
lock();
if (T30_ERR_OK != result)
m_error = err;
m_new = true;
unlock();
FaxChan* chan = YOBJECT(FaxChan,m_chan);
if (chan)
chan->updateInfo(t30());
chan->updateInfo(t30(),m_error);
}
// Called to report end of transfer
@ -616,15 +620,12 @@ void FaxChan::complete(Message& msg, bool minimal) const
Channel::complete(msg,minimal);
if (minimal)
return;
if (m_localId)
msg.addParam("faxident_local",m_localId);
if (m_remoteId)
msg.addParam("faxident_remote",m_remoteId);
msg.addParam("reason",m_reason,false);
msg.addParam("faxident_local",m_localId,false);
msg.addParam("faxident_remote",m_remoteId,false);
if (m_pages)
msg.addParam("faxpages",String(m_pages));
const char* type = lookup(m_type,s_types);
if (type)
msg.addParam("faxtype",type);
msg.addParam("faxtype",lookup(m_type,s_types),false);
msg.addParam("faxecm",String::boolText(m_ecm));
msg.addParam("faxcaller",String::boolText(m_caller));
}
@ -754,7 +755,7 @@ void FaxChan::setParams(Message& msg, Type type, int t38version)
void FaxChan::updateInfo(t30_state_t* t30, const char* reason)
{
if (reason)
parameters().setParam("reason",reason);
m_reason = reason;
const char* ident = t30_get_rx_ident(t30);
if (!null(ident))
m_remoteId = ident;