The callback is only invoked when the call is CONNECTED (becomes
active). Cancel ensures that the callback will not be called and
does nothing more in this version, it's an open question if we
want to release the call.
This patch fixes problem for modems that cannot terminate
DIALING/ALERTING calls with CHUP=1X. The main change is that
voicecall driver's hangup function is split into the functions
hangup_all and hangup_active.
Changes:
- In cases where hangup previously was used, hangup_all is used
if implemented otherwise hangup_active is used.
- Call in state DIALING/ALERTING is released with hangup_active if
implemented.
- manager_hangup_all will simply call hangup_all if implemented.
- manager_hangup_all will release calls in state
ALERTING/DIALING/INCOMING using hangup_active otherwise
release_specific.
The driver has a better idea of how to handle ATD being invoked when
a waiting/held/active call(s) is/are already present. Generally most
modems will swap the call automatically preserving the state of the
waiting call.
We do block dialing another call while a dial is still in progress.
According to 22.030, UDUB or CHLD=0 can only be invoked on waiting
calls. Most AT command based modems do not support using CHLD=0 on an
incoming call. So we remove the Busy method and invoke set_udub on
a call that is in the waiting state.
The logic for dialing a call while other calls are in the system is a
bit more complicated than what was implemented.
There are several cases to consider:
- Active Call and Held Call
In this situation we cannot dial, the user must drop one of the
calls.
- Active Call and Waiting Call -> We have to put the active call on
hold, unfortunately there is no standard command to do so without
affecting the waiting call. If the modem has a vendor specific
implementation, then try to use that.
- Active Call only -> Put the active call on hold. We use the
swap_without_accept implementation (if exists) to be safe, otherwise
we fall back to hold active calls.
- No Active calls -> Simply dial