I have some IP/RTP/IuUP packets of a voice call from A to B and I want to create one AMR file including A and B voice packets together (merge them such as A1,A2,B1,A3,A4,B2,B3,B4,B5,B6,A5,… and not concatenate).
I have extracted the IuUP part of each packets from side A and prepend “3C” to each extracted bytes (my sampling rate is 12,2 kbit/s) and concatenated all of the obtained frames together. Then, I have prepend “23 21 41 4D 52 0A” to start of the first frame (AMR header bytes) and the new obtained AMR file played correctly. I have repeated this scenario for the side B. So I have two AMR files which can be played correctly. Now how can I merged these AMR files to ones similar the mentioned pattern in C++?
Do I have to add another IuUP header instead of “3C” or I have to change something else to create a multi channel AMR file including A and B voice call together?