summaryrefslogtreecommitdiffstats
path: root/drivers/hfpmodem/voicecall.c
AgeCommit message (Collapse)AuthorFilesLines
2016-01-12hfpmodem: Handle repeated held call indicatorKuba Pawlak1-0/+11
An issue with iPhone 5C iOS 9.2 triggers desynchronization in call states. When an active call is put on hold and another call arrives, it is in WAITING state. It should be possible to answer it by issuing AT+CHLD=2 but the phone changes its state to INCOMING so ATA should be used. This change is advertised by sending callheld:2 event, but it is not handled. This event can be used to trigger CLCC poll to synchronize call states. +CIEV: 3,1 <- first call arrives AT+CLCC +CLCC: 1,1,4,0,0,"01234567890",129 OK RING +CLIP: "01234567890",129 ATA OK +CIEV: 2,1 +CIEV: 3,0. AT+CHLD=2.$ <- first call is put on hold OK +CIEV: 7,2 <- notification confirming that call #1 is on hold +CCWA: "09876543210",129,1 <- second call arrives +CIEV: 7,2 +CIEV: 3,1 AT+CLCC +CLCC: 1,1,1,0,0,"01234567890",129 +CLCC: 2,1,5,0,0,"09876543210",129 <- new call is still in WAITING state OK +CIEV: 7,2 <- phone iternally promotes WAITING call to INCOMING AT+CHLD=2 <- there is no WAITING call anymore, ATA should be used +CME ERROR:3
2015-08-24hfp: Handle extra CCWA eventKuba Pawlak1-0/+10
When a call is waitng, CCWA event is sent and call object in state WAITING is created. on ReleaseAndAnswer it is promoted to INCOMING and later to ACTIVE. iPhones send an extra CCWA event when active call is ended. This extra event is creating a second call object in state WAITING. It is not possible to have two WAITING calls, but previously waiting call was already promoted to INCOMING. For a brief time we have two calls from the same number, one INCOMING and one WAITING. Later WAITING one is removed. As we cannot have a waiting and incoming call at the same time, ignore CCWA when there is already an INCOMING call. < \r\n+CIEV: 3,3\r\n < \r\n+CIEV: 2,1\r\n < \r\n+CIEV: 3,0\r\n < \r\n+CCWA: "01234567890",129,1,"Me"\r\n < \r\n+CIEV: 3,1\r\n > AT+CLCC\r < \r\n+CLCC: 1,0,0,0,0,"09876543210",129,"Me"\r\n < \r\n+CLCC: 2,1,5,0,0,"01234567890",129,"Me"\r\n < \r\nOK\r\n < \r\n+CIEV: 2,0\r\n < \r\n+CCWA: "01234567890",129,1,"Me"\r\n < \r\n+CIEV: 2,1\r\n < \r\n+CIEV: 3,0\r\n > AT+CLCC\r < \r\n+CLCC: 2,1,0,0,0,"01234567890",129,"Me"\r\n < \r\nOK\r\n
2015-08-05hfp: Synchronize call state in case of +CHUP errorKuba Pawlak1-0/+4
It is possible for the phone to accept Dial request but not actually dial. This leaves a voicecall object in state 'dialling' that cannot be removed. Proposed workaround is to trigger AT+CLCC when an error is returned for Hangup. As the call is not on the list, this would remove this hanging object and signal CallRemoved. Windows Phone trace with this fix: ofonod[273]: > ATD1;\r ofonod[273]: < \r\nOK\r\n ofonod[273]: src/voicecall.c:dial_handle_result() Registering new call: 1 ofonod[273]: < \r\n+CIEV: 5,4\r\n ofonod[273]: src/network.c:ofono_netreg_strength_notify() strength 80 ofonod[273]: > AT+CHUP\r ofonod[273]: < \r\nERROR\r\n ofonod[273]: src/voicecall.c:generic_callback() command failed with error: Unknown error type ofonod[273]: > AT+CLCC\r ofonod[273]: < \r\nOK\r\n ofonod[273]: src/voicecall.c:ofono_voicecall_disconnected() Got disconnection event for id: 1, reason: 2
2015-06-04hfpmodem: Fix connecting to AG with existing mptyKuba Pawlak1-0/+20
If there is more then one active or held call, we are in mpty calls. We won't get indicator update if any of them is released by CHLD=1x. So we have to poll it.
2015-02-20hfpmodem: Make sure to use none_prefixDenis Kenzior1-2/+2
ofonod[253]: > AT+CCWA=1\r ofonod[253]: < \r\n+BCS:2\r\n ofonod[253]: < \r\nOK\r\n
2014-06-30hfpmodem: Fix crash with more than two callsSergio Checa Blanco1-1/+1
A periodic CLCC polling is started when there is an ongoing multiparty call and a new call appears in the system. A simple way to reproduce the crashing scenario is: 1. Place a call. 2. Place a second call. 3. Create a multiparty call with both calls. 4. Place a third call (incoming or outgoing does not matter). 5. Disconnect HFP from the modem. Within the function ciev_callheld_notify, the AT+CLCC command is also invoked, thus a new cyclic CLCC polling is started, and it overwrites the timer resource identifier stored in voicecall_data.clcc_source. This means that there are several timers doing the CLCC polling, but only one of those is under control, i.e. it can be removed through its source identifier, hence a timer source leak. This has a fatal consequence when the HFP modem is disconnected. The function hfp_voicecall_remove stops the timer that is under control before freeing the voicecall_data struct. However there are other timers that are still active and will execute its handler poll_clcc afterwards. Inside poll_clcc the driver_data is accessed, which is already NULL. A solution for this is to avoid starting a CLCC polling if there is already one active, i.e. clcc_source is not 0. By doing this the uncontrolled timers will not cycle forever.
2014-06-21hfpmodem: Split AT+VTS command into multiple +VTSSergio Checa Blanco1-3/+8
According to the standard "3GPP 27.007 v6.8.0" Appendix C.2.11, when sending multiple DTMF characters, these must go in individual +VTS commands for each tone. This adopts the AT modem approach. Before: AT+VTS=1234\r After: AT+VTS=1;+VTS=2;+VTS=3;+VTS=4\r
2014-05-30hfp: Fix case where RING never arrivesDenis Kenzior1-1/+28
2014-03-19hfp: Use enum from hfp.hDenis Kenzior1-8/+9
2013-09-12hfpmodem: Call ofono_voicecall_mpty_hint as neededDenis Kenzior1-2/+7
2013-08-25hfp: Set UDUB affected set to WAITING onlyDenis Kenzior1-2/+1
INCOMING calls are not affected by UDUB, only by +CHUP.
2013-08-25hfp: Fix up disconnect reason handling for +CHUPDenis Kenzior1-1/+6
The affected call types for +CHUP were set to only ACTIVE calls. Instead the affected set should include INCOMING, DIALING, ALERTING and ACTIVE calls. Thanks to Ionut Dediu for the diagnosing and reporting this issue.
2013-01-21hfpmodem: Add comment for previous commitDenis Kenzior1-0/+5
2013-01-21hfpmodem: Fix release-and-swap without +CIEVMikel Astiz1-1/+45
Some phones do not send the corresponding call state update (+CIEV) after a successful release-and-swap operation (AT+CHLD=1). This has been observed with a Nokia 500, while testing ReleaseAndSwap() while an active and a held call exist: ofonod[20414]: > AT+CLCC\r ofonod[20414]: < \r\n+CLCC: 1,0,1,0,0,"<number1>",145\r\n ofonod[20414]: < \r\n+CLCC: 2,0,0,0,0,"<number2>",145\r\n ofonod[20414]: < \r\nOK\r\n ofonod[20414]: > AT+CHLD=1\r ofonod[20414]: < \r\nOK\r\n After this, no +CIEV is received, but the call has been hung up. The proposed approach to solve this consists of using AT+CLCC, unless a call release has been received within a specific time period. The result fixes the problem as can be seen below: ofonod[20847]: < \r\n+CLCC: 1,0,1,0,0,"<number1>",145\r\n ofonod[20847]: < \r\n+CLCC: 2,0,0,0,0,"<number2>",145\r\n ofonod[20847]: < \r\nOK\r\n ofonod[20847]: > AT+CHLD=1\r ofonod[20847]: < \r\nOK\r\n ofonod[20847]: > AT+CLCC\r ofonod[20847]: < \r\n+CLCC: 1,0,0,0,0,"<number1>",145\r\n ofonod[20847]: < \r\nOK\r\n ofonod[20847]: < \r\n+CIEV: 5,2\r\n ofonod[20847]: < \r\n+CIEV: 5,0\r\n
2013-01-21hfpmodem: Avoid transitional voicecall statesMikel Astiz1-2/+12
While processing the result of AT+CLCC, process the differences in a way that disconnections are reported first, then call state changes and finally new calls. The goal is to avoid unnecessary transitional states such as two active calls existing at the same time.
2013-01-21hfpmodem: Refactor voicecall notify with foreachMikel Astiz1-3/+9
Define a helper function in order to use foreach statements when ofono_voicecall_notify() needs to be called.
2012-04-11hfpmodem: use full CLCC handling in dialing caseMichael Brudevold1-67/+1
A call that moves from the dialing to active state before the +CLCC response will not properly be added as a voicecall. This is because the dialing callback was using simplified handling and only looked for calls in the dialing or alerting state. AT sequence that exhibited the failure (AG device was an iPhone accessing visual voicemail): > +CIND: ("service",(0-1)),("call",(0-1)),("callsetup",(0-3)), ("battchg",(0-5)),("signal",(0-5)),("roam",(0-1)),("callheld",(0-2)) ... > +CIEV: 3,2 < AT+CLCC > +CIEV: 2,1 > +CIEV: 3,0 > +CLCC: 1,0,0,0,0,"**21153**",129,"Voicemail"
2011-10-10drivers: Update copyright informationMarcel Holtmann1-1/+1
2011-08-05hfpmodem: Fix g_at_chat leakFrédéric Dalleau1-0/+1
2011-07-25hfpmodem: fix callheld indicatorFrédéric Danis1-1/+15
Callheld move from 1 (active and held calls) to 2 (all calls on hold) may result of: - active call has been dropped by remote, - an intermediate state during a call swap which will be followed by a move back to 1. So, wait a little before checking calls state.
2011-07-21hfp_hf: Reorganize common code into hfpmodemDenis Kenzior1-8/+10
2011-03-17hfp: Fix some whitespace issuesDenis Kenzior1-2/+2
2011-02-05hfpmodem: M16 coding style fixJeevaka Badrappan1-1/+1
2011-02-05hfpmodem: Use defined call_status enumJeevaka Badrappan1-5/+7
2011-02-01hfpmodem: use ofono_call initializerLucas De Marchi1-1/+3
2011-01-29hfpmodem: remove NULL checkJeevaka Badrappan1-4/+0
2011-01-26voicecall: remove ofono_cug_optionJeevaka Badrappan1-2/+2
2011-01-14hfpmodem: Incorrect string length in dtmf buf.Helen Clemson1-3/+2
Strlen includes a NULL character.
2011-01-12hfpmodem: M15 coding style fixJeevaka Badrappan1-2/+2
2010-11-29drivers: explicitly compare pointers to NULLLucas De Marchi1-16/+14
This patch was generated by the following semantic patch (http://coccinelle.lip6.fr/) // <smpl> @fix disable is_null,isnt_null1@ expression *E; @@ - !E + E == NULL // </smpl>
2010-09-14Fix common misspellings in driversLucas De Marchi1-1/+1
Fix common misspellings by using the list available at http://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines From the list cited above, the substitution script found the following misspellings: subsidary(-ies)->subsidiary(-ies) transfering->transferring
2010-08-16hfpmodem: Remove useless NULL checks before g_freeMarcel Holtmann1-8/+4
2010-08-12voicecall: Rename hangup to hangup_activeSjur Brændeland1-1/+1
2010-03-09Fix Don't check CLIR CUG option in hfp_dialZhenhua Zhang1-4/+0
For HFP call, no need to check CLIR & CUG option. It doesn't affect dial out string.
2010-02-08Refactor: Remove atutil dump_responseDenis Kenzior1-13/+0
No longer needed now that we have nice AT command tracing using OFONO_AT_DEBUG=1
2010-02-08Fix: Don't use ofono_debug directly in pluginsDenis Kenzior1-3/+3
2010-02-05Fix: Use snprintf instead of sprintf in HFPDenis Kenzior1-4/+4
2010-01-01Update copyright informationMarcel Holtmann1-1/+1
2009-12-17Style: Repeat for driversDenis Kenzior1-2/+4
2009-12-09Style: Fix style issues in hfpmodemDenis Kenzior1-6/+9
2009-12-09Add clip_timeout for notify incoming callZhenhua Zhang1-0/+38
Schedule a clip_timeout in the ring notify. If CLIP comes right after RING, we cancel the timer. If doesn't, we notify the call without phone number.
2009-12-09Add poll_clcc if we are in multiparty callZhenhua Zhang1-0/+37
If we are in multiparty call, remote AG won't update indicator if any call in multiparty call is released by CHLD=1x. So we have to poll it periodically.
2009-12-09Add multiparty call support for hfpmodemZhenhua Zhang1-3/+53
Add CHLD=3, 2x and 4 to create multiparty call, private chat and call transfer.
2009-12-09Add hfp_release_specific to release specific callZhenhua Zhang1-1/+50
Use AT+CHLD=1x to release a specific call if AG supports that.
2009-12-08Style: Remove empty lineDenis Kenzior1-1/+0
2009-12-08Fix update hfp_hangup to release active callZhenhua Zhang1-2/+2
In HFP, AT+CHUP is intended to release the current active call.
2009-12-04Make sure to list calls in HFP voicecall driverDenis Kenzior1-0/+18
2009-12-04Add hfp_send_dtmf to send tones for hfpmodemZhenhua Zhang1-1/+40
2009-12-04Update HFP voicecall driver to new world orderDenis Kenzior1-10/+7
2009-12-04Get rid of list_calls in hfp driverDenis Kenzior1-1/+0