chan-sccp / PAMI

Fork of PHP Asterisk Manager Interface ( AMI ) supports synchronous command ( action )/ responses and asynchronous events using the pattern observer-listener. Supports commands with responses with multiple events. Very suitable for development of operator consoles and / or asterisk / channels / peers monitoring through SOA, etc
http://marcelog.github.com/PAMI
Apache License 2.0
26 stars 21 forks source link

Process method hits TCP Zero Window #25

Open VijeshDatt opened 1 year ago

VijeshDatt commented 1 year ago

Hi there,

I am not really sure if this is a PAMI issue but I thought you'd know maybe a solution as I've exhausted everything else.

One of my connections using this package basically hits a point (maybe 1 hour of constant running later) whereby the process method will continuously wait for a message from the connection but never gets anything. Running a TCP Dump showed that the connection ran into a TCP Zero Window error however the connection doesn't see that and continues waiting until manually halted and re-run.

I run the scripts using SupervisorD so restarting using that helps but it's a recurring issue that is causing us problems and if someone isn't around to restart them then we are losing countless messages. Hopefully you'd have a possible solution to having the connection kill itself or restart itself when the process method hangs waiting for messages?

PHP changes and anything server related doesn't help

91Abdullah commented 1 year ago

I'm also facing this issue. For example, this usually happens on weekends that process gets halted and empty response is returned. As soon as I open asterisk console the messages starts to receive. I don't know exactly what is causing this strange issue? @VijeshDatt if you can kindly elaborate what are you experiencing regarding this issue? And how can we be sure if it is being caused by asterisk or PAMI?

VijeshDatt commented 1 year ago

@91Abdullah For us, we weren't exactly sure what was causing this issue but what would happen was that after maybe 1-2 hours of connectivity and data transfer, one of our long distance Asterisk Nodes would stop sending back information but the connection via PAMI would remain open and basically stuck in the process loop. Had a colleague run a TCP dump when the error occurred (it would always be at a particular time) and we found that the connection ran into a TCP Zero Window error.

However, we moved servers recently and the error has been resolved, without changes to the core coding from our end or changing of the package. So at this point, we're assuming it was the issue of the apache (old) server connecting to the asterisk node to get the info. PAMI is most likely not the issue however your mileage may vary.