I have problem Asterisk do not terminate channel when member goes UNREACHABLE or UNREGISTERED.
I have Queue and some member. Member answer incoming call from Queue. If during the conversation member status would beUNREACHABLE or UNREGISTERED Asterisk do not terminate channel. Channel terminated after hangups call.from caller.
Note: i have option
rtptimeout = 10
Peer status have no any relation to channel state
Asterisk should not terminate channel.
rtptimout option have no relation to peer state. It will stop call on no rtp for 10 sec. So likly you have rtp.
Related
Say if I have an inproc-PAIR messaging system. Before the Receiver connects to the Sender, the Sender is already bound and starts sending out messages right away.
Now, before the connection succeeds, will ZMQ choose to do one of the following:
queue up those messages internally
block Sender from sending those messages
simply discard them?
I know that ZMQ has an internal queue of 1000 messages, and read that with PubSub it will send out messages right after binding happens and thus will lose messages. But I'm not sure about other protocols.
From the ZeroMQ documentation :
When a PAIR socket enters the mute state due to having reached the high water mark for the connected peer, or if no peer is connected, then any send operations on the socket will block until the peer becomes available for sending; messages are not discarded.
So your first two options are correct; it's queuing messages till you reach hwm then blocks the sender.
It is not dicarding messages.
How can i look on cli sip peer status like ringing, busy, in use, etc. Note that sip peer is not member any queue.
Sip peer status is reachable/unreachable.
What you have asked is device state. Asterisk have multiple method for check device state, for example you can do it via AMI or ARI
https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Devicestates+REST+API
I'm working on implementing TCP myself for a class project, and there's one detail I can't seem to understand. What is a FIN+ACK message? In the diagram I included here, receipt of a FIN+ACK will take a host from the FIN_WAIT_1 state to the TIME_WAIT state. Yet, NO state transition in the entire diagram sends a FIN+ACK. So how could a FIN+ACK ever be received if nothing is ever sending it?
When an application calls close it moves to FIN_WAIT_1
From FIN_WAIT_1 multiple things can happen:
Application receives ACK:
This means that the peer as acknowledged the last sent data packet. Local application moves to FIN_WAIT_2
Application receives FIN:
This indicates that peer has called close. And local application should acknowledge that. Hence ACK goes out to peer. Local application moves to CLOSING
Application receives FIN + ACK:
What FIN+ACK as you put it means is that the peer has called close as well as in the same TCP segment is acknowledging the data received last. Local application will acknowledge the FIN and this takes the state to TIME_WAIT.
TCP is defined by more than just that state diagram, the basic specification can be found in RFC 793. One particular statement is as follows (page 15, description of ACK field):
Once a connection is established this is always sent.
So basically this says an ACK must always be present after the initial three-way handshake, including during the four-way disconnect phase. There are subsequently only 2 messages that do not include an ACK:
The very first SYN as there is nothing to ACK
A RST as this usually means the connection state is non-existent or so messed up that an ACK does not make sense.
So to answer your question: in that diagram, whenever a FIN is sent, the ACK flag will also be set and an ACK nr will be present, even though it is not explicitly stated.
If it doesn't close in both directions, will it never close - regardless of expiration timers? - It can half-close but can the tcp connection terminate if only one initiates the close()?
In other words:
In TCP connection termination - can you close the connection fully when only the client initiates a close but the server does not.
Or can a tcp connection be closed by both ways independently?
Each peer can close the TCP connection independent from the other and the peer will simply get an EOF (e.g no more bytes) when it tries to read from the peer or get an ECONNRESET or EPIPE if it tries to write to a connection which was closed by the peer, but only if the socket is aware that the peer does not want to receive more data, see below.
Closing a connection consists actually of two parts:
Application will not send any more data: shutdown(sock,SHUT_WR). In this case the kernel will send a FIN to the peer so signalize that no more data will follow. Reading from the peer will return EOF.
Application does not want to receive more data: shutdown(sock,SHUT_RD). In this case no information will be send to the peer initially, but if data get received from the peer they will be rejected with RST.
A call of close() is thus equivalent of shutting down both sides of the connection at the same time (SHUT_RDWR).
I need to make the server close gracefully recently on Linux. I met some question.
After I close the listen socket fd,
can I recv and send data with already accepted fd?
can I continue accpet connection in the backlog finish queue?
can I recv and send data with already accepted fd?
Yes.
can I continue accpet connection in the backlog finish queue?
No. The listening socket is closed, the backlog queue has been destroyed, the pending connections have been refused, and all further operations on the socket are invalid.