Sorry. Here it is (rather long):<div><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="font-family: &#39;Times New Roman&#39;; font-size: medium; "><pre style="word-wrap: break-word; white-space: pre-wrap; ">

#!KAMAILIO
#
# Kamailio (OpenSER) SIP Server v3.1 - default configuration script
#     - web: <a href="http://www.kamailio.org">http://www.kamailio.org</a>
#     - git: <a href="http://sip-router.org">http://sip-router.org</a>
#
# Direct your questions about this file to: &lt;<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>&gt;
#
# Refer to the Core CookBook at <a href="http://www.kamailio.org/dokuwiki/doku.php">http://www.kamailio.org/dokuwiki/doku.php</a>
# for an explanation of possible statements, functions and parameters.
#
# Several features can be enabled using &#39;#!define WITH_FEATURE&#39; directives:
#
# *** To run in debug mode: 
#     - define WITH_DEBUG
#
# *** To enable mysql: 
#     - define WITH_MYSQL
#
# *** To enable authentication execute:
#     - enable mysql
#     - define WITH_AUTH
#     - add users using &#39;kamctl&#39;
#
# *** To enable IP authentication execute:
#     - enable mysql
#     - enable authentication
#     - define WITH_IPAUTH
#     - add IP addresses with group id &#39;1&#39; to &#39;address&#39; table
#
# *** To enable persistent user location execute:
#     - enable mysql
#     - define WITH_USRLOCDB
#
# *** To enable presence server execute:
#     - enable mysql
#     - define WITH_PRESENCE
#
# *** To enable nat traversal execute:
#     - define WITH_NAT
#     - install RTPProxy: <a href="http://www.rtpproxy.org">http://www.rtpproxy.org</a>
#     - start RTPProxy:
#        rtpproxy -l _your_public_ip_ -s udp:localhost:7722
#
# *** To enable PSTN gateway routing execute:
#     - define WITH_PSTN
#     - set the value of pstn.gw_ip
#     - check route[PSTN] for regexp routing condition
#
# *** To enable database aliases lookup execute:
#     - enable mysql
#     - define WITH_ALIASDB
#
# *** To enable multi-domain support execute:
#     - enable mysql
#     - define WITH_MULTIDOMAIN
#
# *** To enable TLS support execute:
#     - adjust CFGDIR/tls.cfg as needed
#     - define WITH_TLS
#
# *** To enable XMLRPC support execute:
#     - define WITH_XMLRPC
#     - adjust route[XMLRPC] for access policy
#
# *** To enable anti-flood detection execute:
#     - adjust pike and htable=&gt;ipban settings as needed (default is
#       block if more than 16 requests in 2 seconds and ban for 300 seconds)
#     - define WITH_ANTIFLOOD
#
# *** To enhance accounting execute:
#     - enable mysql
#     - define WITH_ACCDB
#     - add following columns to database
#!ifdef ACCDB_COMMENT
  ALTER TABLE acc ADD COLUMN src_user VARCHAR(64) NOT NULL DEFAULT &#39;&#39;;
  ALTER TABLE acc ADD COLUMN src_domain VARCHAR(128) NOT NULL DEFAULT &#39;&#39;;
  ALTER TABLE acc ADD COLUMN dst_ouser VARCHAR(64) NOT NULL DEFAULT &#39;&#39;;
  ALTER TABLE acc ADD COLUMN dst_user VARCHAR(64) NOT NULL DEFAULT &#39;&#39;;
  ALTER TABLE acc ADD COLUMN dst_domain VARCHAR(128) NOT NULL DEFAULT &#39;&#39;;
  ALTER TABLE missed_calls ADD COLUMN src_user VARCHAR(64) NOT NULL DEFAULT &#39;&#39;;
  ALTER TABLE missed_calls ADD COLUMN src_domain VARCHAR(128) NOT NULL DEFAULT &#39;&#39;;
  ALTER TABLE missed_calls ADD COLUMN dst_ouser VARCHAR(64) NOT NULL DEFAULT &#39;&#39;;
  ALTER TABLE missed_calls ADD COLUMN dst_user VARCHAR(64) NOT NULL DEFAULT &#39;&#39;;
  ALTER TABLE missed_calls ADD COLUMN dst_domain VARCHAR(128) NOT NULL DEFAULT &#39;&#39;;
