[Home]

Summary:ASTERISK-26567: PJSIP session supplements are called too late
Reporter:Mark Michelson (mmichelson)Labels:
Date Opened:2016-11-08 13:47:36.000-0600Date Closed:2017-12-19 07:55:45.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Resources/res_pjsip_session
Versions:13.12.1 14.1.1 Frequency of
Occurrence
Occasional
Related
Issues:
Environment:Attachments:
Description:res_pjsip_session calls into session supplements when the PJSIP_EVENT_TX_MSG event occurs. This happens in both inv state changes, and transaction state changes. In both cases, though, when this event occurs, it's actually too late to be trying to modify the outgoing message. This is because at this point, the message is in one of two possible states:

a) The message has already been sent
b) An asynchronous DNS query has been started, and when it completes, the message will be sent from a separate thread.

In situation b, this can be disastrous. We could be trying to modify a pjsip_tx_data at the same time that the message is being rendered into text and being sent out. This can cause memory corruption or outright crashes.
Comments: