[asterisk-dev] why reset p->method in chan_sip?

Mark Michelson mmichelson at digium.com
Wed Dec 9 15:40:34 CST 2009

Olle E. Johansson wrote:
> 8 dec 2009 kl. 18.12 skrev David Vossel:
>> Hello everyone!
>> In chan_sip sip_pvt->method is supposed to represent the method that opened the dialog.  It is set in sip_alloc during dialog creation, so what is the purpose of resetting it in handle_incomming for every message we receive?  Is that necessary or useful for anything?
> The question is really: Does any part of the code assume that it's the last message received in a dialog, not the first?
> /O

I know that for a time there was some code in __sip_autodestruct that made this 
assumption. That code has been changed to use a different field of the sip_pvt 
instead. It may be a good idea to grep for '->method' to see how it is being 
used throughout the file.

Mark Michelson

More information about the asterisk-dev mailing list