#!endif

####### Defined Values #########

# *** Value defines - IDs used later in config
#!ifdef WITH_MYSQL
# - database URL - used to connect to database server by modules such
#       as: auth_db, acc, usrloc, a.s.o.
#!define DBURL &quot;mysql://openser:openserrw@localhost/openser&quot;
#!endif
#!ifdef WITH_MULTIDOMAIN
# - the value for &#39;use_domain&#39; parameters
#!define MULTIDOMAIN 1
#!else
#!define MULTIDOMAIN 0
#!endif

# - flags
#   FLT_ - per transaction (message) flags
#        FLB_ - per branch flags
#!define FLT_ACC 1
#!define FLT_ACCMISSED 2
#!define FLT_ACCFAILED 3
#!define FLT_NATS 5

#!define FLB_NATB 6
#!define FLB_NATSIPPING 7

####### Global Parameters #########

#!ifdef WITH_DEBUG
debug=4
log_stderror=yes
#!else
debug=2
log_stderror=no
#!endif

memdbg=5
memlog=5

log_facility=LOG_LOCAL0

fork=yes
children=4

/* uncomment the next line to disable TCP (default on) */
#disable_tcp=yes

/* uncomment the next line to disable the auto discovery of local aliases
   based on reverse DNS on IPs (default on) */
#auto_aliases=no

/* add local domain aliases */
#alias=&quot;<a href="http://sip.mydomain.com">sip.mydomain.com</a>&quot;

/* uncomment and configure the following line if you want Kamailio to 
   bind on a specific interface/port/proto (default bind on all available) */
#listen=udp:<a href="http://10.0.0.10:5060">10.0.0.10:5060</a>

/* port to listen to
 * - can be specified more than once if needed to listen on many ports */
port=5060

#!ifdef WITH_TLS
enable_tls=yes
#!endif

####### Custom Parameters #########

# These parameters can be modified runtime via RPC interface
# - see the documentation of &#39;cfg_rpc&#39; module.
#
# Format: <a href="http://group.id">group.id</a> = value &#39;desc&#39; description
# Access: $sel(<a href="http://cfg_get.group.id">cfg_get.group.id</a>) or @<a href="http://cfg_get.group.id">cfg_get.group.id</a>
#

#!ifdef WITH_PSTN
# PSTN GW Routing
#
# - pstn.gw_ip: valid IP or hostname as string value, example:
# pstn.gw_ip = &quot;10.0.0.101&quot; desc &quot;My PSTN GW Address&quot;
#
# - by default is empty to avoid misrouting
pstn.gw_ip = &quot;&quot; desc &quot;PSTN GW Address&quot;
#!endif


####### Modules Section ########

# set paths to location of modules
#!ifdef LOCAL_TEST_RUN
mpath=&quot;modules_k:modules&quot;
#!else
mpath=&quot;/usr/lib64/kamailio/modules_k/:/usr/lib64/kamailio/modules/&quot;
#!endif

#!ifdef WITH_MYSQL
loadmodule &quot;db_mysql.so&quot;
#!endif

loadmodule &quot;mi_fifo.so&quot;
loadmodule &quot;kex.so&quot;
loadmodule &quot;tm.so&quot;
loadmodule &quot;tmx.so&quot;
loadmodule &quot;sl.so&quot;
loadmodule &quot;rr.so&quot;
loadmodule &quot;pv.so&quot;
loadmodule &quot;maxfwd.so&quot;
loadmodule &quot;usrloc.so&quot;
loadmodule &quot;registrar.so&quot;
loadmodule &quot;textops.so&quot;
loadmodule &quot;siputils.so&quot;
loadmodule &quot;xlog.so&quot;
loadmodule &quot;sanity.so&quot;
loadmodule &quot;ctl.so&quot;
loadmodule &quot;mi_rpc.so&quot;
loadmodule &quot;acc.so&quot;

#!ifdef WITH_AUTH
loadmodule &quot;auth.so&quot;
loadmodule &quot;auth_db.so&quot;
#!ifdef WITH_IPAUTH
loadmodule &quot;permissions.so&quot;
#!endif
#!endif

