ajankovic / smpp

Go library for SMPP 3.4
MIT License
24 stars 21 forks source link

Context.sess should be public ? #9

Open goten4 opened 4 years ago

goten4 commented 4 years ago

Hi,

I'm implementing an SMPP server, and my server is waiting for ESME connections. So I wrote the following handler :

    sessConf := smpp.SessionConf{
        SystemID: systemID,
        Handler: smpp.HandlerFunc(func(ctx *smpp.Context) {
            switch ctx.CommandID() {
            case pdu.BindTransceiverID:
                // store ctx.Sess to reuse it for sending Delivery Receipt and MO
            case pdu.SubmitSmID:
                // manage MT
            }
        }),
    }

In the case of BindTransceiverID PDU, I would like to be able to store context session, in order to reuse it later (when sending back Delivery Receipt for example). To do that, I should have a way to access to the session of the context. I can create a Pull Request to make it public if you'd like.

Maybe I missed something, but I didn't find a way to send my DeliverSM PDU.

Thanks, Emmanuel

freedom9527 commented 4 years ago

Hi @goten4 , Do you have any way to solve this problem?

goten4 commented 4 years ago

Hi @freedom9527, I'm using this library in a fake SMPP server, so I forked and made the Context.Sess variable public. I'd prefer a better approach :)

freedom9527 commented 4 years ago

I also make a fake SMPP server, It can send DeliverSM PDU to the client after fixed #10 ,Thanks @goten4

Munmendu commented 4 years ago

Hi Freedom9527, Could you please help how you are able to trigger DeliverSM PDU to client

freedom9527 commented 3 years ago

Hi Freedom9527, Could you please help how you are able to trigger DeliverSM PDU to client

When client bind transceiver, made the Context.Sess variable public.