Comments (9)
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.
enquire_link is automatic
bind type is transmitter
PDU handler is OnAllPDU
from gosmpp.
How do you handle unbind request in OnAllPDU ?
from gosmpp.
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.
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.
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.
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.
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.
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)
- PDU/Network error: EOF on receive ESME_RTHROTTLED in submit sm resp HOT 6
- multipart message with our udh HOT 1
- Delivery Receipt Parameters HOT 12
- Long messages in the latest version HOT 6
- Relating submitted message with message id HOT 12
- is there a way to set a custom uuid with a short message and receive the uuid in reply/delivered callbacks? HOT 2
- ShouldSplit and Split behaviour when encoding is GSM7Bit HOT 7
- RX connector not working. Receiver not recieving data HOT 1
- Identification of current session is running or not HOT 1
- Setup addressRange for binding with SMSC HOT 1
- Do we support inactivity timers in this library? HOT 4
- Reconnecting to SMPP Server HOT 1
- how can save command string in log? HOT 2
- Store and Forward mode Option HOT 1
- General question not an issue! are delivery receipts and error codes standard and same across the platform? HOT 2
- Opening the ShortMessage HOT 6
- Implementation Question: Is there a way to check an error while hitting submit_sm ?
- Not receiving optional Parameters even after assigning them in submit_sm. HOT 6
- It's possible send flash sms? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gosmpp.