package uk.co.mmscomputing.device.capi.facility; /* HOLD (Call Hold, ETS 300 139) TP (Terminal Portability, ETS 300 053) CF (Call Forwarding, ETS 300 199-201) CD (Call Deflection, ETS 300 202) ECT (Explicit Call Transfer, ETS 300 367) 3PTY (Three-Party-Conference, ETS 300 186) MCID (Malicious Call Identification, ETS 300 128) CCBS (Completion of Calls to Busy Subscriber, ETS 300 359-1 excluding Section 10) MWI (Message Waiting Indication, ETS 300 650) CCNR (Completion of Calls on No Reply, ETS 301 065) CONF (Conference call, ETS 300 185-1) */ import javax.swing.tree.*; import uk.co.mmscomputing.device.capi.*; public class SupServiceConf extends FacilityConf{ protected int function; public SupServiceConf(Rider r){ super(r); function=r.readWord(); // supplementary services function r.structBegin(); // supplementary service-specific parameter } static public MsgIn create(Rider r){ int function=r.readWord(); // supplementary services function r.structBegin(); // supplementary service-specific parameter switch(function){ case CAPI_SERVICES_GETSUPPORTEDSERVICES: return new SupServiceConf.GetSupportedServicesConf(r); case CAPI_SERVICES_LISTEN: return new SupServiceConf.ListenConf(r); case CAPI_SERVICES_HOLD: return new SupServiceConf.HoldConf(r); case CAPI_SERVICES_RETRIEVE: return new SupServiceConf.RetrieveConf(r); case CAPI_SERVICES_ECT: return new SupServiceConf.ECTConf(r); case CAPI_SERVICES_CF_ACTIVATE: return new CallForwardConf.ActivateConf(r); case CAPI_SERVICES_CF_DEACTIVATE: return new CallForwardConf.DeactivateConf(r); case CAPI_SERVICES_CF_INTERROGATEPARAMETERS: return new CallForwardConf.InterrogateParametersConf(r); case CAPI_SERVICES_CF_INTERROGATENUMBERS: return new CallForwardConf.InterrogateNumbersConf(r); case CAPI_SERVICES_CD: return new CallDeflectionConf(r); } throw new IllegalArgumentException(); } public int getFunctionNo(){ return function;} public String toString(){ String s=super.toString(); s+="function : "+function+"\n\t"; return s; } static public class GetSupportedServicesConf extends SupServiceConf{ static final private String[] serviceStrings={ "Hold/Retrieve", "Terminal Portability", "Explicit Call Transfer", "Three-Party-Conference", "Call-Forwarding", "Call-Deflection", "Malicious Call Identification", "Completion of Calls to Busy Subscriber", "Message Waiting Indication", "Completion of Calls on No Reply", "Conference call" }; private int services; public GetSupportedServicesConf(Rider r){ super(r); if(info==0){ info=r.readWord(); // success services=r.readDWord(); } } public int getSupportedServices(){ return services;} public boolean isSupported(int bit){ return (services&(1<