get_ports NSSOAP Methods

The get_ports method retrieves the current configuration and activity of fax ports on a NET SatisFAXtion server.  The response from this method is a GET_PORTS_RESULT object, that contains port information in an array of PORT_INFO objects.  Each PORT_INFO object includes the port name and information about how the port is configured and the current state of the port.

If a fax port is actively sending or receiving, a Q_MESSAGE object is included in the returned PORT_INFO object.  The Q_MESSAGE object includes the handle of the active message plus real-time status information.

GET_PORTS_RESULT get_ports(
  string user_name, // Fax server user name
  string user_password // Fax server user password
)

Parameters:
user_name A NET SatisFAXtion user name.

user_password The password for the user.

Return Value:
A GET_PORTS_RESULT object containing a result code and string, and an array of PORT_INFO objects if the function was successful.

Example:
public int get_send_port_count()
  {
  NSSOAP ns = new NSSOAP();

  GET_PORTS_RESULT gpr = ns.get_ports("supervisor","");

  if (gpr.status_num == STATUS_NUM.NoError)
    {
    int send_port_count = 0;

    foreach (PORT_INFO pi in gpr.ports)
      {
        // Only count ports that are configured for sending

      if ((pi.port_config & PORT_CONFIG.Outbound) != 0)
        {
        send_port_count++;
        }
      }

    return(send_port_count);
    }

  return(0);
  }

See Also:
send_message, get_message_q, get_message