#!ifdef WITH_ALIASDB
loadmodule &quot;alias_db.so&quot;
#!endif

#!ifdef WITH_MULTIDOMAIN
loadmodule &quot;domain.so&quot;
#!endif

#!ifdef WITH_PRESENCE
loadmodule &quot;presence.so&quot;
loadmodule &quot;presence_xml.so&quot;
#!endif

#!ifdef WITH_NAT
loadmodule &quot;nathelper.so&quot;
loadmodule &quot;rtpproxy.so&quot;
#!endif

#!ifdef WITH_TLS
loadmodule &quot;tls.so&quot;
#!endif

#!ifdef WITH_ANTIFLOOD
loadmodule &quot;htable.so&quot;
loadmodule &quot;pike.so&quot;
#!endif

#!ifdef WITH_XMLRPC
loadmodule &quot;xmlrpc.so&quot;
#!endif

# ----------------- setting module-specific parameters ---------------


# ----- mi_fifo params -----
modparam(&quot;mi_fifo&quot;, &quot;fifo_name&quot;, &quot;/tmp/kamailio_fifo&quot;)


# ----- tm params -----
# auto-discard branches from previous serial forking leg
modparam(&quot;tm&quot;, &quot;failure_reply_mode&quot;, 3)
# default retransmission timeout: 30sec
modparam(&quot;tm&quot;, &quot;fr_timer&quot;, 30000)
# default invite retransmission timeout after 1xx: 120sec
modparam(&quot;tm&quot;, &quot;fr_inv_timer&quot;, 120000)


# ----- rr params -----
# add value to ;lr param to cope with most of the UAs
modparam(&quot;rr&quot;, &quot;enable_full_lr&quot;, 1)
# do not append from tag to the RR (no need for this script)
modparam(&quot;rr&quot;, &quot;append_fromtag&quot;, 0)


# ----- registrar params -----
modparam(&quot;registrar&quot;, &quot;method_filtering&quot;, 1)
/* uncomment the next line to disable parallel forking via location */
# modparam(&quot;registrar&quot;, &quot;append_branches&quot;, 0)
/* uncomment the next line not to allow more than 10 contacts per AOR */
#modparam(&quot;registrar&quot;, &quot;max_contacts&quot;, 10)


# ----- acc params -----
/* what special events should be accounted ? */
modparam(&quot;acc&quot;, &quot;early_media&quot;, 0)
modparam(&quot;acc&quot;, &quot;report_ack&quot;, 0)
modparam(&quot;acc&quot;, &quot;report_cancels&quot;, 0)
/* by default ww do not adjust the direct of the sequential requests.
   if you enable this parameter, be sure the enable &quot;append_fromtag&quot;
   in &quot;rr&quot; module */
modparam(&quot;acc&quot;, &quot;detect_direction&quot;, 0)
/* account triggers (flags) */
modparam(&quot;acc&quot;, &quot;log_flag&quot;, FLT_ACC)
modparam(&quot;acc&quot;, &quot;log_missed_flag&quot;, FLT_ACCMISSED)
modparam(&quot;acc&quot;, &quot;log_extra&quot;, 
        &quot;src_user=$fU;src_domain=$fd;dst_ouser=$tU;dst_user=$rU;dst_domain=$rd&quot;)
modparam(&quot;acc&quot;, &quot;failed_transaction_flag&quot;, FLT_ACCFAILED)
/* enhanced DB accounting */
#!ifdef WITH_ACCDB
modparam(&quot;acc&quot;, &quot;db_flag&quot;, FLT_ACC)
modparam(&quot;acc&quot;, &quot;db_missed_flag&quot;, FLT_ACCMISSED)
modparam(&quot;acc&quot;, &quot;db_url&quot;, DBURL)
modparam(&quot;acc&quot;, &quot;db_extra&quot;,
        &quot;src_user=$fU;src_domain=$fd;dst_ouser=$tU;dst_user=$rU;dst_domain=$rd&quot;)
#!endif


# ----- usrloc params -----
/* enable DB persistency for location entries */
#!ifdef WITH_USRLOCDB
modparam(&quot;usrloc&quot;, &quot;db_url&quot;, DBURL)
modparam(&quot;usrloc&quot;, &quot;db_mode&quot;, 2)
modparam(&quot;usrloc&quot;, &quot;use_domain&quot;, MULTIDOMAIN)
#!endif


# ----- auth_db params -----
#!ifdef WITH_AUTH
modparam(&quot;auth_db&quot;, &quot;db_url&quot;, DBURL)
modparam(&quot;auth_db&quot;, &quot;calculate_ha1&quot;, yes)
modparam(&quot;auth_db&quot;, &quot;password_column&quot;, &quot;password&quot;)
modparam(&quot;auth_db&quot;, &quot;load_credentials&quot;, &quot;&quot;)
modparam(&quot;auth_db&quot;, &quot;use_domain&quot;, MULTIDOMAIN)

# ----- permissions params -----
#!ifdef WITH_IPAUTH
modparam(&quot;permissions&quot;, &quot;db_url&quot;, DBURL)
modparam(&quot;permissions&quot;, &quot;db_mode&quot;, 1)
#!endif

#!endif


# ----- alias_db params -----
#!ifdef WITH_ALIASDB
modparam(&quot;alias_db&quot;, &quot;db_url&quot;, DBURL)
modparam(&quot;alias_db&quot;, &quot;use_domain&quot;, MULTIDOMAIN)
#!endif


# ----- domain params -----
#!ifdef WITH_MULTIDOMAIN
modparam(&quot;domain&quot;, &quot;db_url&quot;, DBURL)
# use caching
modparam(&quot;domain&quot;, &quot;db_mode&quot;, 1)
# register callback to match myself condition with domains list
modparam(&quot;domain&quot;, &quot;register_myself&quot;, 1)
#!endif


#!ifdef WITH_PRESENCE
# ----- presence params -----
modparam(&quot;presence&quot;, &quot;db_url&quot;, DBURL)

# ----- presence_xml params -----
modparam(&quot;presence_xml&quot;, &quot;db_url&quot;, DBURL)
modparam(&quot;presence_xml&quot;, &quot;force_active&quot;, 1)
#!endif


#!ifdef WITH_NAT
# ----- rtpproxy params -----
modparam(&quot;rtpproxy&quot;, &quot;rtpproxy_sock&quot;, &quot;udp:<a href="http://127.0.0.1:7722">127.0.0.1:7722</a>&quot;)

# ----- nathelper params -----
modparam(&quot;nathelper&quot;, &quot;natping_interval&quot;, 30)
modparam(&quot;nathelper&quot;, &quot;ping_nated_only&quot;, 1)
modparam(&quot;nathelper&quot;, &quot;sipping_bflag&quot;, FLB_NATSIPPING)
modparam(&quot;nathelper&quot;, &quot;sipping_from&quot;, &quot;<a href="mailto:sip%3Apinger@kamailio.org">sip:pinger@kamailio.org</a>&quot;)

# params needed for NAT traversal in other modules
modparam(&quot;nathelper|registrar&quot;, &quot;received_avp&quot;, &quot;$avp(RECEIVED)&quot;)
modparam(&quot;usrloc&quot;, &quot;nat_bflag&quot;, FLB_NATB)
#!endif


#!ifdef WITH_TLS
# ----- tls params -----
modparam(&quot;tls&quot;, &quot;config&quot;, &quot;/etc/kamailio/tls.cfg&quot;)
#!endif

#!ifdef WITH_ANTIFLOOD
# ----- pike params -----
modparam(&quot;pike&quot;, &quot;sampling_time_unit&quot;, 2)
modparam(&quot;pike&quot;, &quot;reqs_density_per_unit&quot;, 16)
modparam(&quot;pike&quot;, &quot;remove_latency&quot;, 4)

# ----- htable params -----
# ip ban htable with autoexpire after 5 minutes
modparam(&quot;htable&quot;, &quot;htable&quot;, &quot;ipban=&gt;size=8;autoexpire=300;&quot;)
#!endif

#!ifdef WITH_XMLRPC
# ----- xmlrpc params -----
modparam(&quot;xmlrpc&quot;, &quot;route&quot;, &quot;XMLRPC&quot;);
modparam(&quot;xmlrpc&quot;, &quot;url_match&quot;, &quot;^/RPC&quot;)
#!endif

