[Opalvoip-svn] SF.net SVN: opalvoip:[21246] opal/trunk
Brought to you by:
csoutheren,
rjongbloed
From: <rjo...@us...> - 2008-10-07 01:40:48
|
Revision: 21246 http://opalvoip.svn.sourceforge.net/opalvoip/?rev=21246&view=rev Author: rjongbloed Date: 2008-10-07 01:40:32 +0000 (Tue, 07 Oct 2008) Log Message: ----------- Simplified the Q/931/Q.850 call end cause code conversion functions so easier to use. Modified Paths: -------------- opal/trunk/include/h323/h323pdu.h opal/trunk/src/h323/gkclient.cxx opal/trunk/src/h323/gkserver.cxx opal/trunk/src/h323/h323.cxx opal/trunk/src/h323/h323pdu.cxx Modified: opal/trunk/include/h323/h323pdu.h =================================================================== --- opal/trunk/include/h323/h323pdu.h 2008-10-06 23:40:04 UTC (rev 21245) +++ opal/trunk/include/h323/h323pdu.h 2008-10-07 01:40:32 UTC (rev 21246) @@ -469,11 +469,11 @@ H323Connection::CallEndReason H323TranslateToCallEndReason( Q931::CauseValues cause, - const H225_ReleaseCompleteReason & reason + unsigned reason ); Q931::CauseValues H323TranslateFromCallEndReason( - const H323Connection & connection, - H225_ReleaseCompleteReason & rcReason + H323Connection::CallEndReason callEndReason, + H225_ReleaseCompleteReason & releaseCompleteReason ); void H323GetApplicationInfo(OpalProductInfo & info, const H225_VendorIdentifier & vendor); Modified: opal/trunk/src/h323/gkclient.cxx =================================================================== --- opal/trunk/src/h323/gkclient.cxx 2008-10-06 23:40:04 UTC (rev 21245) +++ opal/trunk/src/h323/gkclient.cxx 2008-10-07 01:40:32 UTC (rev 21246) @@ -1264,7 +1264,7 @@ drq.IncludeOptionalField(H225_DisengageRequest::e_terminationCause); drq.m_terminationCause.SetTag(H225_CallTerminationCause::e_releaseCompleteReason); - Q931::CauseValues cause = H323TranslateFromCallEndReason(connection, drq.m_terminationCause); + Q931::CauseValues cause = H323TranslateFromCallEndReason(connection.GetCallEndReason(), drq.m_terminationCause); if (cause != Q931::ErrorInCauseIE) { drq.m_terminationCause.SetTag(H225_CallTerminationCause::e_releaseCompleteCauseIE); PASN_OctetString & rcReason = drq.m_terminationCause; Modified: opal/trunk/src/h323/gkserver.cxx =================================================================== --- opal/trunk/src/h323/gkserver.cxx 2008-10-06 23:40:04 UTC (rev 21245) +++ opal/trunk/src/h323/gkserver.cxx 2008-10-07 01:40:32 UTC (rev 21246) @@ -1138,12 +1138,11 @@ if (info.drq.HasOptionalField(H225_DisengageRequest::e_terminationCause)) { if (info.drq.m_terminationCause.GetTag() == H225_CallTerminationCause::e_releaseCompleteReason) { H225_ReleaseCompleteReason & reason = info.drq.m_terminationCause; - callEndReason = H323TranslateToCallEndReason(Q931::ErrorInCauseIE, reason); + callEndReason = H323TranslateToCallEndReason(Q931::ErrorInCauseIE, reason.GetTag()); } else { PASN_OctetString & cause = info.drq.m_terminationCause; - H225_ReleaseCompleteReason dummy; - callEndReason = H323TranslateToCallEndReason((Q931::CauseValues)(cause[1]&0x7f), dummy); + callEndReason = H323TranslateToCallEndReason((Q931::CauseValues)(cause[1]&0x7f), UINT_MAX); } } Modified: opal/trunk/src/h323/h323.cxx =================================================================== --- opal/trunk/src/h323/h323.cxx 2008-10-06 23:40:04 UTC (rev 21245) +++ opal/trunk/src/h323/h323.cxx 2008-10-07 01:40:32 UTC (rev 21246) @@ -1650,7 +1650,7 @@ Release(EndedByRefusal); else { SetRemoteVersions(rc.m_protocolIdentifier); - Release(H323TranslateToCallEndReason(pdu.GetQ931().GetCause(), rc.m_reason)); + Release(H323TranslateToCallEndReason(pdu.GetQ931().GetCause(), rc.m_reason.GetTag())); } } } Modified: opal/trunk/src/h323/h323pdu.cxx =================================================================== --- opal/trunk/src/h323/h323pdu.cxx 2008-10-06 23:40:04 UTC (rev 21245) +++ opal/trunk/src/h323/h323pdu.cxx 2008-10-07 01:40:32 UTC (rev 21246) @@ -685,11 +685,11 @@ H323Connection::CallEndReason H323TranslateToCallEndReason(Q931::CauseValues cause, - const H225_ReleaseCompleteReason & reason) + unsigned reason) { switch (cause) { case Q931::ErrorInCauseIE : - switch (reason.GetTag()) { + switch (reason) { case H225_ReleaseCompleteReason::e_noBandwidth : return H323Connection::EndedByNoBandwidth; @@ -758,8 +758,8 @@ } -Q931::CauseValues H323TranslateFromCallEndReason(const H323Connection & connection, - H225_ReleaseCompleteReason & reason) +Q931::CauseValues H323TranslateFromCallEndReason(H323Connection::CallEndReason callEndReason, + H225_ReleaseCompleteReason & releaseCompleteReason) { static int const ReasonCodes[H323Connection::NumCallEndReasons] = { Q931::NormalCallClearing, /// EndedByLocalUser, Local endpoint application cleared call @@ -789,13 +789,13 @@ Q931::NormalUnspecified, /// EndedByDurationLimit, Call cleared due to an enforced duration limit }; - int code = ReasonCodes[connection.GetCallEndReason()]; + int code = ReasonCodes[callEndReason]; if (code == Q931::UnknownCauseIE) - return (Q931::CauseValues)connection.GetCallEndReason(); + return (Q931::CauseValues)callEndReason; if (code >= 0) return (Q931::CauseValues)code; - reason.SetTag(-code); + releaseCompleteReason.SetTag(-code); return Q931::ErrorInCauseIE; } @@ -814,7 +814,7 @@ Q931::CauseValues cause = (Q931::CauseValues)connection.GetQ931Cause(); if (cause == Q931::ErrorInCauseIE) - cause = H323TranslateFromCallEndReason(connection, release.m_reason); + cause = H323TranslateFromCallEndReason(connection.GetCallEndReason(), release.m_reason); if (cause != Q931::ErrorInCauseIE) q931pdu.SetCause(cause); else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |