Index: channels/chan_sip.c =================================================================== --- channels/chan_sip.c (revision 81157) +++ channels/chan_sip.c (working copy) @@ -10439,7 +10439,14 @@ /* Make formats okay */ chan2m->readformat = chan2->readformat; chan2m->writeformat = chan2->writeformat; + while (ast_mutex_trylock(&chan2->lock)) { + struct sip_pvt *pvt = chan2->tech_pvt; + ast_mutex_unlock(&pvt->lock); + usleep(1); + ast_mutex_lock(&pvt->lock); + } ast_channel_masquerade(chan2m, chan2); + ast_mutex_unlock(&chan2->lock); /* Setup the extensions and such */ ast_copy_string(chan2m->context, chan2->context, sizeof(chan2m->context)); ast_copy_string(chan2m->exten, chan2->exten, sizeof(chan2m->exten));