[asterisk-dev] [Code Review] [17949] Error that mutex 'dialog' has been free'd more than it's been locked in add_header_max_forwards
Olle E. Johansson
oej at edvina.net
Sat Nov 6 03:18:56 CDT 2010
5 nov 2010 kl. 21.47 skrev Russell Bryant:
>
> Other than the suggestion to remove this lock, I think this is good to go. I'm glad we came to a much cleaner approach!
I think we need to document the lessons learned here. When coding, I never thought twice about accessing a channel variable in that piece of the code. We do access channel variables in so many places... In this case, the issue was we did it during an ongoing call, which we don't do elsewhere.
If I understand the situation right, in this case we have an existing pvt with an on-going call. The ->owner (ast_channel) can have a lot of parallell stuff going on, incoming and outgoing messages. We just couldn't figure out how to access the ast_channel properly for an outbound SIP request here. For this issue we found another way of solving it, since there's no point in supporting a change of the channel variable during the call.
If we do not solve the locking issues involved here, it means that we can not add any function that changes headers in in-dialog messages based on channel variables unless we solve this. Like manager setting a channel variable DURING the call that will affect the BYE or an in-dialog re-invite, MESSAGE or any other request.
Do we wan't to solve this or should we just document it as "kids, don't try this at home"?
/O
More information about the asterisk-dev
mailing list