####### Routing Logic ########


# Main SIP request routing logic
# - processing of any incoming SIP request starts with this route
route {

        # per request initial checks
        route(REQINIT);

        # NAT detection
        route(NAT);

        # handle requests within SIP dialogs
        route(WITHINDLG);

        ### only initial requests (no To tag)

        # CANCEL processing
        if (is_method(&quot;CANCEL&quot;))
        {
                if (t_check_trans())
                        t_relay();
                exit;
        }

        t_check_trans();

        # authentication
        route(AUTH);

        # record routing for dialog forming requests (in case they are routed)
        # - remove preloaded route headers
        remove_hf(&quot;Route&quot;);
        if (is_method(&quot;INVITE|SUBSCRIBE&quot;))
                record_route();

        # account only INVITEs
        if (is_method(&quot;INVITE&quot;))
        {
                setflag(FLT_ACC); # do accounting
        }

        # dispatch requests to foreign domains
        route(SIPOUT);

        ### requests for my local domains

        # handle presence related requests
        route(PRESENCE);

        # handle registrations
        route(REGISTRAR);

        if ($rU==$null)
        {
                # request with no Username in RURI
                sl_send_reply(&quot;484&quot;,&quot;Address Incomplete&quot;);
                exit;
        }

        # dispatch destinations to PSTN
        route(PSTN);

        # user location service
        route(LOCATION);

        route(RELAY);
}


route[RELAY] {
#!ifdef WITH_NAT
        if (check_route_param(&quot;nat=yes&quot;)) {
                setbflag(FLB_NATB);
        }
        if (isflagset(FLT_NATS) || isbflagset(FLB_NATB)) {
                route(RTPPROXY);
        }
#!endif

        /* example how to enable some additional event routes */
        if (is_method(&quot;INVITE&quot;)) {
                #t_on_branch(&quot;BRANCH_ONE&quot;);
                t_on_reply(&quot;REPLY_ONE&quot;);
                t_on_failure(&quot;FAIL_ONE&quot;);
        }

        if (!t_relay()) {
                sl_reply_error();
        }
        exit;
}

# Per SIP request initial checks
route[REQINIT] {
#!ifdef WITH_ANTIFLOOD
        # flood dection from same IP and traffic ban for a while
        # be sure you exclude checking trusted peers, such as pstn gateways
        # - local host excluded (e.g., loop to self)
        if(src_ip!=myself)
        {
                if($sht(ipban=&gt;$si)!=$null)
                {
                        # ip is already blocked
                        xdbg(&quot;request from blocked IP - $rm from $fu (IP:$si:$sp)\n&quot;);
                        exit;
                }
                if (!pike_check_req())
                {
                        xlog(&quot;L_ALERT&quot;,&quot;ALERT: pike blocking $rm from $fu (IP:$si:$sp)\n&quot;);
                        $sht(ipban=&gt;$si) = 1;
                        exit;
                }
        }
#!endif

        if (!mf_process_maxfwd_header(&quot;10&quot;)) {
                sl_send_reply(&quot;483&quot;,&quot;Too Many Hops&quot;);
                exit;
        }

        if(!sanity_check(&quot;1511&quot;, &quot;7&quot;))
        {
                xlog(&quot;Malformed SIP message from $si:$sp\n&quot;);
                exit;
        }
}

# Handle requests within SIP dialogs
route[WITHINDLG] {
        if (has_totag()) {
                # sequential request withing a dialog should
                # take the path determined by record-routing
                if (loose_route()) {
                        if (is_method(&quot;BYE&quot;)) {
                                setflag(FLT_ACC); # do accounting ...
                                setflag(FLT_ACCFAILED); # ... even if the transaction fails
                        }
                        route(RELAY);
                } else {
                        if (is_method(&quot;SUBSCRIBE&quot;) &amp;&amp; uri == myself) {
                                # in-dialog subscribe requests
                                route(PRESENCE);
                                exit;
                        }
                        if ( is_method(&quot;ACK&quot;) ) {
                                if ( t_check_trans() ) {
                                        # no loose-route, but stateful ACK;
                                        # must be an ACK after a 487
                                        # or e.g. 404 from upstream server
                                        t_relay();
                                        exit;
                                } else {
                                        # ACK without matching transaction ... ignore and discard
                                        exit;
                                }
                        }
                        sl_send_reply(&quot;404&quot;,&quot;Not here&quot;);
                }
                exit;
        }
}

