I have an application written in Python 3 which communicates with an external SIP proxy server through its public IP. Basically the application I wrote sends out a SIP invite to the SIP proxy through an UDP socket. Unfortunately when I run my application no data is being sent past the firewall. Firewall is configured allow all inbound and outbound connections. I am very sure the Python application works correctly because when script is made to communicate with a SIP proxy running locally, everything works as expected. Only when the script has to go through the firewall strange things happen. I used a tool called SIPp to simulate my script's functionality (send out SIP invite) and for my surprise the invite sent through the said tool successfully reaches the external SIP proxy. I did a packet capture comparison between the packets generated by my script and the SIPp tool, every header and field values are exact same. So I am starting to believe that FW does not allow the packets sent through my script because of a different encoding. I tried searching the encoding used by the tool but was not able to find it from the documentation. I am currently using 'utf-8' as my encoding in my script. What could be the reason for this bizarre behaviour? Is deductions about firewall issues due to different encoding correct? Please advise.
Update: I localised the problem. The issue is when I sent data to port 5060. When I send data to any other port, SIP proxy can get it. I checked my PC, no other application is using port 5060. The SIPp tool used port 5060 as well.
I am 100% convinced its the sip-alg thing which blocks my script's packets. I am not sure how SIP ALG can detect my script's packets and block them. Is it because of a specific encoding?