Suppose Peer A is registered with Asterisk and it issues a call to Peer B who happens to be disconnected and unregistered due to a network problem for example. Is it possible for Asterisk to wait and retry (for a certain timeout period) until Peer B is reconnected and registered in order to establish the initial call? Or would Asterisk systematically cause Peer A to disconnect because Peer B was unavailable when A first issued the call request? According to our tests, and using Asterisk default configuration, when Peer A tries to call Peer B, the call is disconnected if Peer B is not registered. In other words, Asterisk doesn’t seem to be able to wait (for a defined timeout period) for Peer B to register itself before asking Peer B to disconnect. However, this seems possible using Linphone server and we would love to have this feature with Asterisk. So the desired behavior is the following:
a) Peer A is registered and sends an INVITE to Peer B.
b) Asterisk finds that Peer B is unavailable.
c) Asterisk waits for a certain period (i.e. a timeout value) until B registers itself – and maybe asks Peer A to wait or to be put on hold meanwhile(??)
d) If B is registered before timeout, Asterisk sends the initial INVITE message to B (as it would have normally done if B was initially registered when A issued the call.)
e) B rings and the call is successful despite the fact that B was unavailable when A sent the first INVITE message.
Peer A is talking to Peer B. Peer B is momentarily disconnected due to network switch (e.g. 4G to WIFI) or connection issue. Is it possible for Asterisk (instead of dropping the call) to wait for a defined timeout period so that if Peer B is reconnected and registered quickly enough, the same call is resumed automatically? If this is not possible, what do you think is the best way to handle call resuming when a peer is disconnected during a call?
Asterisk is a toolkit, so primitives to implement a lot of things exist. Wait can wait in the dialplan, there’s the ability to check the state of a device, etc. It’s up to you to put the pieces together to make what you need. This is what David is referring to - learning the basics and what primitives exist.
But I am using the realtime database mode and my dialplan is in the extension table I guess. Currently, I have the Dial app mentioned under the ‘app’ column for all peers. ‘appdata’ is SIP/extension for all peers. I am not sure how to proceed… should I alter my table or can I fit the required dialplan code in the same table?
How can I achieve this using realtime database please? Are there any examples?
OK I guess I will have to look for examples on how to add the right instructions in the dialplan for each extension in order to solve my issues. There must be applications and functions I suppose which allow to wait until the called party is available. I have zero experience in dialplan programming. Would you please recommend a good starting point and/or any examples to begin with?