- SDP processing (other than the one performed by rtpengine) takes place in one common route for all cases where it needs to happen. These are two at the moment in my scenario:
- Early in the WITHINDLG route (of the example config file)
- After the sanity checks in the reply_route (of the example config file)
- msg_apply changes() is called once, for each script iteration:
- right before rtpengine_manage() is called, provided that t_is_request_route() returns true (so that I don't accidentally call it from a branch route or anything)
- rtpengine_manage() is called in its own route, which is very similar to the example config file's "NATMANAGE" route. Since NATMANAGE is called in all branch and on_reply_routes, I employ t_is_request_route() here to make sure it won't execute in those cases.
- at the end of the "core" reply_route
Now regarding the actual config-file-controlled SDP manipulation, it only consists of a single call to replace_body_str(). The purpose is to edit a line in the message body from something like:
to something along the lines of:
For replies, this works as expected.
For in-dialog requests, however, I end up with both the original and the edited lines:
a=fmtp:101 0-16 (the original line)
... other SDP stuff ...
a=fmtp:101 0-15 (the edited line)
If anyone could point out any misconceptions I have about msg_apply_changes, SDP rewriting from the script and rtp_engine_X() interoperability, I would be more than grateful.
Thank you in advance and I apologize for the long read.
Best regards,
George Diamantopoulos