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 #ifndef __OPAL_SVCCTRL_H
00035 #define __OPAL_SVCCTRL_H
00036
00037 #ifdef P_USE_PRAGMA
00038 #pragma interface
00039 #endif
00040
00041
00042 class H225_ServiceControlDescriptor;
00043 class H225_ServiceControlIndication;
00044 class H225_ServiceControlResponse;
00045
00046 class H248_SignalsDescriptor;
00047 class H248_SignalRequest;
00048
00049 class H323EndPoint;
00050 class H323Connection;
00051
00052
00054
00058 class H323ServiceControlSession : public PObject
00059 {
00060 PCLASSINFO(H323ServiceControlSession, PObject);
00061 public:
00066 H323ServiceControlSession();
00068
00076 virtual BOOL IsValid() const = 0;
00077
00085 virtual PString GetServiceControlType() const;
00086
00094 virtual BOOL OnReceivedPDU(
00095 const H225_ServiceControlDescriptor & descriptor
00096 ) = 0;
00097
00105 virtual BOOL OnSendingPDU(
00106 H225_ServiceControlDescriptor & descriptor
00107 ) const = 0;
00108
00109 enum ChangeType {
00110 OpenSession,
00111 RefreshSession,
00112 CloseSession
00113 };
00114
00119 virtual void OnChange(
00120 unsigned type,
00121 unsigned sessionId,
00122 H323EndPoint & endpoint,
00123 H323Connection * connection
00124 ) const = 0;
00125
00126 enum serviceType {
00127 e_URL,
00128 e_Signal,
00129 e_NonStandard,
00130 e_CallCredit
00131 };
00132
00133 virtual serviceType GetType() = 0;
00135 };
00136
00137
00141 class H323HTTPServiceControl : public H323ServiceControlSession
00142 {
00143 PCLASSINFO(H323HTTPServiceControl, H323ServiceControlSession);
00144 public:
00149 H323HTTPServiceControl(
00150 const PString & url
00151 );
00152
00155 H323HTTPServiceControl(
00156 const H225_ServiceControlDescriptor & contents
00157 );
00159
00167 virtual BOOL IsValid() const;
00168
00176 virtual PString GetServiceControlType() const;
00177
00183 virtual BOOL OnReceivedPDU(
00184 const H225_ServiceControlDescriptor & contents
00185 );
00186
00192 virtual BOOL OnSendingPDU(
00193 H225_ServiceControlDescriptor & contents
00194 ) const;
00195
00200 virtual void OnChange(
00201 unsigned type,
00202 unsigned sessionId,
00203 H323EndPoint & endpoint,
00204 H323Connection * connection
00205 ) const;
00206
00207 serviceType GetType() { return e_URL; };
00208
00209 void GetValue(PString & _url) { _url = url; }
00211
00212 protected:
00213 PString url;
00214 };
00215
00216
00219 class H323H248ServiceControl : public H323ServiceControlSession
00220 {
00221 PCLASSINFO(H323H248ServiceControl, H323ServiceControlSession);
00222 public:
00227 H323H248ServiceControl();
00228
00231 H323H248ServiceControl(
00232 const H225_ServiceControlDescriptor & contents
00233 );
00235
00244 virtual BOOL OnReceivedPDU(
00245 const H225_ServiceControlDescriptor & contents
00246 );
00247
00254 virtual BOOL OnSendingPDU(
00255 H225_ServiceControlDescriptor & contents
00256 ) const;
00257
00264 virtual BOOL OnReceivedPDU(
00265 const H248_SignalsDescriptor & descriptor
00266 );
00267
00274 virtual BOOL OnSendingPDU(
00275 H248_SignalsDescriptor & descriptor
00276 ) const;
00277
00283 virtual BOOL OnReceivedPDU(
00284 const H248_SignalRequest & request
00285 ) = 0;
00286
00292 virtual BOOL OnSendingPDU(
00293 H248_SignalRequest & request
00294 ) const = 0;
00295
00296 serviceType GetType() { return e_Signal; };
00298 };
00299
00300
00303 class H323CallCreditServiceControl : public H323ServiceControlSession
00304 {
00305 PCLASSINFO(H323CallCreditServiceControl, H323ServiceControlSession);
00306 public:
00311 H323CallCreditServiceControl(
00312 const PString & amount,
00313 BOOL mode,
00314 unsigned duration = 0
00315 );
00316
00319 H323CallCreditServiceControl(
00320 const H225_ServiceControlDescriptor & contents
00321 );
00323
00331 virtual BOOL IsValid() const;
00332
00338 virtual BOOL OnReceivedPDU(
00339 const H225_ServiceControlDescriptor & contents
00340 );
00341
00347 virtual BOOL OnSendingPDU(
00348 H225_ServiceControlDescriptor & contents
00349 ) const;
00350
00356 virtual void OnChange(
00357 unsigned type,
00358 unsigned sessionId,
00359 H323EndPoint & endpoint,
00360 H323Connection * connection
00361 ) const;
00362
00363 serviceType GetType() { return e_CallCredit; };
00364
00365 void GetValue(PString & _amount,BOOL & _credit, unsigned & _time)
00366 { _amount = amount; _credit = mode; _time = durationLimit;}
00368
00369 protected:
00370 PString amount;
00371 BOOL mode;
00372 unsigned durationLimit;
00373 };
00374
00375
00376 #endif // __OPAL_SVCCTRL_H
00377
00378