Send

CAS ActiveX Methods

The Send method sends a function taglist to the CAS driver, to be processed by the CAS driver locally, or to be processed remotely by a NET SatisFAXtion server.  Certain CAS functions, such as LOGON, LOGOFF, OPEN_SESSION, and CLOSE_SESSION are handled by the local CAS driver, and are used to manage network sessions associated with a CAS instance.  When a CAS instance has an open session with a NET SatisFAXtion server, the Send method sends taglists to, and returns taglists from that server.

The Send method deletes the input taglist.  Use the DupTagList method prior to calling Send if you need to preserve a copy of the input taglist.

The return value from Send is a response taglist from the called function.

LONG Send(
  LONG Instance, // CAS instance with which to send
  LONG TagList // Function taglist to send
)

Parameters:
Instance CAS instance with which to send.  If a session with a CAS server has been opened for this instance, then the Send method will send the taglist to that CAS server for processing.

TagList Function taglist to send.  The first tag in the taglist should be a function tag that will be recognized either by the local CAS driver, or if a session is currently open, by the remote CAS server that will receive the taglist. 

This taglist will be deleted by the Send method.  Use the DupTagList method prior to calling Send if you need to preserve a copy of the input taglist.

Return Values:
Response taglist from the function.  Most functions include the tag STATUS_NUM in the response taglist, which can be retrieved with GetTag.  A non-zero value for STATUS_NUM signifies an error condition.

You must pass this taglist to Delete when you are done using it.

Example:
function LogOn()
 {
 var CAS_instance;

   // Get access to CAS interface and open an instance

 if (CAS = new ActiveXObject("CASX.CAS"))
   {  
   if (CAS_instance = CAS.Open(0,"",0)) 
     {
     var Tl, UniqueName, StatusNum;

       // Logon to the connection router
        
     Tl = CAS.New();
     CAS.AddTag(Tl,"LOGON","");
     UniqueName = "XYZ-"+parseInt(Math.random()*1000000+1000000);
     CAS.AddTag(Tl,"LOGON_NAME",UniqueName);
     CAS.AddTag(Tl,"DOMAIN_NAME","\\\\CASDEV\\NETSATISFAXTION");
     CAS.AddTag(Tl,"PROTOCOL",2); // IP

       // Send taglist to CAS driver, to logon to domain

     Tl = CAS.Send(CAS_instance,Tl);
     StatusNum = parseInt(CAS.GetTag(Tl,"STATUS_NUM",0));
     CAS.Delete(Tl);
      
     if (StatusNum == 0)
       {
       return(
CAS_instance);
       }
        
     CAS.Close(CAS_instance);
     }
   }

 return(null);
 }

See Also:
CAS New, CAS AddTag, CAS GetTag, CAS Delete