D:/Storage/CVS_Head/h323plus/src/h225ras.cxx

00001 /*
00002  * H225_RAS.cxx
00003  *
00004  * H.225 RAS protocol handler
00005  *
00006  * Open H323 Library
00007  *
00008  * Copyright (c) 2001 Equivalence Pty. Ltd.
00009  *
00010  * The contents of this file are subject to the Mozilla Public License
00011  * Version 1.0 (the "License"); you may not use this file except in
00012  * compliance with the License. You may obtain a copy of the License at
00013  * http://www.mozilla.org/MPL/
00014  *
00015  * Software distributed under the License is distributed on an "AS IS"
00016  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
00017  * the License for the specific language governing rights and limitations
00018  * under the License.
00019  *
00020  * The Original Code is Open H323 Library.
00021  *
00022  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
00023  *
00024  * Portions of this code were written with the assisance of funding from
00025  * iFace In, http://www.iface.com
00026  *
00027  * Contributor(s): ______________________________________.
00028  *
00029  * $Log: h225ras.cxx,v $
00030  * Revision 1.1  2007/08/06 20:51:05  shorne
00031  * First commit of h323plus
00032  *
00033  * Revision 1.60.2.3  2007/07/23 08:17:07  shorne
00034  * Expanded H.460 Support
00035  *
00036  * Revision 1.60.2.2  2007/01/30 17:28:12  shorne
00037  * Fix for compiling on linux
00038  *
00039  * Revision 1.60.2.1  2006/12/23 19:08:02  shorne
00040  * Plugin video codecs & sundry
00041  *
00042  * Revision 1.60  2006/06/23 20:19:39  shorne
00043  * More H460 support
00044  *
00045  * Revision 1.59  2006/05/30 11:14:56  hfriederich
00046  * Switch from DISABLE_H460 to H323_H460
00047  *
00048  * Revision 1.58  2005/01/03 14:03:21  csoutheren
00049  * Added new configure options and ability to disable/enable modules
00050  *
00051  * Revision 1.57  2005/01/03 06:25:55  csoutheren
00052  * Added extensive support for disabling code modules at compile time
00053  *
00054  * Revision 1.56  2004/09/07 22:50:55  rjongbloed
00055  * Changed usage of template function as MSVC6 will not compile it.
00056  *
00057  * Revision 1.55  2004/09/03 01:06:10  csoutheren
00058  * Added initial hooks for H.460 GEF
00059  * Thanks to Simon Horne and ISVO (Asia) Pte Ltd. for this contribution
00060  *
00061  * Revision 1.54  2003/04/09 03:08:10  robertj
00062  * Fixed race condition in shutting down transactor (pure virtual call)
00063  *
00064  * Revision 1.53  2003/04/01 01:05:17  robertj
00065  * Split service control handlers from H.225 RAS header.
00066  *
00067  * Revision 1.52  2003/03/26 00:46:28  robertj
00068  * Had another go at making H323Transactor being able to be created
00069  *   without having a listener running.
00070  *
00071  * Revision 1.51  2003/03/21 05:25:47  robertj
00072  * Added setting of remote port in UDP transport constructor.
00073  *
00074  * Revision 1.50  2003/03/20 01:51:11  robertj
00075  * More abstraction of H.225 RAS and H.501 protocols transaction handling.
00076  *
00077  * Revision 1.49  2003/03/01 00:21:01  craigs
00078  * Fixed spelling mistake!
00079  *
00080  * Revision 1.48  2003/02/21 05:25:45  craigs
00081  * Abstracted out underlying transports for use with peerelements
00082  *
00083  * Revision 1.47  2003/02/10 04:18:55  robertj
00084  * Made RAS read loop more robust.
00085  *
00086  * Revision 1.46  2003/02/01 13:31:21  robertj
00087  * Changes to support CAT authentication in RAS.
00088  *
00089  * Revision 1.45  2002/12/18 06:24:52  robertj
00090  * Improved logging around the RAS poll function, on timeouts etc
00091  *
00092  * Revision 1.44  2002/12/13 02:52:19  robertj
00093  * Fixed failure to release mutex on call confirm/reject.
00094  *
00095  * Revision 1.43  2002/11/28 23:39:36  robertj
00096  * Fixed race condition for if RAS reply arrives very VERY quickly after
00097  *   sending packet. Introduced in previous change.
00098  *
00099  * Revision 1.42  2002/11/28 04:41:48  robertj
00100  * Added support for RAS ServiceControlIndication command.
00101  *
00102  * Revision 1.41  2002/11/28 02:13:28  robertj
00103  * Fixed copy and paste errors.
00104  *
00105  * Revision 1.40  2002/11/28 02:10:26  robertj
00106  * Changed order of function so OnSendXXX(pdu) can change the security
00107  *   credentials in descendant classes.
00108  *
00109  * Revision 1.39  2002/11/27 06:54:56  robertj
00110  * Added Service Control Session management as per Annex K/H.323 via RAS
00111  *   only at this stage.
00112  * Added H.248 ASN and very primitive infrastructure for linking into the
00113  *   Service Control Session management system.
00114  * Added basic infrastructure for Annex K/H.323 HTTP transport system.
00115  * Added Call Credit Service Control to display account balances.
00116  *
00117  * Revision 1.38  2002/11/21 22:26:20  robertj
00118  * Changed promiscuous mode to be three way. Fixes race condition in gkserver
00119  *   which can cause crashes or more PDUs to be sent to the wrong place.
00120  *
00121  * Revision 1.37  2002/11/21 07:21:49  robertj
00122  * Improvements to alternate gatekeeper client code, thanks Kevin Bouchard
00123  *
00124  * Revision 1.36  2002/11/11 08:13:40  robertj
00125  * Fixed GNU warning
00126  *
00127  * Revision 1.35  2002/11/11 07:20:12  robertj
00128  * Minor clean up of API for doing RAS requests suing authentication.
00129  *
00130  * Revision 1.34  2002/11/10 08:10:43  robertj
00131  * Moved constants for "well known" ports to better place (OPAL change).
00132  *
00133  * Revision 1.33  2002/10/17 02:10:55  robertj
00134  * Backed out previous change for including PDU tag, doesn't work!
00135  *
00136  * Revision 1.32  2002/10/16 03:46:05  robertj
00137  * Added PDU tag to cache look up key.
00138  *
00139  * Revision 1.31  2002/10/09 05:38:50  robertj
00140  * Fixed correct mutexing of response cache buffer.
00141  * Fixed correct setting of remote address when cached response transmitted.
00142  *
00143  * Revision 1.30  2002/09/19 09:16:01  robertj
00144  * Fixed problem with making (and assuring with multi-threading) IRQ and DRQ
00145  *   requests are sent to the correct endpoint address, thanks Martijn Roest.
00146  *
00147  * Revision 1.29  2002/08/29 06:58:37  robertj
00148  * Fixed (again) cached response age timeout adjusted to RIP time.
00149  *
00150  * Revision 1.28  2002/08/12 06:29:42  robertj
00151  * Fixed problem with cached responses being aged before the RIP time which
00152  *   made retries by client appear as "new" requests when they were not.
00153  *
00154  * Revision 1.27  2002/08/12 05:35:48  robertj
00155  * Changes to the RAS subsystem to support ability to make requests to client
00156  *   from gkserver without causing bottlenecks and race conditions.
00157  *
00158  * Revision 1.26  2002/08/05 10:03:47  robertj
00159  * Cosmetic changes to normalise the usage of pragma interface/implementation.
00160  *
00161  * Revision 1.25  2002/08/05 05:17:41  robertj
00162  * Fairly major modifications to support different authentication credentials
00163  *   in ARQ to the logged in ones on RRQ. For both client and server.
00164  * Various other H.235 authentication bugs and anomalies fixed on the way.
00165  *
00166  * Revision 1.24  2002/07/29 11:36:08  robertj
00167  * Fixed race condition if RIP is followed very quickly by actual response.
00168  *
00169  * Revision 1.23  2002/07/16 04:18:38  robertj
00170  * Fixed incorrect check for GRQ in reject processing, thanks Thien Nguyen
00171  *
00172  * Revision 1.22  2002/06/28 03:34:28  robertj
00173  * Fixed issues with address translation on gatekeeper RAS channel.
00174  *
00175  * Revision 1.21  2002/06/24 00:11:21  robertj
00176  * Clarified error message during GRQ authentication.
00177  *
00178  * Revision 1.20  2002/06/12 03:50:25  robertj
00179  * Added PrintOn function for trace output of RAS channel.
00180  *
00181  * Revision 1.19  2002/05/29 00:03:19  robertj
00182  * Fixed unsolicited IRR support in gk client and server,
00183  *   including support for IACK and INAK.
00184  *
00185  * Revision 1.18  2002/05/17 03:41:00  robertj
00186  * Fixed problems with H.235 authentication on RAS for server and client.
00187  *
00188  * Revision 1.17  2002/05/03 09:18:49  robertj
00189  * Added automatic retransmission of RAS responses to retried requests.
00190  *
00191  * Revision 1.16  2002/03/10 19:34:13  robertj
00192  * Added random starting point for sequence numbers, thanks Chris Purvis
00193  *
00194  * Revision 1.15  2002/01/29 02:38:31  robertj
00195  * Fixed nasty race condition when getting RIP, end up with wrong timeout.
00196  * Improved tracing (included sequence numbers)
00197  *
00198  * Revision 1.14  2002/01/24 01:02:04  robertj
00199  * Removed trace when authenticator not used, implied error when wasn't one.
00200  *
00201  * Revision 1.13  2001/10/09 12:03:30  robertj
00202  * Fixed uninitialised variable for H.235 authentication checking.
00203  *
00204  * Revision 1.12  2001/10/09 08:04:59  robertj
00205  * Fixed unregistration so still unregisters if gk goes offline, thanks Chris Purvis
00206  *
00207  * Revision 1.11  2001/09/18 10:36:57  robertj
00208  * Allowed multiple overlapping requests in RAS channel.
00209  *
00210  * Revision 1.10  2001/09/12 07:48:05  robertj
00211  * Fixed various problems with tracing.
00212  *
00213  * Revision 1.9  2001/09/12 03:12:38  robertj
00214  * Added ability to disable the checking of RAS responses against
00215  *   security authenticators.
00216  * Fixed bug in having multiple authentications if have a retry.
00217  *
00218  * Revision 1.8  2001/08/10 11:03:52  robertj
00219  * Major changes to H.235 support in RAS to support server.
00220  *
00221  * Revision 1.7  2001/08/06 07:44:55  robertj
00222  * Fixed problems with building without SSL
00223  *
00224  * Revision 1.6  2001/08/06 03:18:38  robertj
00225  * Fission of h323.h to h323ep.h & h323con.h, h323.h now just includes files.
00226  * Improved access to H.235 secure RAS functionality.
00227  * Changes to H.323 secure RAS contexts to help use with gk server.
00228  *
00229  * Revision 1.5  2001/08/03 05:56:04  robertj
00230  * Fixed RAS read of UDP when get ICMP error for host unreachabe.
00231  *
00232  * Revision 1.4  2001/06/25 01:06:40  robertj
00233  * Fixed resolution of RAS timeout so not rounded down to second.
00234  *
00235  * Revision 1.3  2001/06/22 00:21:10  robertj
00236  * Fixed bug in H.225 RAS protocol with 16 versus 32 bit sequence numbers.
00237  *
00238  * Revision 1.2  2001/06/18 07:44:21  craigs
00239  * Made to compile with h225ras.cxx under Linux
00240  *
00241  * Revision 1.1  2001/06/18 06:23:50  robertj
00242  * Split raw H.225 RAS protocol out of gatekeeper client class.
00243  *
00244  */
00245 
00246 #include <ptlib.h>
00247 
00248 #ifdef __GNUC__
00249 #pragma implementation "h225ras.h"
00250 #endif
00251 
00252 #include "h323.h"
00253 
00254 #include "h225ras.h"
00255 
00256 #include "h323ep.h"
00257 #include "h323pdu.h"
00258 #include "h235auth.h"
00259 
00260 #ifdef H323_H460
00261 #include "h460/h460.h"
00262 #endif
00263 
00264 #define new PNEW
00265 
00266 
00268 
00269 H225_RAS::H225_RAS(H323EndPoint & ep, H323Transport * trans)
00270   : H323Transactor(ep, trans, DefaultRasUdpPort, DefaultRasUdpPort)
00271 {
00272 }
00273 
00274 
00275 H225_RAS::~H225_RAS()
00276 {
00277   StopChannel();
00278 }
00279 
00280 
00281 void H225_RAS::PrintOn(ostream & strm) const
00282 {
00283   if (gatekeeperIdentifier.IsEmpty())
00284     strm << "H225-RAS@";
00285   else
00286     strm << gatekeeperIdentifier << '@';
00287   H323Transactor::PrintOn(strm);
00288 }
00289 
00290 
00291 H323TransactionPDU * H225_RAS::CreateTransactionPDU() const
00292 {
00293   return new H323RasPDU;
00294 }
00295 
00296 
00297 BOOL H225_RAS::HandleTransaction(const PASN_Object & rawPDU)
00298 {
00299   const H323RasPDU & pdu = (const H323RasPDU &)rawPDU;
00300 
00301   switch (pdu.GetTag()) {
00302     case H225_RasMessage::e_gatekeeperRequest :
00303       if (SendCachedResponse(pdu))
00304         return FALSE;
00305       OnReceiveGatekeeperRequest(pdu, pdu);
00306       break;
00307 
00308     case H225_RasMessage::e_gatekeeperConfirm :
00309       return OnReceiveGatekeeperConfirm(pdu, pdu);
00310 
00311     case H225_RasMessage::e_gatekeeperReject :
00312       return OnReceiveGatekeeperReject(pdu, pdu);
00313 
00314     case H225_RasMessage::e_registrationRequest :
00315       if (SendCachedResponse(pdu))
00316         return FALSE;
00317       OnReceiveRegistrationRequest(pdu, pdu);
00318       break;
00319 
00320     case H225_RasMessage::e_registrationConfirm :
00321       return OnReceiveRegistrationConfirm(pdu, pdu);
00322 
00323     case H225_RasMessage::e_registrationReject :
00324       return OnReceiveRegistrationReject(pdu, pdu);
00325 
00326     case H225_RasMessage::e_unregistrationRequest :
00327       if (SendCachedResponse(pdu))
00328         return FALSE;
00329       OnReceiveUnregistrationRequest(pdu, pdu);
00330       break;
00331 
00332     case H225_RasMessage::e_unregistrationConfirm :
00333       return OnReceiveUnregistrationConfirm(pdu, pdu);
00334 
00335     case H225_RasMessage::e_unregistrationReject :
00336       return OnReceiveUnregistrationReject(pdu, pdu);
00337 
00338     case H225_RasMessage::e_admissionRequest :
00339       if (SendCachedResponse(pdu))
00340         return FALSE;
00341       OnReceiveAdmissionRequest(pdu, pdu);
00342       break;
00343 
00344     case H225_RasMessage::e_admissionConfirm :
00345       return OnReceiveAdmissionConfirm(pdu, pdu);
00346 
00347     case H225_RasMessage::e_admissionReject :
00348       return OnReceiveAdmissionReject(pdu, pdu);
00349 
00350     case H225_RasMessage::e_bandwidthRequest :
00351       if (SendCachedResponse(pdu))
00352         return FALSE;
00353       OnReceiveBandwidthRequest(pdu, pdu);
00354       break;
00355 
00356     case H225_RasMessage::e_bandwidthConfirm :
00357       return OnReceiveBandwidthConfirm(pdu, pdu);
00358 
00359     case H225_RasMessage::e_bandwidthReject :
00360       return OnReceiveBandwidthReject(pdu, pdu);
00361 
00362     case H225_RasMessage::e_disengageRequest :
00363       if (SendCachedResponse(pdu))
00364         return FALSE;
00365       OnReceiveDisengageRequest(pdu, pdu);
00366       break;
00367 
00368     case H225_RasMessage::e_disengageConfirm :
00369       return OnReceiveDisengageConfirm(pdu, pdu);
00370 
00371     case H225_RasMessage::e_disengageReject :
00372       return OnReceiveDisengageReject(pdu, pdu);
00373 
00374     case H225_RasMessage::e_locationRequest :
00375       if (SendCachedResponse(pdu))
00376         return FALSE;
00377       OnReceiveLocationRequest(pdu, pdu);
00378       break;
00379 
00380     case H225_RasMessage::e_locationConfirm :
00381       return OnReceiveLocationConfirm(pdu, pdu);
00382 
00383     case H225_RasMessage::e_locationReject :
00384       return OnReceiveLocationReject(pdu, pdu);
00385 
00386     case H225_RasMessage::e_infoRequest :
00387       if (SendCachedResponse(pdu))
00388         return FALSE;
00389       OnReceiveInfoRequest(pdu, pdu);
00390       break;
00391 
00392     case H225_RasMessage::e_infoRequestResponse :
00393       return OnReceiveInfoRequestResponse(pdu, pdu);
00394 
00395     case H225_RasMessage::e_nonStandardMessage :
00396       OnReceiveNonStandardMessage(pdu, pdu);
00397       break;
00398 
00399     case H225_RasMessage::e_unknownMessageResponse :
00400       OnReceiveUnknownMessageResponse(pdu, pdu);
00401       break;
00402 
00403     case H225_RasMessage::e_requestInProgress :
00404       return OnReceiveRequestInProgress(pdu, pdu);
00405 
00406     case H225_RasMessage::e_resourcesAvailableIndicate :
00407       if (SendCachedResponse(pdu))
00408         return FALSE;
00409       OnReceiveResourcesAvailableIndicate(pdu, pdu);
00410       break;
00411 
00412     case H225_RasMessage::e_resourcesAvailableConfirm :
00413       return OnReceiveResourcesAvailableConfirm(pdu, pdu);
00414 
00415     case H225_RasMessage::e_infoRequestAck :
00416       return OnReceiveInfoRequestAck(pdu, pdu);
00417 
00418     case H225_RasMessage::e_infoRequestNak :
00419       return OnReceiveInfoRequestNak(pdu, pdu);
00420 
00421 #ifdef H323_H248
00422     case H225_RasMessage::e_serviceControlIndication :
00423       if (SendCachedResponse(pdu))
00424         return FALSE;
00425       OnReceiveServiceControlIndication(pdu, pdu);
00426       break;
00427 
00428     case H225_RasMessage::e_serviceControlResponse :
00429       return OnReceiveServiceControlResponse(pdu, pdu);
00430 #endif
00431 
00432     default :
00433       OnReceiveUnknown(pdu);
00434   }
00435 
00436   return FALSE;
00437 }
00438 
00439 
00440 void H225_RAS::OnSendingPDU(PASN_Object & rawPDU)
00441 {
00442   H323RasPDU & pdu = (H323RasPDU &)rawPDU;
00443 
00444   switch (pdu.GetTag()) {
00445     case H225_RasMessage::e_gatekeeperRequest :
00446       OnSendGatekeeperRequest(pdu, pdu);
00447       break;
00448 
00449     case H225_RasMessage::e_gatekeeperConfirm :
00450       OnSendGatekeeperConfirm(pdu, pdu);
00451       break;
00452 
00453     case H225_RasMessage::e_gatekeeperReject :
00454       OnSendGatekeeperReject(pdu, pdu);
00455       break;
00456 
00457     case H225_RasMessage::e_registrationRequest :
00458       OnSendRegistrationRequest(pdu, pdu);
00459       break;
00460 
00461     case H225_RasMessage::e_registrationConfirm :
00462       OnSendRegistrationConfirm(pdu, pdu);
00463       break;
00464 
00465     case H225_RasMessage::e_registrationReject :
00466       OnSendRegistrationReject(pdu, pdu);
00467       break;
00468 
00469     case H225_RasMessage::e_unregistrationRequest :
00470       OnSendUnregistrationRequest(pdu, pdu);
00471       break;
00472 
00473     case H225_RasMessage::e_unregistrationConfirm :
00474       OnSendUnregistrationConfirm(pdu, pdu);
00475       break;
00476 
00477     case H225_RasMessage::e_unregistrationReject :
00478       OnSendUnregistrationReject(pdu, pdu);
00479       break;
00480 
00481     case H225_RasMessage::e_admissionRequest :
00482       OnSendAdmissionRequest(pdu, pdu);
00483       break;
00484 
00485     case H225_RasMessage::e_admissionConfirm :
00486       OnSendAdmissionConfirm(pdu, pdu);
00487       break;
00488 
00489     case H225_RasMessage::e_admissionReject :
00490       OnSendAdmissionReject(pdu, pdu);
00491       break;
00492 
00493     case H225_RasMessage::e_bandwidthRequest :
00494       OnSendBandwidthRequest(pdu, pdu);
00495       break;
00496 
00497     case H225_RasMessage::e_bandwidthConfirm :
00498       OnSendBandwidthConfirm(pdu, pdu);
00499       break;
00500 
00501     case H225_RasMessage::e_bandwidthReject :
00502       OnSendBandwidthReject(pdu, pdu);
00503       break;
00504 
00505     case H225_RasMessage::e_disengageRequest :
00506       OnSendDisengageRequest(pdu, pdu);
00507       break;
00508 
00509     case H225_RasMessage::e_disengageConfirm :
00510       OnSendDisengageConfirm(pdu, pdu);
00511       break;
00512 
00513     case H225_RasMessage::e_disengageReject :
00514       OnSendDisengageReject(pdu, pdu);
00515       break;
00516 
00517     case H225_RasMessage::e_locationRequest :
00518       OnSendLocationRequest(pdu, pdu);
00519       break;
00520 
00521     case H225_RasMessage::e_locationConfirm :
00522       OnSendLocationConfirm(pdu, pdu);
00523       break;
00524 
00525     case H225_RasMessage::e_locationReject :
00526       OnSendLocationReject(pdu, pdu);
00527       break;
00528 
00529     case H225_RasMessage::e_infoRequest :
00530       OnSendInfoRequest(pdu, pdu);
00531       break;
00532 
00533     case H225_RasMessage::e_infoRequestResponse :
00534       OnSendInfoRequestResponse(pdu, pdu);
00535       break;
00536 
00537     case H225_RasMessage::e_nonStandardMessage :
00538       OnSendNonStandardMessage(pdu, pdu);
00539       break;
00540 
00541     case H225_RasMessage::e_unknownMessageResponse :
00542       OnSendUnknownMessageResponse(pdu, pdu);
00543       break;
00544 
00545     case H225_RasMessage::e_requestInProgress :
00546       OnSendRequestInProgress(pdu, pdu);
00547       break;
00548 
00549     case H225_RasMessage::e_resourcesAvailableIndicate :
00550       OnSendResourcesAvailableIndicate(pdu, pdu);
00551       break;
00552 
00553     case H225_RasMessage::e_resourcesAvailableConfirm :
00554       OnSendResourcesAvailableConfirm(pdu, pdu);
00555       break;
00556 
00557     case H225_RasMessage::e_infoRequestAck :
00558       OnSendInfoRequestAck(pdu, pdu);
00559       break;
00560 
00561     case H225_RasMessage::e_infoRequestNak :
00562       OnSendInfoRequestNak(pdu, pdu);
00563       break;
00564 
00565 #ifdef H323_H248
00566     case H225_RasMessage::e_serviceControlIndication :
00567       OnSendServiceControlIndication(pdu, pdu);
00568       break;
00569 
00570     case H225_RasMessage::e_serviceControlResponse :
00571       OnSendServiceControlResponse(pdu, pdu);
00572       break;
00573 #endif
00574 
00575     default :
00576       break;
00577   }
00578 }
00579 
00580 
00581 BOOL H225_RAS::OnReceiveRequestInProgress(const H323RasPDU & pdu, const H225_RequestInProgress & rip)
00582 {
00583   if (!HandleRequestInProgress(pdu, rip.m_delay))
00584     return FALSE;
00585 
00586   return OnReceiveRequestInProgress(rip);
00587 }
00588 
00589 
00590 BOOL H225_RAS::OnReceiveRequestInProgress(const H225_RequestInProgress & /*rip*/)
00591 {
00592   return TRUE;
00593 }
00594 
00595 
00596 template <typename PDUType>
00597 static void SendGenericData(const H225_RAS * ras, unsigned code, PDUType & pdu)
00598 {
00599 
00600  H225_FeatureSet fs;
00601     if (!ras->OnSendFeatureSet(code,fs))
00602                 return;
00603 
00604         if (fs.HasOptionalField(H225_FeatureSet::e_supportedFeatures)) {
00605         pdu.IncludeOptionalField(PDUType::e_genericData);
00606 
00607         H225_ArrayOf_FeatureDescriptor & fsn = fs.m_supportedFeatures;
00608         H225_ArrayOf_GenericData & data = pdu.m_genericData;
00609 
00610                 for (PINDEX i=0; i < fsn.GetSize(); i++) {
00611                                 PINDEX lastPos = data.GetSize();
00612                                 data.SetSize(lastPos+1);
00613                                 data[lastPos] = fsn[i];
00614                 }
00615         }
00616 }
00617 
00618 template <typename PDUType>
00619 static void SendFeatureSet(const H225_RAS * ras, unsigned code, PDUType & pdu)
00620 {
00621 
00622  H225_FeatureSet fs;
00623     if (!ras->OnSendFeatureSet(code,fs))
00624                 return;
00625 
00626      switch (code) {
00627         case H460_MessageType::e_gatekeeperRequest:
00628         case H460_MessageType::e_gatekeeperConfirm:
00629         case H460_MessageType::e_gatekeeperReject:
00630         case H460_MessageType::e_registrationRequest:
00631         case H460_MessageType::e_registrationConfirm: 
00632         case H460_MessageType::e_registrationReject:
00633         case H460_MessageType::e_setup:                                 
00634         case H460_MessageType::e_callProceeding:
00635             pdu.IncludeOptionalField(PDUType::e_featureSet);
00636                         pdu.m_featureSet = fs;
00637             break;
00638         default:
00639                   if (fs.HasOptionalField(H225_FeatureSet::e_supportedFeatures)) {
00640                         pdu.IncludeOptionalField(PDUType::e_genericData);
00641 
00642                         H225_ArrayOf_FeatureDescriptor & fsn = fs.m_supportedFeatures;
00643                     H225_ArrayOf_GenericData & data = pdu.m_genericData;
00644 
00645                         for (PINDEX i=0; i < fsn.GetSize(); i++) {
00646                                  PINDEX lastPos = data.GetSize();
00647                                  data.SetSize(lastPos+1);
00648                                  data[lastPos] = fsn[i];
00649                         }
00650                   }
00651                   break;
00652          }
00653 }
00654 
00655 
00656 void H225_RAS::OnSendGatekeeperRequest(H323RasPDU &, H225_GatekeeperRequest & grq)
00657 {
00658   if (!gatekeeperIdentifier) {
00659     grq.IncludeOptionalField(H225_GatekeeperRequest::e_gatekeeperIdentifier);
00660     grq.m_gatekeeperIdentifier = gatekeeperIdentifier;
00661   }
00662 
00663 #ifdef H323_H460
00664   SendFeatureSet<H225_GatekeeperRequest>(this, H460_MessageType::e_gatekeeperRequest, grq);
00665 #endif
00666 
00667   OnSendGatekeeperRequest(grq);
00668 }
00669 
00670 
00671 void H225_RAS::OnSendGatekeeperRequest(H225_GatekeeperRequest & /*grq*/)
00672 {
00673 }
00674 
00675 
00676 void H225_RAS::OnSendGatekeeperConfirm(H323RasPDU &, H225_GatekeeperConfirm & gcf)
00677 {
00678   if (!gatekeeperIdentifier) {
00679     gcf.IncludeOptionalField(H225_GatekeeperConfirm::e_gatekeeperIdentifier);
00680     gcf.m_gatekeeperIdentifier = gatekeeperIdentifier;
00681   }
00682 
00683 #ifdef H323_H460
00684   SendFeatureSet<H225_GatekeeperConfirm>(this, H460_MessageType::e_gatekeeperConfirm, gcf);
00685 #endif
00686 
00687   OnSendGatekeeperConfirm(gcf);
00688 }
00689 
00690 
00691 void H225_RAS::OnSendGatekeeperConfirm(H225_GatekeeperConfirm & /*gcf*/)
00692 {
00693 }
00694 
00695 void H225_RAS::OnSendGatekeeperReject(H323RasPDU &, H225_GatekeeperReject & grj)
00696 {
00697   if (!gatekeeperIdentifier) {
00698     grj.IncludeOptionalField(H225_GatekeeperReject::e_gatekeeperIdentifier);
00699     grj.m_gatekeeperIdentifier = gatekeeperIdentifier;
00700   }
00701 
00702 #ifdef H323_H460
00703   SendFeatureSet<H225_GatekeeperReject>(this, H460_MessageType::e_gatekeeperReject, grj);
00704 #endif
00705 
00706   OnSendGatekeeperReject(grj);
00707 }
00708 
00709 void H225_RAS::OnSendGatekeeperReject(H225_GatekeeperReject & /*grj*/)
00710 {
00711 }
00712 
00713 template <typename PDUType>
00714 static void ProcessFeatureSet(const H225_RAS * ras, unsigned code, const PDUType & pdu)
00715 {
00716     if (pdu.HasOptionalField(PDUType::e_genericData)) {
00717         H225_FeatureSet fs;
00718             fs.IncludeOptionalField(H225_FeatureSet::e_supportedFeatures);
00719             H225_ArrayOf_FeatureDescriptor & fsn = fs.m_supportedFeatures;
00720                 const H225_ArrayOf_GenericData & data = pdu.m_genericData;
00721                 for (PINDEX i=0; i < data.GetSize(); i++) {
00722                          PINDEX lastPos = fsn.GetSize();
00723                          fsn.SetSize(lastPos+1);
00724                          fsn[lastPos] = (H225_FeatureDescriptor &)data[i];
00725                 }
00726         ras->OnReceiveFeatureSet(code, fs);
00727         }
00728 }
00729 
00730 template <typename PDUType>
00731 static void ReceiveGenericData(const H225_RAS * ras, unsigned code, const PDUType & pdu)
00732 {
00733         ProcessFeatureSet<PDUType>(ras,code,pdu);
00734 }
00735 
00736 template <typename PDUType>
00737 static void ReceiveFeatureSet(const H225_RAS * ras, unsigned code, const PDUType & pdu)
00738 {
00739   if (pdu.HasOptionalField(PDUType::e_featureSet))
00740       ras->OnReceiveFeatureSet(code, pdu.m_featureSet);
00741 
00742         ProcessFeatureSet<PDUType>(ras,code,pdu);
00743 }
00744 
00745 
00746 BOOL H225_RAS::OnReceiveGatekeeperRequest(const H323RasPDU &, const H225_GatekeeperRequest & grq)
00747 {
00748 #ifdef H323_H460
00749   ReceiveFeatureSet<H225_GatekeeperRequest>(this, H460_MessageType::e_gatekeeperRequest, grq);
00750 #endif
00751 
00752   return OnReceiveGatekeeperRequest(grq);
00753 }
00754 
00755 
00756 BOOL H225_RAS::OnReceiveGatekeeperRequest(const H225_GatekeeperRequest &)
00757 {
00758   return TRUE;
00759 }
00760 
00761 
00762 BOOL H225_RAS::OnReceiveGatekeeperConfirm(const H323RasPDU &, const H225_GatekeeperConfirm & gcf)
00763 {
00764   if (!CheckForResponse(H225_RasMessage::e_gatekeeperRequest, gcf.m_requestSeqNum))
00765     return FALSE;
00766 
00767   if (gatekeeperIdentifier.IsEmpty())
00768     gatekeeperIdentifier = gcf.m_gatekeeperIdentifier;
00769   else {
00770     PString gkid = gcf.m_gatekeeperIdentifier;
00771     if (gatekeeperIdentifier *= gkid)
00772       gatekeeperIdentifier = gkid;
00773     else {
00774       PTRACE(2, "RAS\tReceived a GCF from " << gkid
00775              << " but wanted it from " << gatekeeperIdentifier);
00776       return FALSE;
00777     }
00778   }
00779 
00780 #ifdef H323_H460
00781   ReceiveFeatureSet<H225_GatekeeperConfirm>(this, H460_MessageType::e_gatekeeperConfirm, gcf);
00782 #endif
00783 
00784   return OnReceiveGatekeeperConfirm(gcf);
00785 }
00786 
00787 
00788 BOOL H225_RAS::OnReceiveGatekeeperConfirm(const H225_GatekeeperConfirm & /*gcf*/)
00789 {
00790   return TRUE;
00791 }
00792 
00793 
00794 BOOL H225_RAS::OnReceiveGatekeeperReject(const H323RasPDU &, const H225_GatekeeperReject & grj)
00795 {
00796   if (!CheckForResponse(H225_RasMessage::e_gatekeeperRequest, grj.m_requestSeqNum, &grj.m_rejectReason))
00797     return FALSE;
00798 
00799 #ifdef H323_H460
00800   ReceiveFeatureSet<H225_GatekeeperReject>(this, H460_MessageType::e_gatekeeperReject, grj);
00801 #endif
00802 
00803   return OnReceiveGatekeeperReject(grj);
00804 }
00805 
00806 
00807 BOOL H225_RAS::OnReceiveGatekeeperReject(const H225_GatekeeperReject & /*grj*/)
00808 {
00809   return TRUE;
00810 }
00811 
00812 
00813 void H225_RAS::OnSendRegistrationRequest(H323RasPDU & pdu, H225_RegistrationRequest & rrq)
00814 {
00815   OnSendRegistrationRequest(rrq);
00816 
00817 #ifdef H323_H460
00818   SendFeatureSet<H225_RegistrationRequest>(this, H460_MessageType::e_registrationRequest, rrq);
00819 #endif
00820 
00821   pdu.Prepare(rrq.m_tokens, H225_RegistrationRequest::e_tokens,
00822               rrq.m_cryptoTokens, H225_RegistrationRequest::e_cryptoTokens);
00823 
00824 }
00825 
00826 
00827 void H225_RAS::OnSendRegistrationRequest(H225_RegistrationRequest & /*rrq*/)
00828 {
00829 }
00830 
00831 
00832 void H225_RAS::OnSendRegistrationConfirm(H323RasPDU & pdu, H225_RegistrationConfirm & rcf)
00833 {
00834   if (!gatekeeperIdentifier) {
00835     rcf.IncludeOptionalField(H225_RegistrationConfirm::e_gatekeeperIdentifier);
00836     rcf.m_gatekeeperIdentifier = gatekeeperIdentifier;
00837   }
00838 
00839   OnSendRegistrationConfirm(rcf);
00840 
00841 #ifdef H323_H460
00842   SendFeatureSet<H225_RegistrationConfirm>(this, H460_MessageType::e_registrationConfirm, rcf);
00843 #endif
00844 
00845   pdu.Prepare(rcf.m_tokens, H225_RegistrationConfirm::e_tokens,
00846               rcf.m_cryptoTokens, H225_RegistrationConfirm::e_cryptoTokens);
00847  
00848 }
00849 
00850 
00851 void H225_RAS::OnSendRegistrationConfirm(H225_RegistrationConfirm & /*rcf*/)
00852 {
00853 }
00854 
00855 
00856 void H225_RAS::OnSendRegistrationReject(H323RasPDU & pdu, H225_RegistrationReject & rrj)
00857 {
00858   if (!gatekeeperIdentifier) {
00859     rrj.IncludeOptionalField(H225_RegistrationReject::e_gatekeeperIdentifier);
00860     rrj.m_gatekeeperIdentifier = gatekeeperIdentifier;
00861   }
00862 
00863   OnSendRegistrationReject(rrj);
00864 
00865 #ifdef H323_H460
00866   SendFeatureSet<H225_RegistrationReject>(this, H460_MessageType::e_registrationReject, rrj);
00867 #endif
00868 
00869   pdu.Prepare(rrj.m_tokens, H225_RegistrationReject::e_tokens,
00870               rrj.m_cryptoTokens, H225_RegistrationReject::e_cryptoTokens);
00871 }
00872 
00873 
00874 void H225_RAS::OnSendRegistrationReject(H225_RegistrationReject & /*rrj*/)
00875 {
00876 }
00877 
00878 
00879 BOOL H225_RAS::OnReceiveRegistrationRequest(const H323RasPDU &, const H225_RegistrationRequest & rrq)
00880 {
00881 #ifdef H323_H460
00882   ReceiveFeatureSet<H225_RegistrationRequest>(this, H460_MessageType::e_registrationRequest, rrq);
00883 #endif
00884 
00885   return OnReceiveRegistrationRequest(rrq);
00886 }
00887 
00888 
00889 BOOL H225_RAS::OnReceiveRegistrationRequest(const H225_RegistrationRequest &)
00890 {
00891   return TRUE;
00892 }
00893 
00894 
00895 BOOL H225_RAS::OnReceiveRegistrationConfirm(const H323RasPDU & pdu, const H225_RegistrationConfirm & rcf)
00896 {
00897   if (!CheckForResponse(H225_RasMessage::e_registrationRequest, rcf.m_requestSeqNum))
00898     return FALSE;
00899 
00900   if (lastRequest != NULL) {
00901     PString endpointIdentifier = rcf.m_endpointIdentifier;
00902     const H235Authenticators & authenticators = lastRequest->requestPDU.GetAuthenticators();
00903     for (PINDEX i = 0; i < authenticators.GetSize(); i++) {
00904       H235Authenticator & authenticator = authenticators[i];
00905       if (authenticator.UseGkAndEpIdentifiers())
00906         authenticator.SetLocalId(endpointIdentifier);
00907     }
00908   }
00909 
00910   if (!CheckCryptoTokens(pdu,
00911                          rcf.m_tokens, H225_RegistrationConfirm::e_tokens,
00912                          rcf.m_cryptoTokens, H225_RegistrationConfirm::e_cryptoTokens))
00913     return FALSE;
00914 
00915 #ifdef H323_H460
00916   ReceiveFeatureSet<H225_RegistrationConfirm>(this, H460_MessageType::e_registrationConfirm, rcf);
00917 #endif
00918 
00919   return OnReceiveRegistrationConfirm(rcf);
00920 }
00921 
00922 
00923 BOOL H225_RAS::OnReceiveRegistrationConfirm(const H225_RegistrationConfirm & /*rcf*/)
00924 {
00925   return TRUE;
00926 }
00927 
00928 
00929 BOOL H225_RAS::OnReceiveRegistrationReject(const H323RasPDU & pdu, const H225_RegistrationReject & rrj)
00930 {
00931   if (!CheckForResponse(H225_RasMessage::e_registrationRequest, rrj.m_requestSeqNum, &rrj.m_rejectReason))
00932     return FALSE;
00933 
00934   if (!CheckCryptoTokens(pdu,
00935                          rrj.m_tokens, H225_RegistrationReject::e_tokens,
00936                          rrj.m_cryptoTokens, H225_RegistrationReject::e_cryptoTokens))
00937     return FALSE;
00938 
00939 #ifdef H323_H460
00940   ReceiveFeatureSet<H225_RegistrationReject>(this, H460_MessageType::e_registrationReject, rrj);
00941 #endif
00942 
00943   return OnReceiveRegistrationReject(rrj);
00944 }
00945 
00946 
00947 BOOL H225_RAS::OnReceiveRegistrationReject(const H225_RegistrationReject & /*rrj*/)
00948 {
00949   return TRUE;
00950 }
00951 
00952 
00953 void H225_RAS::OnSendUnregistrationRequest(H323RasPDU & pdu, H225_UnregistrationRequest & urq)
00954 {
00955   OnSendUnregistrationRequest(urq);
00956   pdu.Prepare(urq.m_tokens, H225_UnregistrationRequest::e_tokens,
00957               urq.m_cryptoTokens, H225_UnregistrationRequest::e_cryptoTokens);
00958 }
00959 
00960 
00961 void H225_RAS::OnSendUnregistrationRequest(H225_UnregistrationRequest & /*urq*/)
00962 {
00963 }
00964 
00965 
00966 void H225_RAS::OnSendUnregistrationConfirm(H323RasPDU & pdu, H225_UnregistrationConfirm & ucf)
00967 {
00968   OnSendUnregistrationConfirm(ucf);
00969   pdu.Prepare(ucf.m_tokens, H225_UnregistrationConfirm::e_tokens,
00970               ucf.m_cryptoTokens, H225_UnregistrationConfirm::e_cryptoTokens);
00971 }
00972 
00973 
00974 void H225_RAS::OnSendUnregistrationConfirm(H225_UnregistrationConfirm & /*ucf*/)
00975 {
00976 }
00977 
00978 
00979 void H225_RAS::OnSendUnregistrationReject(H323RasPDU & pdu, H225_UnregistrationReject & urj)
00980 {
00981   OnSendUnregistrationReject(urj);
00982   pdu.Prepare(urj.m_tokens, H225_UnregistrationReject::e_tokens,
00983               urj.m_cryptoTokens, H225_UnregistrationReject::e_cryptoTokens);
00984 }
00985 
00986 
00987 void H225_RAS::OnSendUnregistrationReject(H225_UnregistrationReject & /*urj*/)
00988 {
00989 }
00990 
00991 
00992 BOOL H225_RAS::OnReceiveUnregistrationRequest(const H323RasPDU & pdu, const H225_UnregistrationRequest & urq)
00993 {
00994   if (!CheckCryptoTokens(pdu,
00995                          urq.m_tokens, H225_UnregistrationRequest::e_tokens,
00996                          urq.m_cryptoTokens, H225_UnregistrationRequest::e_cryptoTokens))
00997     return FALSE;
00998 
00999 #ifdef H323_H460
01000    ProcessFeatureSet<H225_UnregistrationRequest>(this, H460_MessageType::e_unregistrationRequest, urq);
01001 #endif
01002 
01003   return OnReceiveUnregistrationRequest(urq);
01004 }
01005 
01006 
01007 BOOL H225_RAS::OnReceiveUnregistrationRequest(const H225_UnregistrationRequest & /*urq*/)
01008 {
01009   return TRUE;
01010 }
01011 
01012 
01013 BOOL H225_RAS::OnReceiveUnregistrationConfirm(const H323RasPDU & pdu, const H225_UnregistrationConfirm & ucf)
01014 {
01015   if (!CheckForResponse(H225_RasMessage::e_unregistrationRequest, ucf.m_requestSeqNum))
01016     return FALSE;
01017 
01018   if (!CheckCryptoTokens(pdu,
01019                          ucf.m_tokens, H225_UnregistrationConfirm::e_tokens,
01020                          ucf.m_cryptoTokens, H225_UnregistrationConfirm::e_cryptoTokens))
01021     return FALSE;
01022 
01023   return OnReceiveUnregistrationConfirm(ucf);
01024 }
01025 
01026 
01027 BOOL H225_RAS::OnReceiveUnregistrationConfirm(const H225_UnregistrationConfirm & /*ucf*/)
01028 {
01029   return TRUE;
01030 }
01031 
01032 
01033 BOOL H225_RAS::OnReceiveUnregistrationReject(const H323RasPDU & pdu, const H225_UnregistrationReject & urj)
01034 {
01035   if (!CheckForResponse(H225_RasMessage::e_unregistrationRequest, urj.m_requestSeqNum, &urj.m_rejectReason))
01036     return FALSE;
01037 
01038   if (!CheckCryptoTokens(pdu,
01039                          urj.m_tokens, H225_UnregistrationReject::e_tokens,
01040                          urj.m_cryptoTokens, H225_UnregistrationReject::e_cryptoTokens))
01041     return FALSE;
01042 
01043   return OnReceiveUnregistrationReject(urj);
01044 }
01045 
01046 
01047 BOOL H225_RAS::OnReceiveUnregistrationReject(const H225_UnregistrationReject & /*urj*/)
01048 {
01049   return TRUE;
01050 }
01051 
01052 
01053 void H225_RAS::OnSendAdmissionRequest(H323RasPDU & pdu, H225_AdmissionRequest & arq)
01054 {
01055   OnSendAdmissionRequest(arq);
01056 
01057 #ifdef H323_H460
01058   SendFeatureSet<H225_AdmissionRequest>(this, H460_MessageType::e_admissionRequest, arq);
01059 #endif
01060 
01061   pdu.Prepare(arq.m_tokens, H225_AdmissionRequest::e_tokens,
01062               arq.m_cryptoTokens, H225_AdmissionRequest::e_cryptoTokens);
01063 }
01064 
01065 
01066 void H225_RAS::OnSendAdmissionRequest(H225_AdmissionRequest & /*arq*/)
01067 {
01068 }
01069 
01070 
01071 void H225_RAS::OnSendAdmissionConfirm(H323RasPDU & pdu, H225_AdmissionConfirm & acf)
01072 {
01073   OnSendAdmissionConfirm(acf);
01074 
01075   pdu.Prepare(acf.m_tokens, H225_AdmissionConfirm::e_tokens,
01076               acf.m_cryptoTokens, H225_AdmissionConfirm::e_cryptoTokens);
01077 }
01078 
01079 
01080 void H225_RAS::OnSendAdmissionConfirm(H225_AdmissionConfirm & /*acf*/)
01081 {
01082 }
01083 
01084 
01085 void H225_RAS::OnSendAdmissionReject(H323RasPDU & pdu, H225_AdmissionReject & arj)
01086 {
01087   OnSendAdmissionReject(arj);
01088 
01089 #ifdef H323_H460
01090   SendFeatureSet<H225_AdmissionReject>(this, H460_MessageType::e_admissionReject, arj);
01091 #endif
01092 
01093   pdu.Prepare(arj.m_tokens, H225_AdmissionReject::e_tokens,
01094               arj.m_cryptoTokens, H225_AdmissionReject::e_cryptoTokens);
01095 }
01096 
01097 
01098 void H225_RAS::OnSendAdmissionReject(H225_AdmissionReject & /*arj*/)
01099 {
01100 }
01101 
01102 
01103 BOOL H225_RAS::OnReceiveAdmissionRequest(const H323RasPDU & pdu, const H225_AdmissionRequest & arq)
01104 {
01105   if (!CheckCryptoTokens(pdu,
01106                          arq.m_tokens, H225_AdmissionRequest::e_tokens,
01107                          arq.m_cryptoTokens, H225_AdmissionRequest::e_cryptoTokens))
01108     return FALSE;
01109 
01110 #ifdef H323_H460
01111   ReceiveFeatureSet<H225_AdmissionRequest>(this, H460_MessageType::e_admissionRequest, arq);
01112 #endif
01113 
01114   return OnReceiveAdmissionRequest(arq);
01115 }
01116 
01117 
01118 BOOL H225_RAS::OnReceiveAdmissionRequest(const H225_AdmissionRequest & /*arq*/)
01119 {
01120   return TRUE;
01121 }
01122 
01123 
01124 BOOL H225_RAS::OnReceiveAdmissionConfirm(const H323RasPDU & pdu, const H225_AdmissionConfirm & acf)
01125 {
01126   if (!CheckForResponse(H225_RasMessage::e_admissionRequest, acf.m_requestSeqNum))
01127     return FALSE;
01128 
01129   if (!CheckCryptoTokens(pdu,
01130                          acf.m_tokens, H225_AdmissionConfirm::e_tokens,
01131                          acf.m_cryptoTokens, H225_AdmissionConfirm::e_cryptoTokens))
01132     return FALSE;
01133 
01134 
01135   return OnReceiveAdmissionConfirm(acf);
01136 }
01137 
01138 
01139 BOOL H225_RAS::OnReceiveAdmissionConfirm(const H225_AdmissionConfirm & /*acf*/)
01140 {
01141   return TRUE;
01142 }
01143 
01144 
01145 BOOL H225_RAS::OnReceiveAdmissionReject(const H323RasPDU & pdu, const H225_AdmissionReject & arj)
01146 {
01147   if (!CheckForResponse(H225_RasMessage::e_admissionRequest, arj.m_requestSeqNum, &arj.m_rejectReason))
01148     return FALSE;
01149 
01150   if (!CheckCryptoTokens(pdu,
01151                          arj.m_tokens, H225_AdmissionReject::e_tokens,
01152                          arj.m_cryptoTokens, H225_AdmissionReject::e_cryptoTokens))
01153     return FALSE;
01154 
01155   return OnReceiveAdmissionReject(arj);
01156 }
01157 
01158 
01159 BOOL H225_RAS::OnReceiveAdmissionReject(const H225_AdmissionReject & /*arj*/)
01160 {
01161   return TRUE;
01162 }
01163 
01164 
01165 void H225_RAS::OnSendBandwidthRequest(H323RasPDU & pdu, H225_BandwidthRequest & brq)
01166 {
01167   OnSendBandwidthRequest(brq);
01168   pdu.Prepare(brq.m_tokens, H225_BandwidthRequest::e_tokens,
01169               brq.m_cryptoTokens, H225_BandwidthRequest::e_cryptoTokens);
01170 }
01171 
01172 
01173 void H225_RAS::OnSendBandwidthRequest(H225_BandwidthRequest & /*brq*/)
01174 {
01175 }
01176 
01177 
01178 BOOL H225_RAS::OnReceiveBandwidthRequest(const H323RasPDU & pdu, const H225_BandwidthRequest & brq)
01179 {
01180   if (!CheckCryptoTokens(pdu,
01181                          brq.m_tokens, H225_BandwidthRequest::e_tokens,
01182                          brq.m_cryptoTokens, H225_BandwidthRequest::e_cryptoTokens))
01183     return FALSE;
01184 
01185   return OnReceiveBandwidthRequest(brq);
01186 }
01187 
01188 
01189 BOOL H225_RAS::OnReceiveBandwidthRequest(const H225_BandwidthRequest & /*brq*/)
01190 {
01191   return TRUE;
01192 }
01193 
01194 
01195 void H225_RAS::OnSendBandwidthConfirm(H323RasPDU & pdu, H225_BandwidthConfirm & bcf)
01196 {
01197   OnSendBandwidthConfirm(bcf);
01198   pdu.Prepare(bcf.m_tokens, H225_BandwidthConfirm::e_tokens,
01199               bcf.m_cryptoTokens, H225_BandwidthConfirm::e_cryptoTokens);
01200 }
01201 
01202 
01203 void H225_RAS::OnSendBandwidthConfirm(H225_BandwidthConfirm & /*bcf*/)
01204 {
01205 }
01206 
01207 
01208 BOOL H225_RAS::OnReceiveBandwidthConfirm(const H323RasPDU & pdu, const H225_BandwidthConfirm & bcf)
01209 {
01210   if (!CheckForResponse(H225_RasMessage::e_bandwidthRequest, bcf.m_requestSeqNum))
01211     return FALSE;
01212 
01213   if (!CheckCryptoTokens(pdu,
01214                          bcf.m_tokens, H225_BandwidthConfirm::e_tokens,
01215                          bcf.m_cryptoTokens, H225_BandwidthConfirm::e_cryptoTokens))
01216     return FALSE;
01217 
01218   return OnReceiveBandwidthConfirm(bcf);
01219 }
01220 
01221 
01222 BOOL H225_RAS::OnReceiveBandwidthConfirm(const H225_BandwidthConfirm & /*bcf*/)
01223 {
01224   return TRUE;
01225 }
01226 
01227 
01228 void H225_RAS::OnSendBandwidthReject(H323RasPDU & pdu, H225_BandwidthReject & brj)
01229 {
01230   OnSendBandwidthReject(brj);
01231   pdu.Prepare(brj.m_tokens, H225_BandwidthReject::e_tokens,
01232               brj.m_cryptoTokens, H225_BandwidthReject::e_cryptoTokens);
01233 }
01234 
01235 
01236 void H225_RAS::OnSendBandwidthReject(H225_BandwidthReject & /*brj*/)
01237 {
01238 }
01239 
01240 
01241 BOOL H225_RAS::OnReceiveBandwidthReject(const H323RasPDU & pdu, const H225_BandwidthReject & brj)
01242 {
01243   if (!CheckForResponse(H225_RasMessage::e_bandwidthRequest, brj.m_requestSeqNum, &brj.m_rejectReason))
01244     return FALSE;
01245 
01246   if (!CheckCryptoTokens(pdu,
01247                          brj.m_tokens, H225_BandwidthReject::e_tokens,
01248                          brj.m_cryptoTokens, H225_BandwidthReject::e_cryptoTokens))
01249     return FALSE;
01250 
01251   return OnReceiveBandwidthReject(brj);
01252 }
01253 
01254 
01255 BOOL H225_RAS::OnReceiveBandwidthReject(const H225_BandwidthReject & /*brj*/)
01256 {
01257   return TRUE;
01258 }
01259 
01260 
01261 void H225_RAS::OnSendDisengageRequest(H323RasPDU & pdu, H225_DisengageRequest & drq)
01262 {
01263   OnSendDisengageRequest(drq);
01264   pdu.Prepare(drq.m_tokens, H225_DisengageRequest::e_tokens,
01265               drq.m_cryptoTokens, H225_DisengageRequest::e_cryptoTokens);
01266 
01267 #ifdef H323_H460
01268   SendGenericData<H225_DisengageRequest>(this, H460_MessageType::e_disengagerequest, drq);
01269 #endif
01270 }
01271 
01272 
01273 void H225_RAS::OnSendDisengageRequest(H225_DisengageRequest & /*drq*/)
01274 {
01275 }
01276 
01277 
01278 BOOL H225_RAS::OnReceiveDisengageRequest(const H323RasPDU & pdu, const H225_DisengageRequest & drq)
01279 {
01280   if (!CheckCryptoTokens(pdu,
01281                          drq.m_tokens, H225_DisengageRequest::e_tokens,
01282                          drq.m_cryptoTokens, H225_DisengageRequest::e_cryptoTokens))
01283     return FALSE;
01284 
01285 #ifdef H323_H460
01286   ReceiveGenericData<H225_DisengageRequest>(this, H460_MessageType::e_disengagerequest, drq);
01287 #endif
01288 
01289   return OnReceiveDisengageRequest(drq);
01290 }
01291 
01292 
01293 BOOL H225_RAS::OnReceiveDisengageRequest(const H225_DisengageRequest & /*drq*/)
01294 {
01295   return TRUE;
01296 }
01297 
01298 
01299 void H225_RAS::OnSendDisengageConfirm(H323RasPDU & pdu, H225_DisengageConfirm & dcf)
01300 {
01301   OnSendDisengageConfirm(dcf);
01302   pdu.Prepare(dcf.m_tokens, H225_DisengageConfirm::e_tokens,
01303               dcf.m_cryptoTokens, H225_DisengageConfirm::e_cryptoTokens);
01304 
01305 #ifdef H323_H460
01306   SendGenericData<H225_DisengageConfirm>(this, H460_MessageType::e_disengageconfirm, dcf);
01307 #endif
01308 }
01309 
01310 
01311 void H225_RAS::OnSendDisengageConfirm(H225_DisengageConfirm & /*dcf*/)
01312 {
01313 }
01314 
01315 
01316 BOOL H225_RAS::OnReceiveDisengageConfirm(const H323RasPDU & pdu, const H225_DisengageConfirm & dcf)
01317 {
01318   if (!CheckForResponse(H225_RasMessage::e_disengageRequest, dcf.m_requestSeqNum))
01319     return FALSE;
01320 
01321   if (!CheckCryptoTokens(pdu,
01322                          dcf.m_tokens, H225_DisengageConfirm::e_tokens,
01323                          dcf.m_cryptoTokens, H225_DisengageConfirm::e_cryptoTokens))
01324     return FALSE;
01325 
01326 #ifdef H323_H460
01327   ReceiveGenericData<H225_DisengageConfirm>(this, H460_MessageType::e_disengageconfirm, dcf);
01328 #endif
01329 
01330   return OnReceiveDisengageConfirm(dcf);
01331 }
01332 
01333 
01334 BOOL H225_RAS::OnReceiveDisengageConfirm(const H225_DisengageConfirm & /*dcf*/)
01335 {
01336   return TRUE;
01337 }
01338 
01339 
01340 void H225_RAS::OnSendDisengageReject(H323RasPDU & pdu, H225_DisengageReject & drj)
01341 {
01342   OnSendDisengageReject(drj);
01343   pdu.Prepare(drj.m_tokens, H225_DisengageReject::e_tokens,
01344               drj.m_cryptoTokens, H225_DisengageReject::e_cryptoTokens);
01345 }
01346 
01347 
01348 void H225_RAS::OnSendDisengageReject(H225_DisengageReject & /*drj*/)
01349 {
01350 }
01351 
01352 
01353 BOOL H225_RAS::OnReceiveDisengageReject(const H323RasPDU & pdu, const H225_DisengageReject & drj)
01354 {
01355   if (!CheckForResponse(H225_RasMessage::e_disengageRequest, drj.m_requestSeqNum, &drj.m_rejectReason))
01356     return FALSE;
01357 
01358   if (!CheckCryptoTokens(pdu,
01359                          drj.m_tokens, H225_DisengageReject::e_tokens,
01360                          drj.m_cryptoTokens, H225_DisengageReject::e_cryptoTokens))
01361     return FALSE;
01362 
01363   return OnReceiveDisengageReject(drj);
01364 }
01365 
01366 
01367 BOOL H225_RAS::OnReceiveDisengageReject(const H225_DisengageReject & /*drj*/)
01368 {
01369   return TRUE;
01370 }
01371 
01372 
01373 void H225_RAS::OnSendLocationRequest(H323RasPDU & pdu, H225_LocationRequest & lrq)
01374 {
01375   OnSendLocationRequest(lrq);
01376 
01377 #ifdef H323_H460
01378   SendFeatureSet<H225_LocationRequest>(this, H460_MessageType::e_locationRequest, lrq);
01379 #endif
01380 
01381   pdu.Prepare(lrq.m_tokens, H225_LocationRequest::e_tokens,
01382               lrq.m_cryptoTokens, H225_LocationRequest::e_cryptoTokens);
01383 }
01384 
01385 
01386 void H225_RAS::OnSendLocationRequest(H225_LocationRequest & /*lrq*/)
01387 {
01388 }
01389 
01390 
01391 BOOL H225_RAS::OnReceiveLocationRequest(const H323RasPDU & pdu, const H225_LocationRequest & lrq)
01392 {
01393   if (!CheckCryptoTokens(pdu,
01394                          lrq.m_tokens, H225_LocationRequest::e_tokens,
01395                          lrq.m_cryptoTokens, H225_LocationRequest::e_cryptoTokens))
01396     return FALSE;
01397 
01398 #ifdef H323_H460
01399   ReceiveFeatureSet<H225_LocationRequest>(this, H460_MessageType::e_locationRequest, lrq);
01400 #endif
01401 
01402   return OnReceiveLocationRequest(lrq);
01403 }
01404 
01405 
01406 BOOL H225_RAS::OnReceiveLocationRequest(const H225_LocationRequest & /*lrq*/)
01407 {
01408   return TRUE;
01409 }
01410 
01411 
01412 void H225_RAS::OnSendLocationConfirm(H323RasPDU & pdu, H225_LocationConfirm & lcf)
01413 {
01414   OnSendLocationConfirm(lcf);
01415 
01416 #ifdef H323_H460
01417   SendFeatureSet<H225_LocationConfirm>(this, H460_MessageType::e_locationConfirm, lcf);
01418 #endif
01419 
01420   pdu.Prepare(lcf.m_tokens, H225_LocationRequest::e_tokens,
01421               lcf.m_cryptoTokens, H225_LocationRequest::e_cryptoTokens);
01422 }
01423 
01424 
01425 void H225_RAS::OnSendLocationConfirm(H225_LocationConfirm & /*lcf*/)
01426 {
01427 }
01428 
01429 
01430 BOOL H225_RAS::OnReceiveLocationConfirm(const H323RasPDU &, const H225_LocationConfirm & lcf)
01431 {
01432   if (!CheckForResponse(H225_RasMessage::e_locationRequest, lcf.m_requestSeqNum))
01433     return FALSE;
01434 
01435   if (lastRequest->responseInfo != NULL) {
01436     H323TransportAddress & locatedAddress = *(H323TransportAddress *)lastRequest->responseInfo;
01437     locatedAddress = lcf.m_callSignalAddress;
01438   }
01439 
01440 #ifdef H323_H460
01441   ReceiveFeatureSet<H225_LocationConfirm>(this, H460_MessageType::e_locationConfirm, lcf);
01442 #endif
01443 
01444   return OnReceiveLocationConfirm(lcf);
01445 }
01446 
01447 
01448 BOOL H225_RAS::OnReceiveLocationConfirm(const H225_LocationConfirm & /*lcf*/)
01449 {
01450   return TRUE;
01451 }
01452 
01453 
01454 void H225_RAS::OnSendLocationReject(H323RasPDU & pdu, H225_LocationReject & lrj)
01455 {
01456   OnSendLocationReject(lrj);
01457 
01458 #ifdef H323_H460
01459   SendFeatureSet<H225_LocationReject>(this, H460_MessageType::e_locationReject, lrj);
01460 #endif
01461 
01462   pdu.Prepare(lrj.m_tokens, H225_LocationReject::e_tokens,
01463               lrj.m_cryptoTokens, H225_LocationReject::e_cryptoTokens);
01464 }
01465 
01466 
01467 void H225_RAS::OnSendLocationReject(H225_LocationReject & /*lrj*/)
01468 {
01469 }
01470 
01471 
01472 BOOL H225_RAS::OnReceiveLocationReject(const H323RasPDU & pdu, const H225_LocationReject & lrj)
01473 {
01474   if (!CheckForResponse(H225_RasMessage::e_locationRequest, lrj.m_requestSeqNum, &lrj.m_rejectReason))
01475     return FALSE;
01476 
01477   if (!CheckCryptoTokens(pdu,
01478                          lrj.m_tokens, H225_LocationReject::e_tokens,
01479                          lrj.m_cryptoTokens, H225_LocationReject::e_cryptoTokens))
01480     return FALSE;
01481 
01482 #ifdef H323_H460
01483   ReceiveFeatureSet<H225_LocationReject>(this, H460_MessageType::e_locationReject, lrj);
01484 #endif
01485 
01486   return OnReceiveLocationReject(lrj);
01487 }
01488 
01489 
01490 BOOL H225_RAS::OnReceiveLocationReject(const H225_LocationReject & /*lrj*/)
01491 {
01492   return TRUE;
01493 }
01494 
01495 
01496 void H225_RAS::OnSendInfoRequest(H323RasPDU & pdu, H225_InfoRequest & irq)
01497 {
01498   OnSendInfoRequest(irq);
01499   pdu.Prepare(irq.m_tokens, H225_InfoRequest::e_tokens,
01500               irq.m_cryptoTokens, H225_InfoRequest::e_cryptoTokens);
01501 
01502 #ifdef H323_H460
01503   SendGenericData<H225_InfoRequest>(this, H460_MessageType::e_inforequest, irq);
01504 #endif
01505 }
01506 
01507 
01508 void H225_RAS::OnSendInfoRequest(H225_InfoRequest & /*irq*/)
01509 {
01510 }
01511 
01512 
01513 BOOL H225_RAS::OnReceiveInfoRequest(const H323RasPDU & pdu, const H225_InfoRequest & irq)
01514 {
01515   if (!CheckCryptoTokens(pdu,
01516                          irq.m_tokens, H225_InfoRequest::e_tokens,
01517                          irq.m_cryptoTokens, H225_InfoRequest::e_cryptoTokens))
01518     return FALSE;
01519 
01520 #ifdef H323_H460
01521   ReceiveGenericData<H225_InfoRequest>(this, H460_MessageType::e_inforequest, irq);
01522 #endif
01523 
01524   return OnReceiveInfoRequest(irq);
01525 }
01526 
01527 
01528 BOOL H225_RAS::OnReceiveInfoRequest(const H225_InfoRequest & /*irq*/)
01529 {
01530   return TRUE;
01531 }
01532 
01533 
01534 void H225_RAS::OnSendInfoRequestResponse(H323RasPDU & pdu, H225_InfoRequestResponse & irr)
01535 {
01536   OnSendInfoRequestResponse(irr);
01537   pdu.Prepare(irr.m_tokens, H225_InfoRequestResponse::e_tokens,
01538               irr.m_cryptoTokens, H225_InfoRequestResponse::e_cryptoTokens);
01539 
01540 #ifdef H323_H460
01541   SendGenericData<H225_InfoRequestResponse>(this, H460_MessageType::e_inforequestresponse, irr);
01542 #endif
01543 }
01544 
01545 
01546 void H225_RAS::OnSendInfoRequestResponse(H225_InfoRequestResponse & /*irr*/)
01547 {
01548 }
01549 
01550 
01551 BOOL H225_RAS::OnReceiveInfoRequestResponse(const H323RasPDU & pdu, const H225_InfoRequestResponse & irr)
01552 {
01553   if (!CheckForResponse(H225_RasMessage::e_infoRequest, irr.m_requestSeqNum))
01554     return FALSE;
01555 
01556   if (!CheckCryptoTokens(pdu,
01557                          irr.m_tokens, H225_InfoRequestResponse::e_tokens,
01558                          irr.m_cryptoTokens, H225_InfoRequestResponse::e_cryptoTokens))
01559     return FALSE;
01560 
01561 #ifdef H323_H460
01562   ReceiveGenericData<H225_InfoRequestResponse>(this, H460_MessageType::e_inforequestresponse, irr);
01563 #endif
01564 
01565   return OnReceiveInfoRequestResponse(irr);
01566 }
01567 
01568 
01569 BOOL H225_RAS::OnReceiveInfoRequestResponse(const H225_InfoRequestResponse & /*irr*/)
01570 {
01571   return TRUE;
01572 }
01573 
01574 
01575 void H225_RAS::OnSendNonStandardMessage(H323RasPDU & pdu, H225_NonStandardMessage & nsm)
01576 {
01577   OnSendNonStandardMessage(nsm);
01578 
01579 #ifdef H323_H460
01580   SendFeatureSet<H225_NonStandardMessage>(this, H460_MessageType::e_nonStandardMessage, nsm);
01581 #endif
01582 
01583   pdu.Prepare(nsm.m_tokens, H225_InfoRequestResponse::e_tokens,
01584               nsm.m_cryptoTokens, H225_InfoRequestResponse::e_cryptoTokens);
01585 }
01586 
01587 
01588 void H225_RAS::OnSendNonStandardMessage(H225_NonStandardMessage & /*nsm*/)
01589 {
01590 }
01591 
01592 
01593 BOOL H225_RAS::OnReceiveNonStandardMessage(const H323RasPDU & pdu, const H225_NonStandardMessage & nsm)
01594 {
01595   if (!CheckCryptoTokens(pdu,
01596                          nsm.m_tokens, H225_NonStandardMessage::e_tokens,
01597                          nsm.m_cryptoTokens, H225_NonStandardMessage::e_cryptoTokens))
01598     return FALSE;
01599 
01600 #ifdef H323_H460
01601   ReceiveFeatureSet<H225_NonStandardMessage>(this, H460_MessageType::e_nonStandardMessage, nsm);
01602 #endif
01603 
01604   return OnReceiveNonStandardMessage(nsm);
01605 }
01606 
01607 
01608 BOOL H225_RAS::OnReceiveNonStandardMessage(const H225_NonStandardMessage & /*nsm*/)
01609 {
01610   return TRUE;
01611 }
01612 
01613 
01614 void H225_RAS::OnSendUnknownMessageResponse(H323RasPDU & pdu, H225_UnknownMessageResponse & umr)
01615 {
01616   OnSendUnknownMessageResponse(umr);
01617   pdu.Prepare(umr.m_tokens, H225_UnknownMessageResponse::e_tokens,
01618               umr.m_cryptoTokens, H225_UnknownMessageResponse::e_cryptoTokens);
01619 }
01620 
01621 
01622 void H225_RAS::OnSendUnknownMessageResponse(H225_UnknownMessageResponse & /*umr*/)
01623 {
01624 }
01625 
01626 
01627 BOOL H225_RAS::OnReceiveUnknownMessageResponse(const H323RasPDU & pdu, const H225_UnknownMessageResponse & umr)
01628 {
01629   if (!CheckCryptoTokens(pdu,
01630                          umr.m_tokens, H225_UnknownMessageResponse::e_tokens,
01631                          umr.m_cryptoTokens, H225_UnknownMessageResponse::e_cryptoTokens))
01632     return FALSE;
01633 
01634   return OnReceiveUnknownMessageResponse(umr);
01635 }
01636 
01637 
01638 BOOL H225_RAS::OnReceiveUnknownMessageResponse(const H225_UnknownMessageResponse & /*umr*/)
01639 {
01640   return TRUE;
01641 }
01642 
01643 
01644 void H225_RAS::OnSendRequestInProgress(H323RasPDU & pdu, H225_RequestInProgress & rip)
01645 {
01646   OnSendRequestInProgress(rip);
01647   pdu.Prepare(rip.m_tokens, H225_RequestInProgress::e_tokens,
01648               rip.m_cryptoTokens, H225_RequestInProgress::e_cryptoTokens);
01649 }
01650 
01651 
01652 void H225_RAS::OnSendRequestInProgress(H225_RequestInProgress & /*rip*/)
01653 {
01654 }
01655 
01656 
01657 void H225_RAS::OnSendResourcesAvailableIndicate(H323RasPDU & pdu, H225_ResourcesAvailableIndicate & rai)
01658 {
01659   OnSendResourcesAvailableIndicate(rai);
01660   pdu.Prepare(rai.m_tokens, H225_ResourcesAvailableIndicate::e_tokens,
01661               rai.m_cryptoTokens, H225_ResourcesAvailableIndicate::e_cryptoTokens);
01662 }
01663 
01664 
01665 void H225_RAS::OnSendResourcesAvailableIndicate(H225_ResourcesAvailableIndicate & /*rai*/)
01666 {
01667 }
01668 
01669 
01670 BOOL H225_RAS::OnReceiveResourcesAvailableIndicate(const H323RasPDU & pdu, const H225_ResourcesAvailableIndicate & rai)
01671 {
01672   if (!CheckCryptoTokens(pdu,
01673                          rai.m_tokens, H225_ResourcesAvailableIndicate::e_tokens,
01674                          rai.m_cryptoTokens, H225_ResourcesAvailableIndicate::e_cryptoTokens))
01675     return FALSE;
01676 
01677   return OnReceiveResourcesAvailableIndicate(rai);
01678 }
01679 
01680 
01681 BOOL H225_RAS::OnReceiveResourcesAvailableIndicate(const H225_ResourcesAvailableIndicate & /*rai*/)
01682 {
01683   return TRUE;
01684 }
01685 
01686 
01687 void H225_RAS::OnSendResourcesAvailableConfirm(H323RasPDU & pdu, H225_ResourcesAvailableConfirm & rac)
01688 {
01689   OnSendResourcesAvailableConfirm(rac);
01690   pdu.Prepare(rac.m_tokens, H225_ResourcesAvailableConfirm::e_tokens,
01691               rac.m_cryptoTokens, H225_ResourcesAvailableConfirm::e_cryptoTokens);
01692 }
01693 
01694 
01695 void H225_RAS::OnSendResourcesAvailableConfirm(H225_ResourcesAvailableConfirm & /*rac*/)
01696 {
01697 }
01698 
01699 
01700 BOOL H225_RAS::OnReceiveResourcesAvailableConfirm(const H323RasPDU & pdu, const H225_ResourcesAvailableConfirm & rac)
01701 {
01702   if (!CheckForResponse(H225_RasMessage::e_resourcesAvailableIndicate, rac.m_requestSeqNum))
01703     return FALSE;
01704 
01705   if (!CheckCryptoTokens(pdu,
01706                          rac.m_tokens, H225_ResourcesAvailableConfirm::e_tokens,
01707                          rac.m_cryptoTokens, H225_ResourcesAvailableConfirm::e_cryptoTokens))
01708     return FALSE;
01709 
01710   return OnReceiveResourcesAvailableConfirm(rac);
01711 }
01712 
01713 
01714 BOOL H225_RAS::OnReceiveResourcesAvailableConfirm(const H225_ResourcesAvailableConfirm & /*rac*/)
01715 {
01716   return TRUE;
01717 }
01718 
01719 #ifdef H323_H248
01720 
01721 void H225_RAS::OnSendServiceControlIndication(H323RasPDU & pdu, H225_ServiceControlIndication & sci)
01722 {
01723   OnSendServiceControlIndication(sci);
01724 
01725 #ifdef H323_H460
01726   SendFeatureSet<H225_ServiceControlIndication>(this, H460_MessageType::e_serviceControlIndication, sci);
01727 #endif
01728 
01729   pdu.Prepare(sci.m_tokens, H225_ServiceControlIndication::e_tokens,
01730               sci.m_cryptoTokens, H225_ServiceControlIndication::e_cryptoTokens);
01731 }
01732 
01733 
01734 void H225_RAS::OnSendServiceControlIndication(H225_ServiceControlIndication & /*sci*/)
01735 {
01736 }
01737 
01738 
01739 BOOL H225_RAS::OnReceiveServiceControlIndication(const H323RasPDU & pdu, const H225_ServiceControlIndication & sci)
01740 {
01741   if (!CheckCryptoTokens(pdu,
01742                          sci.m_tokens, H225_ServiceControlIndication::e_tokens,
01743                          sci.m_cryptoTokens, H225_ServiceControlIndication::e_cryptoTokens))
01744     return FALSE;
01745 
01746 #ifdef H323_H460
01747   ReceiveFeatureSet<H225_ServiceControlIndication>(this, H460_MessageType::e_serviceControlIndication, sci);
01748 #endif
01749 
01750   return OnReceiveServiceControlIndication(sci);
01751 }
01752 
01753 
01754 BOOL H225_RAS::OnReceiveServiceControlIndication(const H225_ServiceControlIndication & /*sci*/)
01755 {
01756   return TRUE;
01757 }
01758 
01759 
01760 void H225_RAS::OnSendServiceControlResponse(H323RasPDU & pdu, H225_ServiceControlResponse & scr)
01761 {
01762   OnSendServiceControlResponse(scr);
01763 
01764 #ifdef H323_H460
01765   SendFeatureSet<H225_ServiceControlResponse>(this, H460_MessageType::e_serviceControlResponse, scr);
01766 #endif
01767 
01768   pdu.Prepare(scr.m_tokens, H225_ResourcesAvailableConfirm::e_tokens,
01769               scr.m_cryptoTokens, H225_ResourcesAvailableConfirm::e_cryptoTokens);
01770 }
01771 
01772 
01773 void H225_RAS::OnSendServiceControlResponse(H225_ServiceControlResponse & /*scr*/)
01774 {
01775 }
01776 
01777 
01778 BOOL H225_RAS::OnReceiveServiceControlResponse(const H323RasPDU & pdu, const H225_ServiceControlResponse & scr)
01779 {
01780   if (!CheckForResponse(H225_RasMessage::e_serviceControlIndication, scr.m_requestSeqNum))
01781     return FALSE;
01782 
01783   if (!CheckCryptoTokens(pdu,
01784                          scr.m_tokens, H225_ServiceControlResponse::e_tokens,
01785                          scr.m_cryptoTokens, H225_ServiceControlResponse::e_cryptoTokens))
01786     return FALSE;
01787 
01788 #ifdef H323_H460
01789   ReceiveFeatureSet<H225_ServiceControlResponse>(this, H460_MessageType::e_serviceControlResponse, scr);
01790 #endif
01791 
01792   return OnReceiveServiceControlResponse(scr);
01793 }
01794 
01795 
01796 BOOL H225_RAS::OnReceiveServiceControlResponse(const H225_ServiceControlResponse & /*scr*/)
01797 {
01798   return TRUE;
01799 }
01800 
01801 #endif // H323_H248
01802 
01803 
01804 void H225_RAS::OnSendInfoRequestAck(H323RasPDU & pdu, H225_InfoRequestAck & iack)
01805 {
01806   OnSendInfoRequestAck(iack);
01807   pdu.Prepare(iack.m_tokens, H225_InfoRequestAck::e_tokens,
01808               iack.m_cryptoTokens, H225_InfoRequestAck::e_cryptoTokens);
01809 }
01810 
01811 
01812 void H225_RAS::OnSendInfoRequestAck(H225_InfoRequestAck & /*iack*/)
01813 {
01814 }
01815 
01816 
01817 BOOL H225_RAS::OnReceiveInfoRequestAck(const H323RasPDU & pdu, const H225_InfoRequestAck & iack)
01818 {
01819   if (!CheckForResponse(H225_RasMessage::e_infoRequestResponse, iack.m_requestSeqNum))
01820     return FALSE;
01821 
01822   if (!CheckCryptoTokens(pdu,
01823                          iack.m_tokens, H225_InfoRequestAck::e_tokens,
01824                          iack.m_cryptoTokens, H225_InfoRequestAck::e_cryptoTokens))
01825     return FALSE;
01826 
01827   return OnReceiveInfoRequestAck(iack);
01828 }
01829 
01830 
01831 BOOL H225_RAS::OnReceiveInfoRequestAck(const H225_InfoRequestAck & /*iack*/)
01832 {
01833   return TRUE;
01834 }
01835 
01836 
01837 void H225_RAS::OnSendInfoRequestNak(H323RasPDU & pdu, H225_InfoRequestNak & inak)
01838 {
01839   OnSendInfoRequestNak(inak);
01840   pdu.Prepare(inak.m_tokens, H225_InfoRequestAck::e_tokens,
01841               inak.m_cryptoTokens, H225_InfoRequestAck::e_cryptoTokens);
01842 }
01843 
01844 
01845 void H225_RAS::OnSendInfoRequestNak(H225_InfoRequestNak & /*inak*/)
01846 {
01847 }
01848 
01849 
01850 BOOL H225_RAS::OnReceiveInfoRequestNak(const H323RasPDU & pdu, const H225_InfoRequestNak & inak)
01851 {
01852   if (!CheckForResponse(H225_RasMessage::e_infoRequestResponse, inak.m_requestSeqNum, &inak.m_nakReason))
01853     return FALSE;
01854 
01855   if (!CheckCryptoTokens(pdu,
01856                          inak.m_tokens, H225_InfoRequestNak::e_tokens,
01857                          inak.m_cryptoTokens, H225_InfoRequestNak::e_cryptoTokens))
01858     return FALSE;
01859 
01860   return OnReceiveInfoRequestNak(inak);
01861 }
01862 
01863 
01864 BOOL H225_RAS::OnReceiveInfoRequestNak(const H225_InfoRequestNak & /*inak*/)
01865 {
01866   return TRUE;
01867 }
01868 
01869 
01870 BOOL H225_RAS::OnReceiveUnknown(const H323RasPDU &)
01871 {
01872   H323RasPDU response;
01873   response.BuildUnknownMessageResponse(0);
01874   return response.Write(*transport);
01875 }
01876 
01877 

Generated on Thu Oct 25 13:42:51 2007 for h323plus by  doxygen 1.5.2