# Handle SIP registrations
route[REGISTRAR] {
        if (is_method(&quot;REGISTER&quot;))
        {
                if(isflagset(FLT_NATS))
                {
                        setbflag(FLB_NATB);
                        # uncomment next line to do SIP NAT pinging 
                        ## setbflag(FLB_NATSIPPING);
                }
                if (!save(&quot;location&quot;))
                        sl_reply_error();

                exit;
        }
}

# USER location service
route[LOCATION] {

#!ifdef WITH_ALIASDB
        # search in DB-based aliases
        alias_db_lookup(&quot;dbaliases&quot;);
#!endif

        if (!lookup(&quot;location&quot;)) {
                switch ($rc) {
                        case -1:
                        case -3:
                                t_newtran();
                                t_reply(&quot;404&quot;, &quot;Not Found&quot;);
                                exit;
                        case -2:
                                sl_send_reply(&quot;405&quot;, &quot;Method Not Allowed&quot;);
                                exit;
                }
        }

        # when routing via usrloc, log the missed calls also
        if (is_method(&quot;INVITE&quot;))
        {
                setflag(FLT_ACCMISSED);
        }
}

# Presence server route
route[PRESENCE] {
        if(!is_method(&quot;PUBLISH|SUBSCRIBE&quot;))
                return;

#!ifdef WITH_PRESENCE
        if (!t_newtran())
        {
                sl_reply_error();
                exit;
        };

        if(is_method(&quot;PUBLISH&quot;))
        {
                handle_publish();
                t_release();
        }
        else
        if( is_method(&quot;SUBSCRIBE&quot;))
        {
                handle_subscribe();
                t_release();
        }
        exit;
#!endif
        
        # if presence enabled, this part will not be executed
        if (is_method(&quot;PUBLISH&quot;) || $rU==$null)
        {
                sl_send_reply(&quot;404&quot;, &quot;Not here&quot;);
                exit;
        }
        return;
}

# Authentication route
route[AUTH] {
#!ifdef WITH_AUTH
        if (is_method(&quot;REGISTER&quot;))
        {
                # authenticate the REGISTER requests (uncomment to enable auth)
                if (!www_authorize(&quot;$td&quot;, &quot;subscriber&quot;))
                {
                        www_challenge(&quot;$td&quot;, &quot;0&quot;);
                        exit;
                }

                if ($au!=$tU)
                {
                        sl_send_reply(&quot;403&quot;,&quot;Forbidden auth ID&quot;);
                        exit;
                }
        } else {

#!ifdef WITH_IPAUTH
                if(allow_source_address())
                {
                        # source IP allowed
                        return;
                }
#!endif

                # authenticate if from local subscriber
                if (from_uri==myself)
                {
                        if (!proxy_authorize(&quot;$fd&quot;, &quot;subscriber&quot;)) {
                                proxy_challenge(&quot;$fd&quot;, &quot;0&quot;);
                                exit;
                        }
                        if (is_method(&quot;PUBLISH&quot;))
                        {
                                if ($au!=$tU) {
                                        sl_send_reply(&quot;403&quot;,&quot;Forbidden auth ID&quot;);
                                        exit;
                                }
                        } else {
                                if ($au!=$fU) {
                                        sl_send_reply(&quot;403&quot;,&quot;Forbidden auth ID&quot;);
                                        exit;
                                }
                        }

                        consume_credentials();
                        # caller authenticated
                } else {
                        # caller is not local subscriber, then check if it calls
                        # a local destination, otherwise deny, not an open relay here
                        if (!uri==myself)
                        {
                                sl_send_reply(&quot;403&quot;,&quot;Not relaying&quot;);
                                exit;
                        }
                }
        }
#!endif
        return;
}

# Caller NAT detection route
route[NAT] {
#!ifdef WITH_NAT
        force_rport();
        if (nat_uac_test(&quot;19&quot;)) {
                if (method==&quot;REGISTER&quot;) {
                        fix_nated_register();
                } else {
                        fix_nated_contact();
                }
                setflag(FLT_NATS);
        }
#!endif
        return;
}

