00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 #ifndef __OPAL_SVCCTRL_H
00044 #define __OPAL_SVCCTRL_H
00045
00046 #ifdef P_USE_PRAGMA
00047 #pragma interface
00048 #endif
00049
00050
00051 class H225_ServiceControlDescriptor;
00052 class H225_ServiceControlIndication;
00053 class H225_ServiceControlResponse;
00054
00055 class H248_SignalsDescriptor;
00056 class H248_SignalRequest;
00057
00058 class H323EndPoint;
00059 class H323Connection;
00060
00061
00063
00067 class H323ServiceControlSession : public PObject
00068 {
00069 PCLASSINFO(H323ServiceControlSession, PObject);
00070 public:
00075 H323ServiceControlSession();
00077
00085 virtual BOOL IsValid() const = 0;
00086
00094 virtual PString GetServiceControlType() const;
00095
00103 virtual BOOL OnReceivedPDU(
00104 const H225_ServiceControlDescriptor & descriptor
00105 ) = 0;
00106
00114 virtual BOOL OnSendingPDU(
00115 H225_ServiceControlDescriptor & descriptor
00116 ) const = 0;
00117
00118 enum ChangeType {
00119 OpenSession,
00120 RefreshSession,
00121 CloseSession
00122 };
00123
00128 virtual void OnChange(
00129 unsigned type,
00130 unsigned sessionId,
00131 H323EndPoint & endpoint,
00132 H323Connection * connection
00133 ) const = 0;
00134
00135 enum serviceType {
00136 e_URL,
00137 e_Signal,
00138 e_NonStandard,
00139 e_CallCredit
00140 };
00141
00142 virtual serviceType GetType() = 0;
00144 };
00145
00146
00150 class H323HTTPServiceControl : public H323ServiceControlSession
00151 {
00152 PCLASSINFO(H323HTTPServiceControl, H323ServiceControlSession);
00153 public:
00158 H323HTTPServiceControl(
00159 const PString & url
00160 );
00161
00164 H323HTTPServiceControl(
00165 const H225_ServiceControlDescriptor & contents
00166 );
00168
00176 virtual BOOL IsValid() const;
00177
00185 virtual PString GetServiceControlType() const;
00186
00192 virtual BOOL OnReceivedPDU(
00193 const H225_ServiceControlDescriptor & contents
00194 );
00195
00201 virtual BOOL OnSendingPDU(
00202 H225_ServiceControlDescriptor & contents
00203 ) const;
00204
00209 virtual void OnChange(
00210 unsigned type,
00211 unsigned sessionId,
00212 H323EndPoint & endpoint,
00213 H323Connection * connection
00214 ) const;
00215
00216 serviceType GetType() { return e_URL; };
00217
00218 void GetValue(PString & _url) { _url = url; }
00220
00221 protected:
00222 PString url;
00223 };
00224
00225
00228 class H323H248ServiceControl : public H323ServiceControlSession
00229 {
00230 PCLASSINFO(H323H248ServiceControl, H323ServiceControlSession);
00231 public:
00236 H323H248ServiceControl();
00237
00240 H323H248ServiceControl(
00241 const H225_ServiceControlDescriptor & contents
00242 );
00244
00253 virtual BOOL OnReceivedPDU(
00254 const H225_ServiceControlDescriptor & contents
00255 );
00256
00263 virtual BOOL OnSendingPDU(
00264 H225_ServiceControlDescriptor & contents
00265 ) const;
00266
00273 virtual BOOL OnReceivedPDU(
00274 const H248_SignalsDescriptor & descriptor
00275 );
00276
00283 virtual BOOL OnSendingPDU(
00284 H248_SignalsDescriptor & descriptor
00285 ) const;
00286
00292 virtual BOOL OnReceivedPDU(
00293 const H248_SignalRequest & request
00294 ) = 0;
00295
00301 virtual BOOL OnSendingPDU(
00302 H248_SignalRequest & request
00303 ) const = 0;
00304
00305 serviceType GetType() { return e_Signal; };
00307 };
00308
00309
00312 class H323CallCreditServiceControl : public H323ServiceControlSession
00313 {
00314 PCLASSINFO(H323CallCreditServiceControl, H323ServiceControlSession);
00315 public:
00320 H323CallCreditServiceControl(
00321 const PString & amount,
00322 BOOL mode,
00323 unsigned duration = 0
00324 );
00325
00328 H323CallCreditServiceControl(
00329 const H225_ServiceControlDescriptor & contents
00330 );
00332
00340 virtual BOOL IsValid() const;
00341
00347 virtual BOOL OnReceivedPDU(
00348 const H225_ServiceControlDescriptor & contents
00349 );
00350
00356 virtual BOOL OnSendingPDU(
00357 H225_ServiceControlDescriptor & contents
00358 ) const;
00359
00365 virtual void OnChange(
00366 unsigned type,
00367 unsigned sessionId,
00368 H323EndPoint & endpoint,
00369 H323Connection * connection
00370 ) const;
00371
00372 serviceType GetType() { return e_CallCredit; };
00373
00374 void GetValue(PString & _amount,BOOL & _credit, unsigned & _time)
00375 { _amount = amount; _credit = mode; _time = durationLimit;}
00377
00378 protected:
00379 PString amount;
00380 BOOL mode;
00381 unsigned durationLimit;
00382 };
00383
00384
00385 #ifdef H323_H350
00386
00389 class H323H350ServiceControl : public H323ServiceControlSession
00390 {
00391 PCLASSINFO(H323H350ServiceControl, H323ServiceControlSession);
00392 public:
00397 H323H350ServiceControl(
00398 const PString & _ldapURL,
00399 const PString & _ldapDN
00400 );
00401
00404 H323H350ServiceControl(
00405 const H225_ServiceControlDescriptor & contents
00406 );
00408
00416 virtual BOOL IsValid() const;
00417
00425 virtual PString GetServiceControlType() const;
00426
00432 virtual BOOL OnReceivedPDU(
00433 const H225_ServiceControlDescriptor & contents
00434 );
00435
00441 virtual BOOL OnSendingPDU(
00442 H225_ServiceControlDescriptor & contents
00443 ) const;
00444
00449 virtual void OnChange(
00450 unsigned type,
00451 unsigned sessionId,
00452 H323EndPoint & endpoint,
00453 H323Connection * connection
00454 ) const;
00455
00456 serviceType GetType() { return e_NonStandard; };
00457
00458 void GetValue(PString & _ldapURL,PString & _ldapDN)
00459 { _ldapURL = ldapURL; _ldapDN = ldapDN; }
00461
00462 protected:
00463 PString ldapURL;
00464 PString ldapDN;
00465 };
00466
00467 #endif
00468
00469
00470 #endif // __OPAL_SVCCTRL_H
00471
00472