Hiii...I installed kamailio 1.5.1 and mysql 5.0.37 properly. Authnetication is working properly. Now i&#39;m going to configure the feature &quot;speed dial&quot;.<br> <br>I tried with two config files. I&#39;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 &quot;/usr/local/lib/kamailio/modules/sl.so&quot;<br>loadmodule &quot;/usr/local/lib/kamailio/modules/tm.so&quot;<br>loadmodule &quot;/usr/local/lib/kamailio/modules/rr.so&quot;<br>loadmodule &quot;/usr/local/lib/kamailio/modules/maxfwd.so&quot;<br>
loadmodule &quot;/usr/local/lib/kamailio/modules/usrloc.so&quot;<br>loadmodule &quot;/usr/local/lib/kamailio/modules/registrar.so&quot;<br>loadmodule &quot;/usr/local/lib/kamailio/modules/textops.so&quot;<br>loadmodule &quot;/usr/local/lib/kamailio/modules/db_mysql.so&quot;<br>
loadmodule &quot;/usr/local/lib/kamailio/modules/speeddial.so&quot;<br>loadmodule &quot;/usr/local/lib/kamailio/modules/mi_fifo.so&quot;<br>loadmodule &quot;/usr/local/lib/kamailio/modules/xlog.so&quot;<br># ----------------- setting module-specific parameters ---------------<br>
modparam(&quot;speeddial&quot;, &quot;db_url&quot;, &quot;mysql://openser:openserrw@localhost/openser&quot;)<br>modparam(&quot;speeddial&quot;, &quot;use_domain&quot;, 1)<br> <br># -- mi_fifo params --<br>modparam(&quot;mi_fifo&quot;, &quot;fifo_name&quot;, &quot;/tmp/openser_fifo&quot;)<br>
# -- usrloc params --<br>modparam(&quot;usrloc&quot;, &quot;db_mode&quot;, 0)<br># -- rr params --<br># add value to ;lr param to make some broken UAs happy<br>modparam(&quot;rr&quot;, &quot;enable_full_lr&quot;, 1)<br># ------------------------- request routing logic -------------------<br>
# main routing logic<br>route{<br># initial sanity checks <br>if (!mf_process_maxfwd_header(&quot;10&quot;))<br>{<br>sl_send_reply(&quot;483&quot;,&quot;Too Many Hops&quot;);<br>exit;<br>};<br>if (msg:len &gt;= max_len )<br>
{<br>sl_send_reply(&quot;513&quot;, &quot;Message too big&quot;);<br>exit;<br>};<br>if (!method==&quot;REGISTER&quot;) 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==&quot;REGISTER&quot;)<br>{<br>save(&quot;location&quot;);<br>exit;<br>};<br>if(uri=~&quot;sip:[0-9]{2}@.*&quot;){<br>
xlog(&quot;L_INFO&quot;,&quot;mylog: test1.\n&quot;);<br>sd_lookup(&quot;speed_dial&quot;);<br>#sd_lookup(&quot;speed_dial&quot;, &quot;sip:$au@$fd&quot;);<br>xlog(&quot;L_INFO&quot;,&quot;mylog: test2.\n&quot;);<br>}<br>
lookup(&quot;aliases&quot;);<br>if (!uri==myself)<br>{<br>if (!t_relay())<br>{<br>sl_reply_error();<br>};<br>exit;<br>};<br>if (!lookup(&quot;location&quot;))<br>{<br>sl_send_reply(&quot;404&quot;, &quot;Not Found&quot;);<br>
exit;<br>};<br>};<br>if (!t_relay())<br>{<br>sl_reply_error();<br>};<br>}<br> <br>--------------------------------------------------------------------<br>I&#39;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(&quot;speed_dial&quot;). 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: &lt;<a href="mailto:users@lists.kamailio.org">users@lists.kamailio.org</a>&gt;</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 &#39;s///g&#39; 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 &#39;s///g&#39; kamailio.cfg</font><br><font size="2"># - add users using &#39;kamctl&#39;</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 &#39;s/#u#//g&#39; 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 &#39;s/#p#//g&#39; kamailio.cfg</font><br><font size="2">#</font><br><font size="2"># *** To enamble nat traversal execute:</font><br><font size="2"># sed -i &#39;s/#n#//g&#39; 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 &#39;s/#c#//g&#39; 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 &#39;&#39;;</font><br><font size="2"># ALTER TABLE acc ADD COLUMN src_domain VARCHAR(128) NOT NULL DEFAULT &#39;&#39;;</font><br><font size="2"># ALTER TABLE acc ADD COLUMN dst_ouser VARCHAR(64) NOT NULL DEFAULT &#39;&#39;;</font><br>
<font size="2"># ALTER TABLE acc ADD COLUMN dst_user VARCHAR(64) NOT NULL DEFAULT &#39;&#39;;</font><br><font size="2"># ALTER TABLE acc ADD COLUMN dst_domain VARCHAR(128) NOT NULL DEFAULT &#39;&#39;;</font><br><font size="2"># ALTER TABLE missed_calls ADD COLUMN src_user VARCHAR(64) NOT NULL DEFAULT &#39;&#39;;</font><br>
<font size="2"># ALTER TABLE missed_calls ADD COLUMN src_domain VARCHAR(128) NOT NULL DEFAULT &#39;&#39;;</font><br><font size="2"># ALTER TABLE missed_calls ADD COLUMN dst_ouser VARCHAR(64) NOT NULL DEFAULT &#39;&#39;;</font><br>
<font size="2"># ALTER TABLE missed_calls ADD COLUMN dst_user VARCHAR(64) NOT NULL DEFAULT &#39;&#39;;</font><br><font size="2"># ALTER TABLE missed_calls ADD COLUMN dst_domain VARCHAR(128) NOT NULL DEFAULT &#39;&#39;;</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 = &quot;/usr/local/etc/kamailio/tls/user/user-cert.pem&quot;</font><br>
<font size="2">#tls_private_key = &quot;/usr/local/etc/kamailio/tls/user/user-privkey.pem&quot;</font><br><font size="2">#tls_ca_list = &quot;/usr/local/etc/kamailio/tls/user/user-calist.pem&quot;</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=&quot;/usr/local/lib/kamailio/modules/&quot;</font><br>
<font size="2">/* uncomment next line for MySQL DB support */</font><br><font size="2">loadmodule &quot;db_mysql.so&quot;</font><br><font size="2">loadmodule &quot;mi_fifo.so&quot;</font><br><font size="2">loadmodule &quot;sl.so&quot;</font><br>
<font size="2">loadmodule &quot;tm.so&quot;</font><br><font size="2">loadmodule &quot;rr.so&quot;</font><br><font size="2">loadmodule &quot;pv.so&quot;</font><br><font size="2">loadmodule &quot;maxfwd.so&quot;</font><br><font size="2">loadmodule &quot;usrloc.so&quot;</font><br>
<font size="2">loadmodule &quot;registrar.so&quot;</font><br><font size="2">loadmodule &quot;textops.so&quot;</font><br><font size="2">loadmodule &quot;uri_db.so&quot;</font><br><font size="2">loadmodule &quot;siputils.so&quot;</font><br>
<font size="2">loadmodule &quot;xlog.so&quot;</font><br><font size="2">loadmodule &quot;acc.so&quot;</font><br><font size="2">loadmodule &quot;speeddial.so&quot;</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 &quot;auth.so&quot;</font><br><font size="2">loadmodule &quot;auth_db.so&quot;</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 &quot;alias_db.so&quot;</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 &quot;multi-module params&quot; section ) */</font><br><font size="2">#loadmodule &quot;domain.so&quot;</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 &quot;presence.so&quot;</font><br>
<font size="2">#p#loadmodule &quot;presence_xml.so&quot;</font><br><font size="2">#n#loadmodule &quot;nathelper.so&quot;</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(&quot;mi_fifo&quot;, &quot;fifo_name&quot;, &quot;/tmp/kamailio_fifo&quot;)</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(&quot;rr&quot;, &quot;enable_full_lr&quot;, 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(&quot;rr&quot;, &quot;append_fromtag&quot;, 0)</font><br><font size="2"> </font><br><font size="2"># ----- rr params -----</font><br><font size="2">modparam(&quot;registrar&quot;, &quot;method_filtering&quot;, 1)</font><br>
<font size="2">/* uncomment the next line to disable parallel forking via location */</font><br><font size="2"># modparam(&quot;registrar&quot;, &quot;append_branches&quot;, 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(&quot;registrar&quot;, &quot;max_contacts&quot;, 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(&quot;uri_db&quot;, &quot;use_uri_table&quot;, 0)</font><br><font size="2">modparam(&quot;uri_db&quot;, &quot;db_url&quot;, &quot;&quot;)</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(&quot;acc&quot;, &quot;early_media&quot;, 1)</font><br>
<font size="2">modparam(&quot;acc&quot;, &quot;report_ack&quot;, 1)</font><br><font size="2">modparam(&quot;acc&quot;, &quot;report_cancels&quot;, 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 &quot;append_fromtag&quot;</font><br><font size="2">in &quot;rr&quot; module */</font><br><font size="2">modparam(&quot;acc&quot;, &quot;detect_direction&quot;, 0)</font><br>
<font size="2">/* account triggers (flags) */</font><br><font size="2">modparam(&quot;acc&quot;, &quot;failed_transaction_flag&quot;, 3)</font><br><font size="2">modparam(&quot;acc&quot;, &quot;log_flag&quot;, 1)</font><br>
<font size="2">modparam(&quot;acc&quot;, &quot;log_missed_flag&quot;, 2)</font><br><font size="2">modparam(&quot;acc&quot;, &quot;log_extra&quot;, </font><br><font size="2">&quot;src_user=$fU;src_domain=$fd;dst_ouser=$tU;dst_user=$rU;dst_domain=$rd&quot;)</font><br>
<font size="2">/* uncomment the following lines to enable DB accounting also */</font><br><font size="2">#c#modparam(&quot;acc&quot;, &quot;db_flag&quot;, 1)</font><br><font size="2">#c#modparam(&quot;acc&quot;, &quot;db_missed_flag&quot;, 2)</font><br>
<font size="2">#c#modparam(&quot;acc&quot;, &quot;db_url&quot;,</font><br><font size="2">#c# &quot;mysql://openser:openserrw@localhost/openser&quot;)</font><br><font size="2">#c#modparam(&quot;acc&quot;, &quot;db_extra&quot;,</font><br>
<font size="2">#c# &quot;src_user=$fU;src_domain=$fd;dst_ouser=$tU;dst_user=$rU;dst_domain=$rd&quot;)</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(&quot;usrloc&quot;, &quot;db_mode&quot;, 0)</font><br><font size="2">#u#modparam(&quot;usrloc&quot;, &quot;db_url&quot;,</font><br><font size="2">#u# &quot;mysql://openser:openserrw@localhost/openser&quot;)</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(&quot;auth_db&quot;, &quot;calculate_ha1&quot;, yes)</font><br>
<font size="2">modparam(&quot;auth_db&quot;, &quot;password_column&quot;, &quot;password&quot;)</font><br><font size="2">modparam(&quot;auth_db&quot;, &quot;db_url&quot;,</font><br><font size="2">&quot;mysql://openser:openserrw@localhost/openser&quot;)</font><br>
<font size="2">modparam(&quot;auth_db&quot;, &quot;load_credentials&quot;, &quot;&quot;)</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(&quot;alias_db&quot;, &quot;db_url&quot;,</font><br><font size="2"># &quot;mysql://openser:openserrw@localhost/openser&quot;)</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(&quot;domain&quot;, &quot;db_url&quot;,</font><br>
<font size="2"># &quot;mysql://openser:openserrw@localhost/openser&quot;)</font><br><font size="2">#modparam(&quot;domain&quot;, &quot;db_mode&quot;, 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(&quot;alias_db|auth_db|usrloc|uri_db&quot;, &quot;use_domain&quot;, 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(&quot;presence|presence_xml&quot;, &quot;db_url&quot;,</font><br>
<font size="2">#p# &quot;mysql://openser:openserrw@localhost/openser&quot;)</font><br><font size="2">#p#modparam(&quot;presence_xml&quot;, &quot;force_active&quot;, 1)</font><br><font size="2">#p#modparam(&quot;presence&quot;, &quot;server_address&quot;, &quot;sip:<a href="http://192.168.1.2:5060">192.168.1.2:5060</a>&quot;)</font><br>
<font size="2"># -- nathelper</font><br><font size="2">#n#modparam(&quot;nathelper&quot;, &quot;rtpproxy_sock&quot;, &quot;udp:<a href="http://127.0.0.1:7722">127.0.0.1:7722</a>&quot;)</font><br><font size="2">#n#modparam(&quot;nathelper&quot;, &quot;natping_interval&quot;, 30)</font><br>
<font size="2">#n#modparam(&quot;nathelper&quot;, &quot;ping_nated_only&quot;, 1)</font><br><font size="2">#n#modparam(&quot;nathelper&quot;, &quot;sipping_bflag&quot;, 7)</font><br><font size="2">#n#modparam(&quot;nathelper&quot;, &quot;sipping_from&quot;, &quot;<a href="mailto:sip%3Apinger@kamailio.org">sip:pinger@kamailio.org</a>&quot;)</font><br>
<font size="2">#n#modparam(&quot;registrar|nathelper&quot;, &quot;received_avp&quot;, &quot;$avp(i:80)&quot;)</font><br><font size="2">#n#modparam(&quot;usrloc&quot;, &quot;nat_bflag&quot;, 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(&quot;10&quot;)) {</font><br><font size="2">sl_send_reply(&quot;483&quot;,&quot;Too Many Hops&quot;);</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(&quot;BYE&quot;)) {</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(&quot;SUBSCRIBE&quot;) &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(&quot;ACK&quot;) ) {</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&quot;);</font><br><font size="2">exit;</font><br><font size="2">}</font><br><font size="2">}</font><br><font size="2">sl_send_reply(&quot;404&quot;,&quot;Not here&quot;);</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(&quot;CANCEL&quot;))</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(&quot;REGISTER|MESSAGE&quot;))</font><br><font size="2">record_route();</font><br><font size="2"># account only INVITEs</font><br>
<font size="2">if (is_method(&quot;INVITE&quot;)) {</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(&quot;P-hint: outbound\r\n&quot;); </font><br><font size="2"># if you have some interdomain connections via TLS</font><br>
<font size="2">##if($rd==&quot;<a href="http://tls_domain1.net">tls_domain1.net</a>&quot;) {</font><br><font size="2">## t_relay(&quot;tls:<a href="http://domain1.net">domain1.net</a>&quot;);</font><br><font size="2">## exit;</font><br>
<font size="2">##} else if($rd==&quot;<a href="http://tls_domain2.net">tls_domain2.net</a>&quot;) {</font><br><font size="2">## t_relay(&quot;tls:<a href="http://domain2.net">domain2.net</a>&quot;);</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(&quot;PUBLISH|SUBSCRIBE&quot;))</font><br><font size="2">route(2);</font><br>
<font size="2">if (is_method(&quot;REGISTER&quot;))</font><br><font size="2">{</font><br><font size="2">if (!save(&quot;location&quot;))</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(&quot;484&quot;,&quot;Address Incomplete&quot;);</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(&quot;dbaliases&quot;);</font><br><font size="2"> </font><br><font size="2">if(uri=~&quot;sip:[0-9]{2}@.*&quot;){</font><br>
<font size="2">xlog(&quot;L_INFO&quot;,&quot;mylog: test1.\n&quot;);</font><br><font size="2">sd_lookup(&quot;speed_dial&quot;, &quot;sip:$au@$fd&quot;);</font><br><font size="2">#sd_lookup(&quot;speed_dial&quot;);</font><br>
<font size="2">xlog(&quot;L_INFO&quot;,&quot;mylog: test2.\n&quot;);</font><br><font size="2">}</font><br><font size="2"> </font><br><font size="2">if (!lookup(&quot;location&quot;)) {</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(&quot;404&quot;, &quot;Not Found&quot;);</font><br><font size="2">exit;</font><br><font size="2">case -2:</font><br>
<font size="2">sl_send_reply(&quot;405&quot;, &quot;Method Not Allowed&quot;);</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(&quot;nat=yes&quot;)) {</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(&quot;INVITE&quot;)) {</font><br><font size="2">#t_on_branch(&quot;1&quot;);</font><br><font size="2">t_on_reply(&quot;1&quot;);</font><br><font size="2">t_on_failure(&quot;1&quot;);</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(&quot;PUBLISH&quot;))</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(&quot;SUBSCRIBE&quot;))</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(&quot;PUBLISH&quot;) || $rU==null)</font><br><font size="2">{</font><br><font size="2">sl_send_reply(&quot;404&quot;, &quot;Not here&quot;);</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(&quot;REGISTER&quot;))</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(&quot;&quot;, &quot;subscriber&quot;))</font><br>
<font size="2">{</font><br><font size="2">www_challenge(&quot;&quot;, &quot;0&quot;);</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(&quot;403&quot;,&quot;Forbidden auth ID&quot;);</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(&quot;&quot;, &quot;subscriber&quot;)) {</font><br><font size="2">proxy_challenge(&quot;&quot;, &quot;0&quot;);</font><br>
<font size="2">exit;</font><br><font size="2">}</font><br><font size="2">if (is_method(&quot;PUBLISH&quot;))</font><br><font size="2">{</font><br><font size="2">if ($au!=$tU) {</font><br><font size="2">sl_send_reply(&quot;403&quot;,&quot;Forbidden auth ID&quot;);</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(&quot;403&quot;,&quot;Forbidden auth ID&quot;);</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(&quot;19&quot;)) {</font><br><font size="2">#n# if (method==&quot;REGISTER&quot;) {</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(&quot;BYE&quot;)) {</font><br><font size="2">#n# unforce_rtp_proxy();</font><br><font size="2">#n# } else if (is_method(&quot;INVITE&quot;)){</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(&quot;;nat=yes&quot;);</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(&quot;new branch at $ru\n&quot;);</font><br><font size="2">}</font><br><font size="2"> </font><br><font size="2">onreply_route[1] {</font><br><font size="2">xdbg(&quot;incoming reply\n&quot;);</font><br>
<font size="2">#n# if ((isflagset(5) || isbflagset(6)) &amp;&amp; status=~&quot;(183)|(2[0-9][0-9])&quot;) {</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(&quot;INVITE&quot;)</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(&quot;3[0-9][0-9]&quot;)) {</font><br>
<font size="2">##t_reply(&quot;404&quot;,&quot;Not found&quot;);</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(&quot;486|408&quot;)) {</font><br><font size="2">## sethostport(&quot;<a href="http://192.168.2.100:5060">192.168.2.100:5060</a>&quot;);</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&#39;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(&quot;speed_dial&quot;). 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>