Hi guys,
On Aug 13, 2012, at 9:55 PM, Saúl Ibarra Corretgé wrote:
> Hi Rudy,
>> On Aug 13, 2012, at 8:19 PM, Rudy wrote:
>>> Bogdan,
>>>> Great work on all the improvements. There is a patch I submitted a
>> while back for media proxy. I explained this to Vlad that there could
>> be other scripts / modules effected. Basically, once you call
>> strip_body() on a message, internally you are still able to access
>> that body (in some cases an SDP). The get_body() function should not
>> return anything if strip_body() was called. My patch fixes this
>> problem only in mediaproxy by checking lumps for deleted body. A more
>> elegant solution would be to fix opensips internally as described
>> above (ie: get_body() should fail after strip_body() being called) .
>>>>https://sourceforge.net/tracker/?func=detail&aid=3530859&group_id=232389&atid=1086412>>>> It would be great if we can get this fix, or a more proper one into 1.8.1 .
>>>> I talked about this with Vlad at ClueCon and there doesn't seem to be a better approach given the limitations of the lump system. I think we can get this into 1.8.1 after a final look.
>
After sleeping over it, I don't think this is such a good idea, because it doesn't work in all cases. If you use the separated functions like this it will not work:
use_media_proxy();
....
strip_body();
Any other module that also operates on the message body suffers from this, and I'd rather not add tens of workarounds here-and-there.
The proper solution would of course be to get rid of the lumps :-), but since that is unlikely to happen soon, I suggest we reconsider having a apply_message_changes function, which would apply all the lumps immediately, so the next function that operates on the message would find it changed already. Example:
strip_body();
apply_message_changes();
...
use_media_proxy();
This function is already implemented in Kamailio and a while ago I started porting it but I didn't finish it. It should be pretty straightforward to finish it, so if we settle on this approach I could finish it. However, being a new feature it would only make it to 1.9 version.
Regards,
--
Saúl Ibarra Corretgé
AG Projects