+static void dahdi_r2_disconnect_call(struct dahdi_pvt *p, openr2_call_disconnect_cause_t cause)
+{
+ if (openr2_chan_disconnect_call(p->r2chan, cause)) {
+ ast_log(LOG_NOTICE, "Bad! failed to disconnect call on channel %d with reason %s, hope for the best!\n",
+ p->channel, openr2_proto_get_disconnect_string(cause));
+ /* force the chan to idle and release the call flag now since we will not see a clean on_call_end */
+ openr2_chan_set_idle(p->r2chan);
+ ast_mutex_lock(&p->lock);
+ p->mfcr2call = 0;
+ ast_mutex_unlock(&p->lock);
+ }
+}
+