# RTPProxy control
route[RTPPROXY] {
#!ifdef WITH_NAT
        if (is_method(&quot;BYE&quot;)) {
                unforce_rtp_proxy();
        } else if (is_method(&quot;INVITE&quot;)){
                force_rtp_proxy();
        }
        if (!has_totag()) add_rr_param(&quot;;nat=yes&quot;);
#!endif
        return;
}

# Routing to foreign domains
route[SIPOUT] {
        if (!uri==myself)
        {
                append_hf(&quot;P-hint: outbound\r\n&quot;);
                route(RELAY);
        }
}

# PSTN GW routing
route[PSTN] {
#!ifdef WITH_PSTN
        # check if PSTN GW IP is defined
        if (strempty($sel(cfg_get.pstn.gw_ip))) {
                xlog(&quot;SCRIPT: PSTN rotuing enabled but pstn.gw_ip not defined\n&quot;);
                return;
        }

        # route to PSTN dialed numbers starting with &#39;+&#39; or &#39;00&#39;
        #     (international format)
        # - update the condition to match your dialing rules for PSTN routing
        if(!($rU=~&quot;^(\+|00)[1-9][0-9]{3,20}$&quot;))
                return;

        # only local users allowed to call
        if(from_uri!=myself) {
                sl_send_reply(&quot;403&quot;, &quot;Not Allowed&quot;);
                exit;
        }

        $ru = &quot;sip:&quot; + $rU + &quot;@&quot; + $sel(cfg_get.pstn.gw_ip);

        route(RELAY);
        exit;
#!endif

        return;
}

# XMLRPC routing
#!ifdef WITH_XMLRPC
route[XMLRPC]
{
        # allow XMLRPC from localhost
        if ((method==&quot;POST&quot; || method==&quot;GET&quot;)
                        &amp;&amp; (src_ip==127.0.0.1)) {
                # close connection only for xmlrpclib user agents (there is a bug in
                # xmlrpclib: it waits for EOF before interpreting the response).
                if ($hdr(User-Agent) =~ &quot;xmlrpclib&quot;)
                        set_reply_close();
                set_reply_no_connect();
                dispatch_rpc();
                exit;
        }
        send_reply(&quot;403&quot;, &quot;Forbidden&quot;);
        exit;
}
#!endif

# Sample branch router
branch_route[BRANCH_ONE] {
        xdbg(&quot;new branch at $ru\n&quot;);
}

# Sample onreply route
onreply_route[REPLY_ONE] {
        xdbg(&quot;incoming reply\n&quot;);
#!ifdef WITH_NAT
        if ((isflagset(FLT_NATS) || isbflagset(FLB_NATB))
                        &amp;&amp; status=~&quot;(183)|(2[0-9][0-9])&quot;) {
                force_rtp_proxy();
        }
        if (isbflagset(&quot;6&quot;)) {
                fix_nated_contact();
        }
#!endif
}

# Sample failure route
failure_route[FAIL_ONE] {
#!ifdef WITH_NAT
        if (is_method(&quot;INVITE&quot;)
                        &amp;&amp; (isbflagset(FLB_NATB) || isflagset(FLT_NATS))) {
                unforce_rtp_proxy();
        }
#!endif

        if (t_is_canceled()) {
                exit;
        }

        # uncomment the following lines if you want to block client 
        # redirect based on 3xx replies.
        ##if (t_check_status(&quot;3[0-9][0-9]&quot;)) {
        ##t_reply(&quot;404&quot;,&quot;Not found&quot;);
        ##        exit;
        ##}

        # uncomment the following lines if you want to redirect the failed 
        # calls to a different new destination
        ##if (t_check_status(&quot;486|408&quot;)) {
        ##        sethostport(&quot;<a href="http://192.168.2.100:5060">192.168.2.100:5060</a>&quot;);
        ##        append_branch();
        ##        # do not set the missed call flag again
        ##        t_relay();
        ##}
}</pre></span><br><div class="gmail_quote">On Mon, Jul 25, 2011 at 2:35 PM, Jason Penton <span dir="ltr">&lt;<a href="mailto:jason.penton@smilecoms.com">jason.penton@smilecoms.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Henrik,<div><br></div><div>it would help if you attached the config file</div><div><br></div><div>Cheers</div><div>Jason<br><br><div class="gmail_quote"><div><div></div><div class="h5">2011/7/25 Henrik Aagaard Sørensen <span dir="ltr">&lt;<a href="mailto:henrikaagaardsorensen@gmail.com" target="_blank">henrikaagaardsorensen@gmail.com</a>&gt;</span><br>


