Book Image

Building Telephony Systems with OpenSER

Book Image

Building Telephony Systems with OpenSER

Overview of this book

Table of Contents (18 chapters)
Building Telephony Systems with OpenSER
Credits
About the Author
About the Reviewers
Preface
6
Building the User Portal with SerMyAdmin
Index

Handling INVITE Messages behind NAT


On REGISTER messages we had to handle just the SIP protocol. Now for the INVITE messages we will have to handle the SIP and the RTP protocols. To accomplish this we will have to make modifications to the SIP and the SDP headers.

Besides, the contact information is wrong; it points to the private (RFC1918) address. OpenSER should change the contact information from the private address to the public address. This is done by the function fix_nated_contact() exported by the nathelper module. Other messages, such as ACK, BYE, and CANCEL should have the CONTACT header field corrected also.

When an INVITE message is sent, it will contain an SDP payload. This SDP (Session Description Protocol) identifies the session content (audio, video, chat, named events). The SDP payload describes several things about the UAC, such as the kinds of session it supports, IP address, and UDP port where the other part can be found.

Example: A UAC describes the "ip:port" pair 192.168...