--- a/channels/chan_mobile.c 2009-12-28 19:52:53.000000000 +0200 +++ b/channels/chan_mobile.c 2009-12-30 12:29:31.306353568 +0200 @@ -3098,7 +3098,16 @@ } msg_queue_free_and_pop(pvt); } else if (entry) { - ast_debug(1, "[%s] received AT message 'ERROR' when expecting %s, ignoring\n", pvt->id, at_msg2str(entry->expected)); + if ( (entry->expected == AT_BRSF) && (!(pvt->hfp->initialized)) ) { + ast_debug(1, "[%s] received AT message 'ERROR' when expecting %s, Trying CIND as fallback\n", pvt->id, at_msg2str(entry->expected)); + msg_queue_free_and_pop(pvt); + if (hfp_send_cind(pvt->hfp) || msg_queue_push(pvt, AT_CIND, AT_CIND)) { + ast_debug(1, "[%s] error sending CIND\n", pvt->hfp->owner->id); + goto e_return; + } + } else { + ast_debug(1, "[%s] received AT message 'ERROR' when expecting %s, Ignoring\n", pvt->id, at_msg2str(entry->expected)); + } } else { ast_debug(1, "[%s] received unexpected AT message 'ERROR'\n", pvt->id); } @@ -3374,7 +3383,7 @@ * procedure is not spread throughout the event handling loop. */ - /* start initialization with the BRSF request */ + /* start initialization with the BRSF request, with fallback to CIND*/ ast_mutex_lock(&pvt->lock); pvt->timeout = 10000; if (hfp_send_brsf(hfp, &hfp_our_brsf) || msg_queue_push(pvt, AT_BRSF, AT_BRSF)) {