</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div class="h5">Can someone help me with the issue of no authentication in Kamailio?<div><div>

</div><div><br><br><div class="gmail_quote">
2011/7/24 Henrik Aagaard Sørensen <span dir="ltr">&lt;<a href="mailto:henrikaagaardsorensen@gmail.com" target="_blank">henrikaagaardsorensen@gmail.com</a>&gt;</span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span style="border-collapse:collapse;font-family:Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif;font-size:14px;line-height:18px"><p style="margin-top:0px;margin-right:0px;margin-bottom:1em;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-style:initial;border-color:initial;font-size:14px;vertical-align:baseline;background-color:transparent;clear:both;word-wrap:break-word;background-repeat:initial initial">





I&#39;ve installed Kamailio on Ubuntu 10.04 LTS via:<a href="http://www.kamailio.org/dokuwiki/doku.php/packages:debs" rel="nofollow" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-style:initial;border-color:initial;font-size:14px;vertical-align:baseline;background-color:transparent;color:rgb(0, 119, 204);text-decoration:none;background-repeat:initial initial" target="_blank">http://www.kamailio.org/dokuwiki/doku.php/packages:debs</a></p>





<p style="margin-top:0px;margin-right:0px;margin-bottom:1em;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-style:initial;border-color:initial;font-size:14px;vertical-align:baseline;background-color:transparent;clear:both;word-wrap:break-word;background-repeat:initial initial">





Updated /etc/kamailio/kamctlrc with: SIP_DOMAIN=MY-IP DBENGINE=MYSQL</p><p style="margin-top:0px;margin-right:0px;margin-bottom:1em;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-style:initial;border-color:initial;font-size:14px;vertical-align:baseline;background-color:transparent;clear:both;word-wrap:break-word;background-repeat:initial initial">





I&#39;ve also installed the kamailio-mysql-modules via apt-get.</p><p style="margin-top:0px;margin-right:0px;margin-bottom:1em;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-style:initial;border-color:initial;font-size:14px;vertical-align:baseline;background-color:transparent;clear:both;word-wrap:break-word;background-repeat:initial initial">





Then I&#39;ve run kamdbctl create and created the MySQL database.</p><p style="margin-top:0px;margin-right:0px;margin-bottom:1em;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-style:initial;border-color:initial;font-size:14px;vertical-align:baseline;background-color:transparent;clear:both;word-wrap:break-word;background-repeat:initial initial">





After that I&#39;ve started Kamailio via kamctl start. Success.</p><p style="margin-top:0px;margin-right:0px;margin-bottom:1em;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-style:initial;border-color:initial;font-size:14px;vertical-align:baseline;background-color:transparent;clear:both;word-wrap:break-word;background-repeat:initial initial">





At last I&#39;ve added two users: kamctl add 100 PASS1 kamctl add 101 PASS2</p><p style="margin-top:0px;margin-right:0px;margin-bottom:1em;margin-left:0px;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;border-top-width:0px;border-right-width:0px;border-bottom-width:0px;border-left-width:0px;border-style:initial;border-color:initial;font-size:14px;vertical-align:baseline;background-color:transparent;clear:both;word-wrap:break-word;background-repeat:initial initial">





Everything seems to work, but I&#39;ve found out that everyone can register and call via the server. Not only the two users/subscribers I&#39;ve added.</p></span><span style="border-collapse:collapse;font-family:Arial, &#39;Liberation Sans&#39;, &#39;DejaVu Sans&#39;, sans-serif;font-size:14px;line-height:18px">How come authorization isn&#39;t working?</span>
</blockquote></div><br>
</div></div><br></div></div>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br></div>
<br>_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
<br></blockquote></div><br></div>