diff options
Diffstat (limited to 'channels/chan_sip.c')
-rwxr-xr-x | channels/chan_sip.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 74d84bd89..c4de5be3b 100755 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -1747,7 +1747,10 @@ static struct ast_channel *sip_new(struct sip_pvt *i, int state, char *title) { struct ast_channel *tmp; int fmt; + ast_mutex_unlock(&i->lock); + /* Don't hold a sip pvt lock while we allocate a channel */ tmp = ast_channel_alloc(1); + ast_mutex_lock(&i->lock); if (tmp) { /* Select our native format based on codec preference until we receive something from another device to the contrary. */ @@ -7183,7 +7186,9 @@ static struct ast_channel *sip_request(char *type, int format, void *data) printf("Setting up to call extension '%s' at '%s'\n", ext ? ext : "<none>", host); #endif p->prefcodec = format; + ast_mutex_lock(&p->lock); tmpc = sip_new(p, AST_STATE_DOWN, host); + ast_mutex_unlock(&p->lock); if (!tmpc) sip_destroy(p); ast_update_use_count(); |