<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
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>
&nbsp;<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>
&nbsp;<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 &gt;= 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>
&nbsp;<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>
&nbsp;<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>
&nbsp;<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: http://www.kamailio.org</FONT><BR>
<FONT size=2># - svn: http://openser.svn.sourceforge.net/viewvc/openser/</FONT><BR>
<FONT size=2>#</FONT><BR>
<FONT size=2># Direct your questions about this file to: &lt;users@lists.kamailio.org&gt;</FONT><BR>
<FONT size=2>#</FONT><BR>
<FONT size=2># Refer to the Core CookBook at http://www.kamailio.org/dokuwiki/doku.php</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: http://www.rtpproxy.org</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>&nbsp;</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>&nbsp;</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:192.168.1.2:5060</FONT><BR>
<FONT size=2>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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:192.168.1.2:5060")</FONT><BR>
<FONT size=2># -- nathelper</FONT><BR>
<FONT size=2>#n#modparam("nathelper", "rtpproxy_sock", "udp:127.0.0.1:7722")</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", "sip:pinger@kamailio.org")</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>&nbsp;</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") &amp;&amp; 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=="tls_domain1.net") {</FONT><BR>
<FONT size=2>## t_relay("tls:domain1.net");</FONT><BR>
<FONT size=2>## exit;</FONT><BR>
<FONT size=2>##} else if($rd=="tls_domain2.net") {</FONT><BR>
<FONT size=2>## t_relay("tls:domain2.net");</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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>&nbsp;</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)) &amp;&amp; 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>&nbsp;</FONT><BR>
<FONT size=2>failure_route[1] {</FONT><BR>
<FONT size=2>#n# if (is_method("INVITE")</FONT><BR>
<FONT size=2>#n# &amp;&amp; (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("192.168.2.100:5060");</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>
&nbsp;<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>
&nbsp;<BR>
Problem is same in two files...<BR>
Please help me...<BR>
Thanks in advance....<BR>
&nbsp;<BR>
regards,<BR>
Mythili.<BR></FONT></FONT><FONT size=1></FONT><br /><hr />Date India’s Teen Diva. Find out if you hit it off with her or are her fiery opposite. <a href='http://www.WindowsLivePlanet.com/DateDiva' target='_new'>Drag n’ drop</a></body>
</html>