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())
}
QuerySmResp returns generic request PDU as pdu.QuerySmResp.
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())
}