Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| presence:pua_xmpp [2007/04/04 13:15] – 81.180.83.75 | presence:pua_xmpp [2009/02/14 22:26] (current) – 86.121.129.39 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | **Note** In the filtering sequences you should use the values set for xmpp parameters as follows: | ||
| + | * " | ||
| + | * " | ||
| + | * " | ||
| + | |||
| + | <code c> | ||
| + | # simple quick-start config script | ||
| + | # | ||
| + | |||
| + | # ----------- global configuration parameters ------------------------ | ||
| + | |||
| + | /* Uncomment these lines to enter debugging mode */ | ||
| + | debug=7 | ||
| + | fork=no | ||
| + | log_stderror=yes | ||
| + | |||
| + | sip_warning=0 | ||
| + | |||
| + | check_via=no # | ||
| + | dns=no | ||
| + | rev_dns=no | ||
| + | listen=udp: | ||
| + | children=4 | ||
| + | # | ||
| + | |||
| + | # | ||
| + | # uncomment the following lines for TLS support | ||
| + | # | ||
| + | #listen = tls: | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | #tls_method = TLSv1 | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | |||
| + | # ------------------ module loading ---------------------------------- | ||
| + | mpath=" | ||
| + | |||
| + | loadmodule " | ||
| + | loadmodule " | ||
| + | loadmodule " | ||
| + | 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 --------------- | ||
| + | modparam(" | ||
| + | modparam(" | ||
| + | modparam(" | ||
| + | modparam(" | ||
| + | # | ||
| + | modparam(" | ||
| + | |||
| + | |||
| + | modparam(" | ||
| + | |||
| + | # -- usrloc params -- | ||
| + | # 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 | ||
| + | # | ||
| + | # | ||
| + | # | ||
| + | # If you set " | ||
| + | # uncomment also the following parameter) | ||
| + | # | ||
| + | # | ||
| + | |||
| + | # -- rr params -- | ||
| + | # add value to ;lr param to make some broken UAs happy | ||
| + | modparam(" | ||
| + | |||
| + | # -- presence params -- | ||
| + | modparam(" | ||
| + | modparam(" | ||
| + | modparam(" | ||
| + | modparam(" | ||
| + | |||
| + | modparam(" | ||
| + | modparam(" | ||
| + | modparam(" | ||
| + | |||
| + | |||
| + | # ------------------------- | ||
| + | |||
| + | # main routing logic | ||
| + | |||
| + | |||
| + | route{ | ||
| + | |||
| + | # initial sanity checks -- messages with | ||
| + | # max_forwards==0, | ||
| + | if (!mf_process_maxfwd_header(" | ||
| + | sl_send_reply(" | ||
| + | exit; | ||
| + | }; | ||
| + | |||
| + | if (msg:len >= 2048 ) { | ||
| + | sl_send_reply(" | ||
| + | exit; | ||
| + | }; | ||
| + | |||
| + | # 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==" | ||
| + | record_route(); | ||
| + | |||
| + | # 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); | ||
| + | }; | ||
| + | if(method == " | ||
| + | setflag(5); | ||
| + | |||
| + | if( uri=~" | ||
| + | uri=~" | ||
| + | { | ||
| + | if( is_method(" | ||
| + | route(2); | ||
| + | } | ||
| + | |||
| + | if( uri=~" | ||
| + | { | ||
| + | # absorb retransmissions ### | ||
| + | if (!t_newtran()) { | ||
| + | sl_reply_error(); | ||
| + | return; | ||
| + | } | ||
| + | if (method == " | ||
| + | log(" | ||
| + | if (xmpp_send_message()) { | ||
| + | t_reply(" | ||
| + | } else { | ||
| + | t_reply(" | ||
| + | } | ||
| + | return; | ||
| + | }else { | ||
| + | t_reply(" | ||
| + | exit; | ||
| + | } | ||
| + | |||
| + | } | ||
| + | |||
| + | if (!uri==myself) { | ||
| + | # mark routing logic in request | ||
| + | append_hf(" | ||
| + | # if you have some interdomain connections via TLS | ||
| + | # | ||
| + | # | ||
| + | # exit; | ||
| + | #} else if(uri=~" | ||
| + | # | ||
| + | # exit; | ||
| + | #} | ||
| + | route(1); | ||
| + | }; | ||
| + | |||
| + | # 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( is_method(" | ||
| + | route(2); | ||
| + | |||
| + | if (method==" | ||
| + | |||
| + | # Uncomment this if you want to use digest authentication | ||
| + | #if (!www_authorize(" | ||
| + | # | ||
| + | # exit; | ||
| + | #}; | ||
| + | |||
| + | save(" | ||
| + | exit; | ||
| + | }; | ||
| + | |||
| + | # native SIP destinations are handled using our USRLOC DB | ||
| + | if (!lookup(" | ||
| + | sl_send_reply(" | ||
| + | exit; | ||
| + | }; | ||
| + | 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(); | ||
| + | }; | ||
| + | exit; | ||
| + | } | ||
| + | |||
| + | route[2] | ||
| + | { | ||
| + | if ( !t_newtran() ) | ||
| + | { | ||
| + | sl_reply_error(); | ||
| + | exit; | ||
| + | }; | ||
| + | |||
| + | if( is_method(" | ||
| + | { | ||
| + | pua_xmpp_notify(); | ||
| + | t_reply(" | ||
| + | exit; | ||
| + | } | ||
| + | |||
| + | if(is_method(" | ||
| + | { | ||
| + | handle_publish("" | ||
| + | t_release(); | ||
| + | } | ||
| + | else | ||
| + | if( is_method(" | ||
| + | { | ||
| + | handle_subscribe(); | ||
| + | if( uri=~" | ||
| + | { | ||
| + | pua_xmpp_req_winfo(" | ||
| + | } | ||
| + | t_release(); | ||
| + | } | ||
| + | |||
| + | exit; | ||
| + | } | ||
| + | </ | ||