fiorix / go-smpp

SMPP 3.4 Protocol for the Go programming language
MIT License
218 stars 135 forks source link

Implements generic_nack on ESME side #90

Open goten4 opened 4 years ago

goten4 commented 4 years ago

Hello,

How could I send a generic_nack PDU to SMS-C when my ESME receive an unsupported PDU ? Here is the handler that I provide to my Transceiver :

func handle(p pdu.Body) {
        switch p.Header().ID {
        case pdu.DeliverSMID:
            logger.Infof("Received DeliverSM PDU")
        case pdu.UnbindID:
            logger.Infof("Received Unbind PDU from SMS-C... shutting down !")
            stopGracefully()
        default:
            nack := pdu.NewGenericNACK()
            // TODO: send nack ... but how ?
            logger.Errorf("Received unknown pdu: %+v", p)
        }
    }

Any idea ?

Thanks ! Emmanuel