Communication in different network with SRTP

Hello,
I’m having trouble trying to communicate between two endpoints on different networks that implement SRTP. I built a trunk endpoint to connect the two networks.
When it is used for communication between two endpoint in different network without SRTP, it works and can use to communicate, but when SRTP is activated it connected but there no sound transmitted, it all noise.

Previously I made modifications to the libsrtp encryption module, the results of this modification have been tried for local communication on a network and communication using srtp was successful.
After trying to understand the existing encryption methods, it can be seen that the packet sent from server 1 to server 2 is encrypted using another method that is different from the encryption method in libsrtp.

Does anyone know why this is happening?

I am using realtime mysql, but my configuration it looks like this.

          [trunk_jar1_jar2]
          type=endpoint
          aors=trunk_jar1_jar2
          auth=trunk_jar1_jar2
          context=peer2peer
          disallow=all
          allow=alaw
          media_encryption=sdes
          from_domain=192.168.0.15
          from_user=trunk_jar1_jar2

          [trunk_jar1_jar2]
          type=aor
          contact=sip:trunk_jar1_jar2@192.168.1.101
  
          

Thank you

Could something be corrupting the SSRC?

Are you back to the standard libSRTP library or is this still some sort of modification you did to libSRTP? In the latter case, you might have implemented something wrongly – with the same libSRTP it works, with two different instances it does not. libSRTP contained a similar software bug. Perhaps you can learn/benefit from that …