Giter Club home page Giter Club logo

Comments (9)

laduchesneau avatar laduchesneau commented on August 24, 2024

We will need more info to help you, the pcap doesnt show call flow, who is sending the enquire_link ?
Lets start with the basics:

  • What Bind type ?
  • What PDU handler are you using, OnPDU or OnAllPDU ?

from gosmpp.

parsibox avatar parsibox commented on August 24, 2024

enquire_link is automatic
bind type is transmitter
PDU handler is OnAllPDU

from gosmpp.

laduchesneau avatar laduchesneau commented on August 24, 2024

How do you handle unbind request in OnAllPDU ?

from gosmpp.

parsibox avatar parsibox commented on August 24, 2024
OnPDU: PDUController(),
 
func PDUController() func(pdu2.PDU, bool) {
	return func(p pdu2.PDU, _ bool) {
		pduHeader := p.GetHeader()
		if pduHeader.CommandID.String() != "ENQUIRE_LINK_RESP" && pduHeader.CommandID.String() != "ENQUIRE_LINK" {
			file_logger_controller.AllReceivedPDUsController(map[string]interface{}{
				"CommandIDType":  pduHeader.CommandID.String(),
				"CommandLength":  pduHeader.CommandLength,
				"CommandStatus":  pduHeader.CommandStatus,
				"SequenceNumber": pduHeader.SequenceNumber,
			})
		}

		switch pd := p.(type) {
		case *pdu2.SubmitSMResp:
			SubmitResponseController(p)
		case *pdu2.GenericNack:
			//fmt.Println("GenericNack Received")
		case *pdu2.EnquireLinkResp:
			
		case *pdu2.BindRequest:
			BindRequestController(p)
		case *pdu2.BindResp:
			BindResponseController(p)
		case *pdu2.Unbind:
			UnbindController(p)
		case *pdu2.UnbindResp:
			UnbindResponseController(p)
		case *pdu2.DataSM:
			//fmt.Println("DataSM Received")
		case *pdu2.DeliverSM:
			DeliveryAndReceiveController(p)
			p.IsGNack()

		}

	}
}


func UnbindController(p pdu2.PDU) {
	switch pd := p.(type) {
	case *pdu2.Unbind:

		pduMap := map[string]interface{}{
			"Type":               "Unbind",
			"CommandIDType":      pd.CommandID.String(),
			"CommandLength":      pd.CommandLength,
			"CommandStatus":      pd.CommandStatus,
			"SequenceNumber":     pd.SequenceNumber,
			"OptionalParameters": pd.OptionalParameters,
			"DateTime":           time.Now().UTC().Add(time.Duration(time_zone_config.TimeZoneMinute) * time.Minute),
		}

		file_logger_controller.NewSessionSMSController(pduMap)

	}
}

from gosmpp.

laduchesneau avatar laduchesneau commented on August 24, 2024

The code example provide is using OnPDU, not OnAllPDU. The difference is that the Unbind request from the SMSC is automatically responded too. This also means that if the bind get closed, the enquire_link should also stop. But you are saying the enquire_link continue working, just the other submits arent.

Both the loop for sending enquire_link and the submit use the same write function call in transmitable.go .

for {
		select {
		case <-ticker.C:
			eqp := pdu.NewEnquireLink()
			n, err := t.write(eqp)
			if t.check(eqp, n, err) {
				return
			}

		case p, ok := <-t.input:
			if !ok {
				return
			}

			if p != nil {
				n, err := t.write(p)
				if t.check(p, n, err) {
					return
				}
			}
		}
	}

Are you logging something from the OnClosed func call ? If yes, are you seeing any logs ?

from gosmpp.

parsibox avatar parsibox commented on August 24, 2024

yes i receive disconnect from OnClosed and i manually start create new session but when new session start submit_sm not work or connect some times not work , some times hand shake not start
is there any limitation for create new session in your lib?
i think there is some problem in rebind manually , we can not close old session correct

from gosmpp.

laduchesneau avatar laduchesneau commented on August 24, 2024

i manually start create new session

You dont need to start a new session ? Let the library reconnect for you.

But when you create the new session, do you assign it back to your Submit func ? I believe this is your issue.... Your function is still pointing to the old session.

from gosmpp.

parsibox avatar parsibox commented on August 24, 2024

i check it but new session hanged on connect in your library code
i think something is in your lib
can you create a test for have reconnect manualy?

from gosmpp.

laduchesneau avatar laduchesneau commented on August 24, 2024

If you provide a test that shows your issue/failure, I would gladly try and help you resolve it.

If you need a new feature, feel free to submit a PR.

from gosmpp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.