Hiii...I installed kamailio 1.5.1 and mysql 5.0.37 properly. Authnetication is working properly. Now i'm going to configure the feature "speed dial".<br> <br>I tried with two config files. I'm facing the same problem with two config files..<br>
1st config file<br>-----------------------------------------------------------<br><font size="1"><font size="2">#</font><br><font size="2"># $Id: speeddial.cfg 4585 2008-08-06 08:20:30Z klaus_darilion $</font><br><font size="2">#</font><br>
<font size="2"># sample config script to use speeddial module</font><br><font size="2">#</font><br><font size="2">debug=3</font><br><font size="2">log_stderror=yes</font><br><font size="2">log_facility=LOG_LOCAL0</font><br>
<font size="2">fork=yes</font><br><font size="2">children=4</font><br><font size="2"># ----------- global configuration parameters ------------------------</font><br><font size="2">check_via=no # (cmd. line: -v)</font><br>
<font size="2">dns=no # (cmd. line: -r)</font><br><font size="2">rev_dns=no # (cmd. line: -R)</font><br></font><font size="2">port=506<font face="Courier New">0<br></font></font># ------------------ module loading ----------------------------------<br>
loadmodule "/usr/local/lib/kamailio/modules/sl.so"<br>loadmodule "/usr/local/lib/kamailio/modules/tm.so"<br>loadmodule "/usr/local/lib/kamailio/modules/rr.so"<br>loadmodule "/usr/local/lib/kamailio/modules/maxfwd.so"<br>
loadmodule "/usr/local/lib/kamailio/modules/usrloc.so"<br>loadmodule "/usr/local/lib/kamailio/modules/registrar.so"<br>loadmodule "/usr/local/lib/kamailio/modules/textops.so"<br>loadmodule "/usr/local/lib/kamailio/modules/db_mysql.so"<br>
loadmodule "/usr/local/lib/kamailio/modules/speeddial.so"<br>loadmodule "/usr/local/lib/kamailio/modules/mi_fifo.so"<br>loadmodule "/usr/local/lib/kamailio/modules/xlog.so"<br># ----------------- setting module-specific parameters ---------------<br>
modparam("speeddial", "db_url", "mysql://openser:openserrw@localhost/openser")<br>modparam("speeddial", "use_domain", 1)<br> <br># -- mi_fifo params --<br>modparam("mi_fifo", "fifo_name", "/tmp/openser_fifo")<br>
# -- usrloc params --<br>modparam("usrloc", "db_mode", 0)<br># -- rr params --<br># add value to ;lr param to make some broken UAs happy<br>modparam("rr", "enable_full_lr", 1)<br># ------------------------- request routing logic -------------------<br>
# main routing logic<br>route{<br># initial sanity checks <br>if (!mf_process_maxfwd_header("10"))<br>{<br>sl_send_reply("483","Too Many Hops");<br>exit;<br>};<br>if (msg:len >= max_len )<br>
{<br>sl_send_reply("513", "Message too big");<br>exit;<br>};<br>if (!method=="REGISTER") record_route();<br>if (loose_route())<br>{<br>if (!t_relay())<br>{<br>sl_reply_error();<br>};<br>exit;<br>
};<br>if (!uri==myself)<br>{<br>if (!t_relay())<br>{<br>sl_reply_error();<br>};<br>exit;<br>};<br>if (uri==myself)<br>{<br>if (method=="REGISTER")<br>{<br>save("location");<br>exit;<br>};<br>if(uri=~"sip:[0-9]{2}@.*"){<br>
xlog("L_INFO","mylog: test1.\n");<br>sd_lookup("speed_dial");<br>#sd_lookup("speed_dial", "sip:$au@$fd");<br>xlog("L_INFO","mylog: test2.\n");<br>}<br>
lookup("aliases");<br>if (!uri==myself)<br>{<br>if (!t_relay())<br>{<br>sl_reply_error();<br>};<br>exit;<br>};<br>if (!lookup("location"))<br>{<br>sl_send_reply("404", "Not Found");<br>
exit;<br>};<br>};<br>if (!t_relay())<br>{<br>sl_reply_error();<br>};<br>}<br> <br>--------------------------------------------------------------------<br>I'm using the table speed_dial. My data in table is <br>username=5001<br>
domain=192.168.64.94<br>sd_username=51<br>sd_domain=192.168.64.94<br> <br>I dialled 51 from useragent 1001. the output is not found.<br>but it is displaying test1 and test2 messages from my cfg file which i gave, i.e., it is entring into loop and function sd_lookup("speed_dial"). But the problem with speed_dial i think so...<br>
Please help me......<br> <br>2nd config file<br>---------------------------------------------------------------------<br><font style="FONT-SIZE: 8pt" size="1"><font size="2">#</font><br><font size="2"># $Id: kamailio.cfg 5881 2009-06-22 09:13:04Z henningw $</font><br>
<font size="2">#</font><br><font size="2"># Kamailio (OpenSER) SIP Server - basic configuration script</font><br><font size="2"># - web: <a href="http://www.kamailio.org">http://www.kamailio.org</a></font><br><font size="2"># - svn: <a href="http://openser.svn.sourceforge.net/viewvc/openser/">http://openser.svn.sourceforge.net/viewvc/openser/</a></font><br>
<font size="2">#</font><br><font size="2"># Direct your questions about this file to: <<a href="mailto:users@lists.kamailio.org">users@lists.kamailio.org</a>></font><br><font size="2">#</font><br><font size="2"># Refer to the Core CookBook at <a href="http://www.kamailio.org/dokuwiki/doku.php">http://www.kamailio.org/dokuwiki/doku.php</a></font><br>
<font size="2"># for an explanation of possible statements, functions and parameters.</font><br><font size="2">#</font><br><font size="2"># There are comments showing how to enable different features in th econfig</font><br>
<font size="2"># file. Such commented code starts with #X# where X is a letter to identify</font><br><font size="2"># a feature. Delete entire #X# if you want to enable that feature. Next are</font><br><font size="2"># sed commands that help you enable such features.</font><br>
<font size="2">#</font><br><font size="2"># *** To enamble mysql execute:</font><br><font size="2"># sed -i 's///g' kamailio.cfg</font><br><font size="2">#</font><br><font size="2"># *** To enamble authentication execute:</font><br>
<font size="2"># - enable mysql</font><br><font size="2"># sed -i 's///g' kamailio.cfg</font><br><font size="2"># - add users using 'kamctl'</font><br><font size="2">#</font><br><font size="2"># *** To enamble persistent user location execute:</font><br>
<font size="2"># - enable mysql</font><br><font size="2"># sed -i 's/#u#//g' kamailio.cfg</font><br><font size="2">#</font><br><font size="2"># *** To enamble presence server execute:</font><br><font size="2"># - enable mysql</font><br>
<font size="2"># sed -i 's/#p#//g' kamailio.cfg</font><br><font size="2">#</font><br><font size="2"># *** To enamble nat traversal execute:</font><br><font size="2"># sed -i 's/#n#//g' kamailio.cfg</font><br>
<font size="2"># - install RTPProxy: <a href="http://www.rtpproxy.org">http://www.rtpproxy.org</a></font><br><font size="2"># - start RTPProxy:</font><br><font size="2"># rtpproxy -l _your_public_ip_ -s udp:localhost:7722</font><br>
<font size="2">#</font><br><font size="2"># *** To enhance accounting execute:</font><br><font size="2"># - enable mysql</font><br><font size="2"># sed -i 's/#c#//g' kamailio.cfg</font><br><font size="2"># - add following columns to database</font><br>
<font size="2"># ALTER TABLE acc ADD COLUMN src_user VARCHAR(64) NOT NULL DEFAULT '';</font><br><font size="2"># ALTER TABLE acc ADD COLUMN src_domain VARCHAR(128) NOT NULL DEFAULT '';</font><br><font size="2"># ALTER TABLE acc ADD COLUMN dst_ouser VARCHAR(64) NOT NULL DEFAULT '';</font><br>
<font size="2"># ALTER TABLE acc ADD COLUMN dst_user VARCHAR(64) NOT NULL DEFAULT '';</font><br><font size="2"># ALTER TABLE acc ADD COLUMN dst_domain VARCHAR(128) NOT NULL DEFAULT '';</font><br><font size="2"># ALTER TABLE missed_calls ADD COLUMN src_user VARCHAR(64) NOT NULL DEFAULT '';</font><br>
<font size="2"># ALTER TABLE missed_calls ADD COLUMN src_domain VARCHAR(128) NOT NULL DEFAULT '';</font><br><font size="2"># ALTER TABLE missed_calls ADD COLUMN dst_ouser VARCHAR(64) NOT NULL DEFAULT '';</font><br>
<font size="2"># ALTER TABLE missed_calls ADD COLUMN dst_user VARCHAR(64) NOT NULL DEFAULT '';</font><br><font size="2"># ALTER TABLE missed_calls ADD COLUMN dst_domain VARCHAR(128) NOT NULL DEFAULT '';</font><br>
<font size="2">#</font><br><font size="2"> </font><br><font size="2">####### Global Parameters #########</font><br><font size="2">debug=3</font><br><font size="2">log_stderror=yes</font><br><font size="2">log_facility=LOG_LOCAL0</font><br>
<font size="2">fork=yes</font><br><font size="2">children=4</font><br><font size="2">/* uncomment the following lines to enable debugging */</font><br><font size="2">#debug=6</font><br><font size="2">#fork=no</font><br><font size="2">#log_stderror=yes</font><br>
<font size="2">/* uncomment the next line to disable TCP (default on) */</font><br><font size="2">#disable_tcp=yes</font><br><font size="2">/* uncomment the next line to enable the auto temporary blacklisting of </font><br>
<font size="2">not available destinations (default disabled) */</font><br><font size="2">#disable_dns_blacklist=no</font><br><font size="2">/* uncomment the next line to enable IPv6 lookup after IPv4 dns </font><br><font size="2">lookup failures (default disabled) */</font><br>
<font size="2">#dns_try_ipv6=yes</font><br><font size="2">/* uncomment the next line to disable the auto discovery of local aliases</font><br><font size="2">based on revers DNS on IPs (default on) */</font><br><font size="2">#auto_aliases=no</font><br>
<font size="2">/* uncomment the following lines to enable TLS support (default off) */</font><br><font size="2">#disable_tls = no</font><br><font size="2">#listen = tls:your_IP:5061</font><br><font size="2">#tls_verify_server = 1</font><br>
<font size="2">#tls_verify_client = 1</font><br><font size="2">#tls_require_client_certificate = 0</font><br><font size="2">#tls_method = TLSv1</font><br><font size="2">#tls_certificate = "/usr/local/etc/kamailio/tls/user/user-cert.pem"</font><br>
<font size="2">#tls_private_key = "/usr/local/etc/kamailio/tls/user/user-privkey.pem"</font><br><font size="2">#tls_ca_list = "/usr/local/etc/kamailio/tls/user/user-calist.pem"</font><br><font size="2"> </font><br>
<font size="2">port=5070</font><br><font size="2">/* uncomment and configure the following line if you want Kamailio to </font><br><font size="2">bind on a specific interface/port/proto (default bind on all available) */</font><br>
<font size="2">#listen=udp:<a href="http://192.168.1.2:5060">192.168.1.2:5060</a></font><br><font size="2"> </font><br><font size="2">####### Modules Section ########</font><br><font size="2">#set module path</font><br><font size="2">mpath="/usr/local/lib/kamailio/modules/"</font><br>
<font size="2">/* uncomment next line for MySQL DB support */</font><br><font size="2">loadmodule "db_mysql.so"</font><br><font size="2">loadmodule "mi_fifo.so"</font><br><font size="2">loadmodule "sl.so"</font><br>
<font size="2">loadmodule "tm.so"</font><br><font size="2">loadmodule "rr.so"</font><br><font size="2">loadmodule "pv.so"</font><br><font size="2">loadmodule "maxfwd.so"</font><br><font size="2">loadmodule "usrloc.so"</font><br>
<font size="2">loadmodule "registrar.so"</font><br><font size="2">loadmodule "textops.so"</font><br><font size="2">loadmodule "uri_db.so"</font><br><font size="2">loadmodule "siputils.so"</font><br>
<font size="2">loadmodule "xlog.so"</font><br><font size="2">loadmodule "acc.so"</font><br><font size="2">loadmodule "speeddial.so"</font><br><font size="2">/* uncomment next lines for MySQL based authentication support </font><br>
<font size="2">NOTE: a DB (like db_mysql) module must be also loaded */</font><br><font size="2">loadmodule "auth.so"</font><br><font size="2">loadmodule "auth_db.so"</font><br><font size="2">/* uncomment next line for aliases support</font><br>
<font size="2">NOTE: a DB (like db_mysql) module must be also loaded */</font><br><font size="2">#loadmodule "alias_db.so"</font><br><font size="2">/* uncomment next line for multi-domain support</font><br><font size="2">NOTE: a DB (like db_mysql) module must be also loaded</font><br>
<font size="2">NOTE: be sure and enable multi-domain support in all used modules</font><br><font size="2">(see "multi-module params" section ) */</font><br><font size="2">#loadmodule "domain.so"</font><br>
<font size="2">/* uncomment the next two lines for presence server support</font><br><font size="2">NOTE: a DB (like db_mysql) module must be also loaded */</font><br><font size="2">#p#loadmodule "presence.so"</font><br>
<font size="2">#p#loadmodule "presence_xml.so"</font><br><font size="2">#n#loadmodule "nathelper.so"</font><br><font size="2"># ----------------- setting module-specific parameters ---------------</font><br>
<font size="2"> </font><br><font size="2"># ----- mi_fifo params -----</font><br><font size="2">modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")</font><br><font size="2"> </font><br><font size="2"># ----- rr params -----</font><br>
<font size="2"># add value to ;lr param to cope with most of the UAs</font><br><font size="2">modparam("rr", "enable_full_lr", 1)</font><br><font size="2"># do not append from tag to the RR (no need for this script)</font><br>
<font size="2">modparam("rr", "append_fromtag", 0)</font><br><font size="2"> </font><br><font size="2"># ----- rr params -----</font><br><font size="2">modparam("registrar", "method_filtering", 1)</font><br>
<font size="2">/* uncomment the next line to disable parallel forking via location */</font><br><font size="2"># modparam("registrar", "append_branches", 0)</font><br><font size="2">/* uncomment the next line not to allow more than 10 contacts per AOR */</font><br>
<font size="2">#modparam("registrar", "max_contacts", 10)</font><br><font size="2"> </font><br><font size="2"># ----- uri_db params -----</font><br><font size="2">/* by default we disable the DB support in the module as we do not need it</font><br>
<font size="2">in this configuration */</font><br><font size="2">modparam("uri_db", "use_uri_table", 0)</font><br><font size="2">modparam("uri_db", "db_url", "")</font><br>
<font size="2"> </font><br><font size="2"># ----- acc params -----</font><br><font size="2">/* what sepcial events should be accounted ? */</font><br><font size="2">modparam("acc", "early_media", 1)</font><br>
<font size="2">modparam("acc", "report_ack", 1)</font><br><font size="2">modparam("acc", "report_cancels", 1)</font><br><font size="2">/* by default ww do not adjust the direct of the sequential requests.</font><br>
<font size="2">if you enable this parameter, be sure the enable "append_fromtag"</font><br><font size="2">in "rr" module */</font><br><font size="2">modparam("acc", "detect_direction", 0)</font><br>
<font size="2">/* account triggers (flags) */</font><br><font size="2">modparam("acc", "failed_transaction_flag", 3)</font><br><font size="2">modparam("acc", "log_flag", 1)</font><br>
<font size="2">modparam("acc", "log_missed_flag", 2)</font><br><font size="2">modparam("acc", "log_extra", </font><br><font size="2">"src_user=$fU;src_domain=$fd;dst_ouser=$tU;dst_user=$rU;dst_domain=$rd")</font><br>
<font size="2">/* uncomment the following lines to enable DB accounting also */</font><br><font size="2">#c#modparam("acc", "db_flag", 1)</font><br><font size="2">#c#modparam("acc", "db_missed_flag", 2)</font><br>
<font size="2">#c#modparam("acc", "db_url",</font><br><font size="2">#c# "mysql://openser:openserrw@localhost/openser")</font><br><font size="2">#c#modparam("acc", "db_extra",</font><br>
<font size="2">#c# "src_user=$fU;src_domain=$fd;dst_ouser=$tU;dst_user=$rU;dst_domain=$rd")</font><br><font size="2"> </font><br><font size="2"># ----- usrloc params -----</font><br><font size="2">/* uncomment the following lines if you want to enable DB persistency</font><br>
<font size="2">for location entries */</font><br><font size="2">#u#modparam("usrloc", "db_mode", 0)</font><br><font size="2">#u#modparam("usrloc", "db_url",</font><br><font size="2">#u# "mysql://openser:openserrw@localhost/openser")</font><br>
<font size="2"># ----- auth_db params -----</font><br><font size="2">/* uncomment the following lines if you want to enable the DB based</font><br><font size="2">authentication */</font><br><font size="2">modparam("auth_db", "calculate_ha1", yes)</font><br>
<font size="2">modparam("auth_db", "password_column", "password")</font><br><font size="2">modparam("auth_db", "db_url",</font><br><font size="2">"mysql://openser:openserrw@localhost/openser")</font><br>
<font size="2">modparam("auth_db", "load_credentials", "")</font><br><font size="2"> </font><br><font size="2"># ----- alias_db params -----</font><br><font size="2">/* uncomment the following lines if you want to enable the DB based</font><br>
<font size="2">aliases */</font><br><font size="2">#modparam("alias_db", "db_url",</font><br><font size="2"># "mysql://openser:openserrw@localhost/openser")</font><br><font size="2"> </font><br>
<font size="2"># ----- domain params -----</font><br><font size="2">/* uncomment the following lines to enable multi-domain detection</font><br><font size="2">support */</font><br><font size="2">#modparam("domain", "db_url",</font><br>
<font size="2"># "mysql://openser:openserrw@localhost/openser")</font><br><font size="2">#modparam("domain", "db_mode", 1) # Use caching</font><br><font size="2"> </font><br><font size="2"># ----- multi-module params -----</font><br>
<font size="2">/* uncomment the following line if you want to enable multi-domain support</font><br><font size="2">in the modules (dafault off) */</font><br><font size="2">#modparam("alias_db|auth_db|usrloc|uri_db", "use_domain", 1)</font><br>
<font size="2"> </font><br><font size="2"># ----- presence params -----</font><br><font size="2">/* uncomment the following lines if you want to enable presence */</font><br><font size="2">#p#modparam("presence|presence_xml", "db_url",</font><br>
<font size="2">#p# "mysql://openser:openserrw@localhost/openser")</font><br><font size="2">#p#modparam("presence_xml", "force_active", 1)</font><br><font size="2">#p#modparam("presence", "server_address", "sip:<a href="http://192.168.1.2:5060">192.168.1.2:5060</a>")</font><br>
<font size="2"># -- nathelper</font><br><font size="2">#n#modparam("nathelper", "rtpproxy_sock", "udp:<a href="http://127.0.0.1:7722">127.0.0.1:7722</a>")</font><br><font size="2">#n#modparam("nathelper", "natping_interval", 30)</font><br>
<font size="2">#n#modparam("nathelper", "ping_nated_only", 1)</font><br><font size="2">#n#modparam("nathelper", "sipping_bflag", 7)</font><br><font size="2">#n#modparam("nathelper", "sipping_from", "<a href="mailto:sip%3Apinger@kamailio.org">sip:pinger@kamailio.org</a>")</font><br>
<font size="2">#n#modparam("registrar|nathelper", "received_avp", "$avp(i:80)")</font><br><font size="2">#n#modparam("usrloc", "nat_bflag", 6)</font><br><font size="2">####### Routing Logic ########</font><br>
<font size="2"> </font><br><font size="2"># main request routing logic</font><br><font size="2">route{</font><br><font size="2">if (!mf_process_maxfwd_header("10")) {</font><br><font size="2">sl_send_reply("483","Too Many Hops");</font><br>
<font size="2">exit;</font><br><font size="2">}</font><br><font size="2">#</font><br><font size="2"># NAT detection</font><br><font size="2">route(4);</font><br><font size="2">if (has_totag()) {</font><br><font size="2"># sequential request withing a dialog should</font><br>
<font size="2"># take the path determined by record-routing</font><br><font size="2">if (loose_route()) {</font><br><font size="2">if (is_method("BYE")) {</font><br><font size="2">setflag(1); # do accounting ...</font><br>
<font size="2">setflag(3); # ... even if the transaction fails</font><br><font size="2">}</font><br><font size="2">route(1);</font><br><font size="2">} else {</font><br><font size="2">if (is_method("SUBSCRIBE") && uri == myself) {</font><br>
<font size="2"># in-dialog subscribe requests</font><br><font size="2">route(2);</font><br><font size="2">exit;</font><br><font size="2">}</font><br><font size="2">if ( is_method("ACK") ) {</font><br><font size="2">if ( t_check_trans() ) {</font><br>
<font size="2"># non loose-route, but stateful ACK; must be an ACK after a 487 or e.g. 404 from upstream server</font><br><font size="2">t_relay();</font><br><font size="2">exit;</font><br><font size="2">} else {</font><br>
<font size="2"># ACK without matching transaction ... ignore and discard.\n");</font><br><font size="2">exit;</font><br><font size="2">}</font><br><font size="2">}</font><br><font size="2">sl_send_reply("404","Not here");</font><br>
<font size="2">}</font><br><font size="2">exit;</font><br><font size="2">}</font><br><font size="2">#initial requests</font><br><font size="2"># CANCEL processing</font><br><font size="2">if (is_method("CANCEL"))</font><br>
<font size="2">{</font><br><font size="2">if (t_check_trans())</font><br><font size="2">t_relay();</font><br><font size="2">exit;</font><br><font size="2">}</font><br><font size="2">t_check_trans();</font><br><font size="2"># authentication</font><br>
<font size="2">route(3);</font><br><font size="2"># record routing</font><br><font size="2">if (!is_method("REGISTER|MESSAGE"))</font><br><font size="2">record_route();</font><br><font size="2"># account only INVITEs</font><br>
<font size="2">if (is_method("INVITE")) {</font><br><font size="2">setflag(1); # do accounting</font><br><font size="2">}</font><br><font size="2">if (!uri==myself)</font><br><font size="2">/* replace with following line if multi-domain support is used */</font><br>
<font size="2">##if (!is_uri_host_local())</font><br><font size="2">{</font><br><font size="2">append_hf("P-hint: outbound\r\n"); </font><br><font size="2"># if you have some interdomain connections via TLS</font><br>
<font size="2">##if($rd=="<a href="http://tls_domain1.net">tls_domain1.net</a>") {</font><br><font size="2">## t_relay("tls:<a href="http://domain1.net">domain1.net</a>");</font><br><font size="2">## exit;</font><br>
<font size="2">##} else if($rd=="<a href="http://tls_domain2.net">tls_domain2.net</a>") {</font><br><font size="2">## t_relay("tls:<a href="http://domain2.net">domain2.net</a>");</font><br><font size="2">## exit;</font><br>
<font size="2">##}</font><br><font size="2">route(1);</font><br><font size="2">}</font><br><font size="2"># requests for my domain</font><br><font size="2">if( is_method("PUBLISH|SUBSCRIBE"))</font><br><font size="2">route(2);</font><br>
<font size="2">if (is_method("REGISTER"))</font><br><font size="2">{</font><br><font size="2">if (!save("location"))</font><br><font size="2">sl_reply_error();</font><br><font size="2">exit;</font><br>
<font size="2">}</font><br><font size="2">if ($rU==NULL) {</font><br><font size="2"># request with no Username in RURI</font><br><font size="2">sl_send_reply("484","Address Incomplete");</font><br><font size="2">exit;</font><br>
<font size="2">}</font><br><font size="2"># apply DB based aliases (uncomment to enable)</font><br><font size="2">##alias_db_lookup("dbaliases");</font><br><font size="2"> </font><br><font size="2">if(uri=~"sip:[0-9]{2}@.*"){</font><br>
<font size="2">xlog("L_INFO","mylog: test1.\n");</font><br><font size="2">sd_lookup("speed_dial", "sip:$au@$fd");</font><br><font size="2">#sd_lookup("speed_dial");</font><br>
<font size="2">xlog("L_INFO","mylog: test2.\n");</font><br><font size="2">}</font><br><font size="2"> </font><br><font size="2">if (!lookup("location")) {</font><br><font size="2">switch ($retcode) {</font><br>
<font size="2">case -1:</font><br><font size="2">case -3:</font><br><font size="2">t_newtran();</font><br><font size="2">t_reply("404", "Not Found");</font><br><font size="2">exit;</font><br><font size="2">case -2:</font><br>
<font size="2">sl_send_reply("405", "Method Not Allowed");</font><br><font size="2">exit;</font><br><font size="2">}</font><br><font size="2">}</font><br><font size="2"># when routing via usrloc, log the missed calls also</font><br>
<font size="2">setflag(2);</font><br><font size="2">route(1);</font><br><font size="2">}</font><br><font size="2"> </font><br><font size="2">route[1] {</font><br><font size="2">#n# if (check_route_param("nat=yes")) {</font><br>
<font size="2">#n# setbflag(6);</font><br><font size="2">#n# }</font><br><font size="2">#n# if (isflagset(5) || isbflagset(6)) {</font><br><font size="2">#n# route(5);</font><br><font size="2">#n# }</font><br><font size="2">/* example how to enable some additional event routes */</font><br>
<font size="2">if (is_method("INVITE")) {</font><br><font size="2">#t_on_branch("1");</font><br><font size="2">t_on_reply("1");</font><br><font size="2">t_on_failure("1");</font><br>
<font size="2">}</font><br><font size="2">if (!t_relay()) {</font><br><font size="2">sl_reply_error();</font><br><font size="2">}</font><br><font size="2">exit;</font><br><font size="2">}</font><br><font size="2"> </font><br>
<font size="2"># Presence route</font><br><font size="2">/* uncomment the whole following route for enabling presence server */</font><br><font size="2">route[2]</font><br><font size="2">{</font><br><font size="2">#p# if (!t_newtran())</font><br>
<font size="2">#p# {</font><br><font size="2">#p# sl_reply_error();</font><br><font size="2">#p# exit;</font><br><font size="2">#p# };</font><br><font size="2">#p#</font><br><font size="2">#p# if(is_method("PUBLISH"))</font><br>
<font size="2">#p# {</font><br><font size="2">#p# handle_publish();</font><br><font size="2">#p# t_release();</font><br><font size="2">#p# }</font><br><font size="2">#p# else</font><br><font size="2">#p# if( is_method("SUBSCRIBE"))</font><br>
<font size="2">#p# {</font><br><font size="2">#p# handle_subscribe();</font><br><font size="2">#p# t_release();</font><br><font size="2">#p# }</font><br><font size="2">#p# exit;</font><br><font size="2"></font><br><font size="2"># if presence enabled, this part will not be executed</font><br>
<font size="2">if (is_method("PUBLISH") || $rU==null)</font><br><font size="2">{</font><br><font size="2">sl_send_reply("404", "Not here");</font><br><font size="2">exit;</font><br><font size="2">}</font><br>
<font size="2">return;</font><br><font size="2">}</font><br><font size="2"># Authentication route</font><br><font size="2">/* uncomment the whole following route for enabling authentication */</font><br><font size="2">route[3] {</font><br>
<font size="2">if (is_method("REGISTER"))</font><br><font size="2">{</font><br><font size="2"># authenticate the REGISTER requests (uncomment to enable auth)</font><br><font size="2">if (!www_authorize("", "subscriber"))</font><br>
<font size="2">{</font><br><font size="2">www_challenge("", "0");</font><br><font size="2">exit;</font><br><font size="2">}</font><br><font size="2">if ($au!=$tU) </font><br><font size="2">{</font><br>
<font size="2">sl_send_reply("403","Forbidden auth ID");</font><br><font size="2">exit;</font><br><font size="2">}</font><br><font size="2">} else {</font><br><font size="2"># authenticate if from local subscriber (uncomment to enable auth)</font><br>
<font size="2">if (from_uri==myself)</font><br><font size="2">{</font><br><font size="2">if (!proxy_authorize("", "subscriber")) {</font><br><font size="2">proxy_challenge("", "0");</font><br>
<font size="2">exit;</font><br><font size="2">}</font><br><font size="2">if (is_method("PUBLISH"))</font><br><font size="2">{</font><br><font size="2">if ($au!=$tU) {</font><br><font size="2">sl_send_reply("403","Forbidden auth ID");</font><br>
<font size="2">exit;</font><br><font size="2">}</font><br><font size="2">} else {</font><br><font size="2">if ($au!=$fU) {</font><br><font size="2">sl_send_reply("403","Forbidden auth ID");</font><br><font size="2">exit;</font><br>
<font size="2">}</font><br><font size="2">}</font><br><font size="2">consume_credentials();</font><br><font size="2"># caller authenticated</font><br><font size="2">}</font><br><font size="2">}</font><br><font size="2">return;</font><br>
<font size="2">}</font><br><font size="2"># Caller NAT detection route</font><br><font size="2">/* uncomment the whole following route for enabling Caller NAT Detection */</font><br><font size="2">route[4]{</font><br><font size="2">#n# force_rport();</font><br>
<font size="2">#n# if (nat_uac_test("19")) {</font><br><font size="2">#n# if (method=="REGISTER") {</font><br><font size="2">#n# fix_nated_register();</font><br><font size="2">#n# } else {</font><br><font size="2">#n# fix_nated_contact();</font><br>
<font size="2">#n# }</font><br><font size="2">#n# setflag(5);</font><br><font size="2">#n# }</font><br><font size="2">return;</font><br><font size="2">}</font><br><font size="2"># RTPProxy control</font><br><font size="2">/* uncomment the whole following route for enabling RTPProxy Control */</font><br>
<font size="2">route[5] {</font><br><font size="2">#n# if (is_method("BYE")) {</font><br><font size="2">#n# unforce_rtp_proxy();</font><br><font size="2">#n# } else if (is_method("INVITE")){</font><br>
<font size="2">#n# force_rtp_proxy();</font><br><font size="2">#n# }</font><br><font size="2">#n# if (!has_totag()) add_rr_param(";nat=yes");</font><br><font size="2">return;</font><br><font size="2">}</font><br>
<font size="2">branch_route[1] {</font><br><font size="2">xdbg("new branch at $ru\n");</font><br><font size="2">}</font><br><font size="2"> </font><br><font size="2">onreply_route[1] {</font><br><font size="2">xdbg("incoming reply\n");</font><br>
<font size="2">#n# if ((isflagset(5) || isbflagset(6)) && status=~"(183)|(2[0-9][0-9])") {</font><br><font size="2">#n# force_rtp_proxy();</font><br><font size="2">#n# }</font><br><font size="2">#n# if (isbflagset(6)) {</font><br>
<font size="2">#n# fix_nated_contact();</font><br><font size="2">#n# }</font><br><font size="2">}</font><br><font size="2"> </font><br><font size="2">failure_route[1] {</font><br><font size="2">#n# if (is_method("INVITE")</font><br>
<font size="2">#n# && (isbflagset(6) || isflagset(5))) {</font><br><font size="2">#n# unforce_rtp_proxy();</font><br><font size="2">#n# }</font><br><font size="2">if (t_was_cancelled()) {</font><br><font size="2">exit;</font><br>
<font size="2">}</font><br><font size="2"># uncomment the following lines if you want to block client </font><br><font size="2"># redirect based on 3xx replies.</font><br><font size="2">##if (t_check_status("3[0-9][0-9]")) {</font><br>
<font size="2">##t_reply("404","Not found");</font><br><font size="2">## exit;</font><br><font size="2">##}</font><br><font size="2"># uncomment the following lines if you want to redirect the failed </font><br>
<font size="2"># calls to a different new destination</font><br><font size="2">##if (t_check_status("486|408")) {</font><br><font size="2">## sethostport("<a href="http://192.168.2.100:5060">192.168.2.100:5060</a>");</font><br>
<font size="2">## append_branch();</font><br><font size="2">## # do not set the missed call flag again</font><br><font size="2">## t_relay();</font><br><font size="2">##}</font><br><font size="2">}</font><br><font size="2">-------------------------------------------------------------------</font><br>
<font size="2">Here i'm using the table speed_dial. My data in table is <br>username=5001<br>domain=192.168.64.94<br>sd_username=51<br>sd_domain=192.168.64.94<br> <br>I dialled 51 from useragent 1001. the output is not found.<br>
but it is displaying test1 and test2 messages from my cfg file which i gave, i.e., it is entring into loop and function sd_lookup("speed_dial"). But the problem with speed_dial i think so<br> <br>Problem is same in two files...<br>
Please help me...<br>Thanks in advance....<br> <br>regards,<br>Mythili.<br></font></font><font size="1"></font><br>