code: func (c *Client) Authenticate() error {
  
  	m, err := newMessage(bufio.NewReaderSize(c, ReadBufferSize), false)
  	if err != nil {
  		Error(ECouldNotCreateMessage, err)
  		return err
  	}
  
  	cmr, err := m.tr.ReadMIMEHeader()
  	if err != nil && err.Error() != "EOF" {
  		Error(ECouldNotReadMIMEHeaders, err)
  		return err
  	}
  
  	Debug("A: %v\n", cmr)
  
  	if cmr.Get("Content-Type") != "auth/request" {
  		Error(EUnexpectedAuthHeader, cmr.Get("Content-Type"))
  		return fmt.Errorf(EUnexpectedAuthHeader, cmr.Get("Content-Type"))
  	}
  
  	s := "auth " + c.Passwd + "\r\n\r\n"
  	_, err = io.WriteString(c, s)
  	if err != nil {
  		return err
  	}
  
  	am, err := m.tr.ReadMIMEHeader()
  	if err != nil && err.Error() != "EOF" {
  		Error(ECouldNotReadMIMEHeaders, err)
  		return err
  	}
  
  	if am.Get("Reply-Text") != "+OK accepted" {
  		Error(EInvalidPassword, c.Passwd)
  		return fmt.Errorf(EInvalidPassword, c.Passwd)
  	}
  
  	return nil
  }
docs: // Authenticate - Method used to authenticate client against freeswitch. In case of any errors durring so
  // we will return error.