--- chan_mobile.c.orig 2013-02-15 10:59:13.000000000 +0100 +++ chan_mobile.c 2013-02-15 11:38:18.000000000 +0100 @@ -3540,13 +3540,17 @@ static int handle_response_ciev(struct m pvt->incoming = 0; pvt->outgoing = 0; } break; case HFP_CIND_CALLSETUP_INCOMING: - ast_debug(1, "[%s] incoming call, waiting for caller id\n", pvt->id); - pvt->needcallerid = 1; - pvt->incoming = 1; + if(pvt->incoming) { + ast_debug(1, "[%s] got +CIEV for an already handled incoming call\n", pvt->id); + } else { + ast_debug(1, "[%s] incoming call, waiting for caller id\n", pvt->id); + pvt->needcallerid = 1; + pvt->incoming = 1; + } break; case HFP_CIND_CALLSETUP_OUTGOING: if (pvt->outgoing) { pvt->hfp->sent_alerting = 0; ast_debug(1, "[%s] outgoing call\n", pvt->id); @@ -3622,14 +3626,16 @@ static int handle_response_clip(struct m */ static int handle_response_ring(struct mbl_pvt *pvt, char *buf) { if (pvt->needcallerid) { ast_debug(1, "[%s] got ring while waiting for caller id\n", pvt->id); - return msg_queue_push(pvt, AT_CLIP, AT_UNKNOWN); } else { - return 0; + pvt->needcallerid = 1; + pvt->incoming = 1; } + + return msg_queue_push(pvt, AT_CLIP, AT_UNKNOWN); } /*! * \brief Handle AT+CMTI messages. * \param pvt a mbl_pvt structure