Does anybody know if there is an existing library function/s to copy a sip_msg (typically request) from shm to pkg? I know there is already this functionality in the tmx module but I think it would be useful to move this into a library so it can be used by other modules? I am just wanting to make sure before I replicate code...
Reason for such functionality:
The main reason is where modules need to access specific headers from a sip request which they get from t->uas.request (generally in instances where only the rpl message is accessible). We all know that t->uas.request sits in SHM, so if any additional parsing is done on this message it's pointers will be polluted with pvt memory addresses of the processing parsing the request. This could ultimately lead to memory corruption and segfaults.
I would therefore propose moving the pv_t_copy_msg and associated functions from tmx modules into the core library... any objections?
Cheers
JasonĀ