Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
troubleshooting:nat [2007/05/28 19:27] – 200.198.196.129 | troubleshooting:nat [2007/05/28 21:27] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Audio only works one way, when connected with client behind nat ====== | ||
+ | |||
+ | |||
+ | ===== Answer | ||
+ | |||
+ | - install mediaproxy module | ||
+ | - install mediaproxy dispatcher | ||
+ | - install mediaproxy server | ||
+ | |||
+ | ** Follow the install procedure and try using this openser.cfg : ** | ||
+ | |||
+ | <code c> | ||
+ | |||
+ | # | ||
+ | |||
+ | # ----------- global configuration parameters ------------------------ | ||
+ | |||
+ | # | ||
+ | |||
+ | #fork=yes | ||
+ | |||
+ | # | ||
+ | |||
+ | # | ||
+ | |||
+ | /* Uncomment these lines to enter debugging mode | ||
+ | |||
+ | fork=no | ||
+ | |||
+ | log_stderror=yes | ||
+ | |||
+ | */ | ||
+ | |||
+ | check_via=no | ||
+ | |||
+ | dns=no | ||
+ | |||
+ | rev_dns=no | ||
+ | |||
+ | #port=5060 | ||
+ | |||
+ | #children=4 | ||
+ | |||
+ | fifo="/ | ||
+ | |||
+ | # ------------------ module loading ---------------------------------- | ||
+ | |||
+ | # Uncomment this if you want to use SQL database | ||
+ | |||
+ | loadmodule "/ | ||
+ | |||
+ | loadmodule "/ | ||
+ | |||
+ | loadmodule "/ | ||
+ | |||
+ | loadmodule "/ | ||
+ | |||
+ | loadmodule "/ | ||
+ | |||
+ | loadmodule "/ | ||
+ | |||
+ | loadmodule "/ | ||
+ | |||
+ | loadmodule "/ | ||
+ | |||
+ | loadmodule "/ | ||
+ | |||
+ | loadmodule "/ | ||
+ | |||
+ | loadmodule "/ | ||
+ | |||
+ | # Uncomment this if you want digest authentication | ||
+ | |||
+ | # mysql.so must be loaded ! | ||
+ | |||
+ | loadmodule "/ | ||
+ | |||
+ | loadmodule "/ | ||
+ | |||
+ | # ----------------- setting module-specific parameters --------------- | ||
+ | |||
+ | # -- usrloc params -- | ||
+ | |||
+ | modparam(" | ||
+ | |||
+ | # Uncomment this if you want to use SQL database | ||
+ | |||
+ | # for persistent storage and comment the previous line | ||
+ | |||
+ | modparam(" | ||
+ | |||
+ | # -- auth params -- | ||
+ | |||
+ | # Uncomment if you are using auth module | ||
+ | |||
+ | # | ||
+ | |||
+ | modparam(" | ||
+ | |||
+ | # | ||
+ | |||
+ | # If you set " | ||
+ | |||
+ | # uncomment also the following parameter) | ||
+ | |||
+ | # | ||
+ | |||
+ | modparam(" | ||
+ | |||
+ | # -- rr params -- | ||
+ | |||
+ | # add value to ;lr param to make some broken UAs happy | ||
+ | |||
+ | modparam(" | ||
+ | |||
+ | modparam(" | ||
+ | |||
+ | modparam(" | ||
+ | |||
+ | # ------------------------- | ||
+ | |||
+ | # main routing logic | ||
+ | |||
+ | route{ | ||
+ | |||
+ | # initial sanity checks -- messages with | ||
+ | # max_forwards==0, | ||
+ | if (!mf_process_maxfwd_header(" | ||
+ | sl_send_reply(" | ||
+ | break; | ||
+ | }; | ||
+ | if (msg:len >= 2048 ) { | ||
+ | sl_send_reply(" | ||
+ | break; | ||
+ | }; | ||
+ | |||
+ | |||
+ | # we record-route all messages -- to make sure that | ||
+ | # subsequent messages will go through our proxy; that's | ||
+ | # particularly good if upstream and downstream entities | ||
+ | # use different transport protocol | ||
+ | if (!method==" | ||
+ | |||
+ | # subsequent messages withing a dialog should take the | ||
+ | # path determined by record-routing | ||
+ | if (loose_route()) { | ||
+ | # mark routing logic in request | ||
+ | append_hf(" | ||
+ | route(1); | ||
+ | break; | ||
+ | }; | ||
+ | |||
+ | if (!uri==myself) { | ||
+ | # mark routing logic in request | ||
+ | append_hf(" | ||
+ | route(1); | ||
+ | break; | ||
+ | }; | ||
+ | |||
+ | # if the request is for other domain use UsrLoc | ||
+ | # (in case, it does not work, use the following command | ||
+ | # with proper names and addresses in it) | ||
+ | if (uri==myself) { | ||
+ | |||
+ | if (method==" | ||
+ | # Uncomment this if you want to use digest authentication | ||
+ | if (!www_authorize(" | ||
+ | | ||
+ | | ||
+ | }; | ||
+ | |||
+ | if (client_nat_test(" | ||
+ | | ||
+ | | ||
+ | | ||
+ | }; | ||
+ | |||
+ | | ||
+ | | ||
+ | |||
+ | }; | ||
+ | |||
+ | lookup(" | ||
+ | if (!uri==myself) { | ||
+ | append_hf(" | ||
+ | route(1); | ||
+ | break; | ||
+ | }; | ||
+ | |||
+ | # native SIP destinations are handled using our USRLOC DB | ||
+ | if (!lookup(" | ||
+ | sl_send_reply(" | ||
+ | break; | ||
+ | }; | ||
+ | }; | ||
+ | |||
+ | if (method==" | ||
+ | t_on_failure(" | ||
+ | } else if (method == " | ||
+ | end_media_session(); | ||
+ | }; | ||
+ | |||
+ | if (loose_route()) { | ||
+ | if (method==" | ||
+ | use_media_proxy(); | ||
+ | }; | ||
+ | t_relay(); | ||
+ | break; | ||
+ | }; | ||
+ | |||
+ | if (client_nat_test(" | ||
+ | # Mark as NAT'ed | ||
+ | force_rport(); | ||
+ | fix_contact(); | ||
+ | }; | ||
+ | |||
+ | if (method==" | ||
+ | t_on_reply(" | ||
+ | }; | ||
+ | |||
+ | if (method==" | ||
+ | use_media_proxy(); | ||
+ | }; | ||
+ | |||
+ | if (!t_relay()) { | ||
+ | if (method==" | ||
+ | end_media_session(); | ||
+ | }; | ||
+ | sl_reply_error(); | ||
+ | }; | ||
+ | |||
+ | append_hf(" | ||
+ | # route(1); | ||
+ | |||
+ | } | ||
+ | |||
+ | route[1] | ||
+ | { | ||
+ | # send it out now; use stateful forwarding as it works reliably | ||
+ | # even for UDP2TCP | ||
+ | if (!t_relay()) { | ||
+ | sl_reply_error(); | ||
+ | }; | ||
+ | } | ||
+ | |||
+ | failure_route[1] { | ||
+ | end_media_session(); | ||
+ | } | ||
+ | |||
+ | onreply_route[1] { | ||
+ | if (status=~" | ||
+ | if (client_nat_test(" | ||
+ | fix_contact(); | ||
+ | }; | ||
+ | use_media_proxy(); | ||
+ | }; | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ===== Troubleshooting Stuff ===== | ||
+ | |||
+ | {{indexmenu> |