func (ctx *Context) EnquireLink() (*pdu.EnquireLink, error) {
	if p, ok := ctx.req.(*pdu.EnquireLink); ok {
		return p, nil
	}
	return nil, fmt.Errorf("smpp: invalid cast PDU is of type %s", ctx.req.CommandID())
}
EnquireLink returns generic request PDU as pdu.EnquireLink.
package smpp
import (
	"context"
	"errors"
	"fmt"
	"github.com/ajankovic/smpp/pdu"
)
type Context struct {
	sess   *Session
	status pdu.Status
	ctx    context.Context
	seq    uint32
	req    pdu.PDU
	resp   pdu.PDU
	close  bool
}
func (ctx *Context) SystemID() string {
	return ctx.sess.conf.SystemID
}
func (ctx *Context) SessionID() string {
	return ctx.sess.ID()
}
func (ctx *Context) CommandID() pdu.CommandID {
	return ctx.req.CommandID()
}
func (ctx *Context) RemoteAddr() string {
	return ctx.sess.remoteAddr()
}
func (ctx *Context) Context() context.Context {
	return ctx.ctx
}
func (ctx *Context) Status() pdu.Status {
	return ctx.status
}
func (ctx *Context) Respond(resp pdu.PDU, status pdu.Status) error {
	ctx.status = status
	ctx.resp = resp
	if resp == nil {
		return errors.New("smpp: responding with nil PDU")
	}
	ctx.sess.mu.Lock()
	if err := ctx.sess.makeTransition(resp.CommandID(), false); err != nil {
		ctx.sess.conf.Logger.ErrorF("transitioning resp pdu: %s %+v", ctx.sess, err)
		ctx.sess.mu.Unlock()
		return err
	}
	if _, err := ctx.sess.enc.Encode(resp, pdu.EncodeStatus(status), pdu.EncodeSeq(ctx.seq)); err != nil {
		ctx.sess.conf.Logger.ErrorF("error encoding pdu: %s %+v", ctx.sess, err)
		ctx.sess.mu.Unlock()
		return err
	}
	ctx.sess.conf.Logger.InfoF("sent response: %s %s %+v", ctx.sess, resp.CommandID(), resp)
	ctx.sess.mu.Unlock()
	return nil
}
func (ctx *Context) CloseSession() {
	ctx.close = true
}
func (ctx *Context) GenericNack() (*pdu.GenericNack, error) {
	if p, ok := ctx.req.(*pdu.GenericNack); ok {
		return p, nil
	}
	return nil, fmt.Errorf("smpp: invalid cast PDU is of type %s", ctx.req.CommandID())
}
func (ctx *Context) BindRx() (*pdu.BindRx, error) {
	if p, ok := ctx.req.(*pdu.BindRx); ok {
		return p, nil
	}
	return nil, fmt.Errorf("smpp: invalid cast PDU is of type %s", ctx.req.CommandID())
}
func (ctx *Context) BindRxResp() (*pdu.BindRxResp, error) {
	if p, ok := ctx.req.(*pdu.BindRxResp); ok {
		return p, nil
	}
	return nil, fmt.Errorf("smpp: invalid cast PDU is of type %s", ctx.req.CommandID())
}
func (ctx *Context) BindTx() (*pdu.BindTx, error) {
	if p, ok := ctx.req.(*pdu.BindTx); ok {
		return p, nil
	}
	return nil, fmt.Errorf("smpp: invalid cast PDU is of type %s", ctx.req.CommandID())
}
func (ctx *Context) BindTxResp() (*pdu.BindTxResp, error) {
	if p, ok := ctx.req.(*pdu.BindTxResp); ok {
		return p, nil
	}
	return nil, fmt.Errorf("smpp: invalid cast PDU is of type %s", ctx.req.CommandID())
}
func (ctx *Context) QuerySm() (*pdu.QuerySm, error) {
	if p, ok := ctx.req.(*pdu.QuerySm); ok {
		return p, nil
	}
	return nil, fmt.Errorf("smpp: invalid cast PDU is of type %s", ctx.req.CommandID())
}
func (ctx *Context) QuerySmResp() (*pdu.QuerySmResp, error) {
	if p, ok := ctx.req.(*pdu.QuerySmResp); ok {
		return p, nil
	}
	return nil, fmt.Errorf("smpp: invalid cast PDU is of type %s", ctx.req.CommandID())
}
func (ctx *Context) SubmitSm() (*pdu.SubmitSm, error) {
	if p, ok := ctx.req.(*pdu.SubmitSm); ok {
		return p, nil
	}
	return nil, fmt.Errorf("smpp: invalid cast PDU is of type %s", ctx.req.CommandID())
}
func (ctx *Context) SubmitSmResp() (*pdu.SubmitSmResp, error) {
	if p, ok := ctx.req.(*pdu.SubmitSmResp); ok {
		return p, nil
	}
	return nil, fmt.Errorf("smpp: invalid cast PDU is of type %s", ctx.req.CommandID())
}
func (ctx *Context) DeliverSm() (*pdu.DeliverSm, error) {
	if p, ok := ctx.req.(*pdu.DeliverSm); ok {
		return p, nil
	}
	return nil, fmt.Errorf("smpp: invalid cast PDU is of type %s", ctx.req.CommandID())
}
func (ctx *Context) DeliverSmResp() (*pdu.DeliverSmResp, error) {
	if p, ok := ctx.req.(*pdu.DeliverSmResp); ok {
		return p, nil
	}
	return nil, fmt.Errorf("smpp: invalid cast PDU is of type %s", ctx.req.CommandID())
}
func (ctx *Context) Unbind() (*pdu.Unbind, error) {
	if p, ok := ctx.req.(*pdu.Unbind); ok {
		return p, nil
	}
	return nil, fmt.Errorf("smpp: invalid cast PDU is of type %s", ctx.req.CommandID())
}
func (ctx *Context) UnbindResp() (*pdu.UnbindResp, error) {
	if p, ok := ctx.req.(*pdu.UnbindResp); ok {
		return p, nil
	}
	return nil, fmt.Errorf("smpp: invalid cast PDU is of type %s", ctx.req.CommandID())
}
func (ctx *Context) ReplaceSm() (*pdu.ReplaceSm, error) {
	if p, ok := ctx.req.(*pdu.ReplaceSm); ok {
		return p, nil
	}
	return nil, fmt.Errorf("smpp: invalid cast PDU is of type %s", ctx.req.CommandID())
}
func (ctx *Context) ReplaceSmResp() (*pdu.ReplaceSmResp, error) {
	if p, ok := ctx.req.(*pdu.ReplaceSmResp); ok {
		return p, nil
	}
	return nil, fmt.Errorf("smpp: invalid cast PDU is of type %s", ctx.req.CommandID())
}
func (ctx *Context) CancelSm() (*pdu.CancelSm, error) {
	if p, ok := ctx.req.(*pdu.CancelSm); ok {
		return p, nil
	}
	return nil, fmt.Errorf("smpp: invalid cast PDU is of type %s", ctx.req.CommandID())
}
func (ctx *Context) CancelSmResp() (*pdu.CancelSmResp, error) {
	if p, ok := ctx.req.(*pdu.CancelSmResp); ok {
		return p, nil
	}
	return nil, fmt.Errorf("smpp: invalid cast PDU is of type %s", ctx.req.CommandID())
}
func (ctx *Context) BindTRx() (*pdu.BindTRx, error) {
	if p, ok := ctx.req.(*pdu.BindTRx); ok {
		return p, nil
	}
	return nil, fmt.Errorf("smpp: invalid cast PDU is of type %s", ctx.req.CommandID())
}
func (ctx *Context) BindTRxResp() (*pdu.BindTRxResp, error) {
	if p, ok := ctx.req.(*pdu.BindTRxResp); ok {
		return p, nil
	}
	return nil, fmt.Errorf("smpp: invalid cast PDU is of type %s", ctx.req.CommandID())
}
func (ctx *Context) Outbind() (*pdu.Outbind, error) {
	if p, ok := ctx.req.(*pdu.Outbind); ok {
		return p, nil
	}
	return nil, fmt.Errorf("smpp: invalid cast PDU is of type %s", ctx.req.CommandID())
}