<DIV>
<DIV>hello friends,</DIV>
<DIV>&nbsp;</DIV>
<DIV>atlast i got success with the cpl scripts</DIV>
<DIV>&nbsp;</DIV>
<DIV>but one small problem is coming i.e </DIV>
<DIV>&nbsp;</DIV>
<DIV>we have three numbers 214103,215104,216105</DIV>
<DIV>&nbsp;</DIV>
<DIV>i have written script for the 214103 like this where if any body call s to 214103 it should</DIV>
<DIV>redirect the call to the 215104 </DIV>
<DIV>so when 216105 calls to 214103 the call has to goto the 215104 with out disturbing the 214103 but here </DIV>
<DIV>the call is going to the twol numbers 214103,215104 who ever picks up first the second call is being hanged up.</DIV>
<DIV>&nbsp;</DIV>
<DIV>cpl script&nbsp; is </DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>---+<BR>| user&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |
 cpl_xml&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n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p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 |<BR>+--------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------------------------------------+<BR>| <A href="mailto:214103@xxx.xxx.xxx.in">214103@xxx.xxx.xxx.in</A> | &lt;?xml version="1.0" encoding="UTF-8"?&gt;</DIV>
<DIV>&lt;!DOCTYPE cpl PUBLIC '-//IETF//DTD RFCxxxx CPL 1.0//EN' 'cpl.dtd'&gt;</DIV>
<DIV>&lt;cpl&gt;<BR>&nbsp; &lt;incoming&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;location url="sip:215104@xxx.xxx.xxx.in"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;redirect /&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;/location&gt;<BR>&nbsp; &lt;/incoming&gt;<BR>&lt;/cpl&gt;<BR></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>my ser.cfg is </DIV>
<DIV>**********************************************************************************************************</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>
<P>&nbsp;</P>
<P>debug=8 # debug level (cmd line:-dddddddddd)</P>
<P>fork=yes</P>
<P>log_stderror=yes # (cmd line: -E)</P>
<P>/* Uncomment these lines to enter debugging mode</P>
<P>fork=no</P>
<P>log_stderror=yes</P>
<P>*/</P>
<P>check_via=no # (cmd. line: -v)</P>
<P>dns=no # (cmd. line: -r)</P>
<P>rev_dns=no # (cmd. line: -R)</P>
<P>port=5060</P>
<P>children=4</P>
<P>fifo="/tmp/ser_fifo"</P>
<P>fifo_mode=438</P>
<P># ------------------ module loading----------------------------------</P>
<P># Uncomment this if you want to use SQL database</P>
<P>loadmodule "/usr/local/lib/ser/modules/mysql.so"</P>
<P>loadmodule "/usr/local/lib/ser/modules/exec.so"</P>
<P>loadmodule "/usr/local/lib/ser/modules/sl.so"</P>
<P>loadmodule "/usr/local/lib/ser/modules/tm.so"</P>
<P>loadmodule "/usr/local/lib/ser/modules/rr.so"</P>
<P>loadmodule "/usr/local/lib/ser/modules/maxfwd.so"</P>
<P>loadmodule "/usr/local/lib/ser/modules/usrloc.so"</P>
<P>loadmodule "/usr/local/lib/ser/modules/registrar.so"</P>
<P>loadmodule "/usr/local/lib/ser/modules/textops.so"</P>
<P>loadmodule "/usr/local/lib/ser/modules/domain.so"</P>
<P>loadmodule "/usr/local/lib/ser/modules/cpl-c.so"</P>
<P>loadmodule "/usr/local/lib/ser/modules/xlog.so"</P>
<P>&nbsp;</P>
<P># Uncomment this if you want digest authentication</P>
<P># mysql.so must be loaded !</P>
<P>loadmodule "/usr/local/lib/ser/modules/auth.so"</P>
<P>loadmodule "/usr/local/lib/ser/modules/auth_db.so"</P>
<P>loadmodule "/usr/local/lib/ser/modules/acc.so"</P>
<P># !! Nathelper</P>
<P>loadmodule "/usr/local/lib/ser/modules/nathelper.so"</P>
<P># ----------------- setting module-specific parameters</P>
<P>&nbsp;</P>
<P># -- usrloc params --</P>
<P>#modparam("usrloc", "db_mode", 0)</P>
<P># Uncomment this if you want to use SQL database</P>
<P># for persistent storage and comment the previous line</P>
<P>modparam("usrloc", "db_mode", 2)</P>
<P># -- auth params --</P>
<P># Uncomment if you are using auth module</P>
<P>#</P>
<P>modparam("auth_db", "calculate_ha1", yes)</P>
<P>#</P>
<P># If you set "calculate_ha1" parameter to yes (whichtrue in this config),</P>
<P># uncomment also the following parameter)</P>
<P>#</P>
<P>modparam("auth_db", "password_column", "password")</P>
<P>modparam("usrloc","db_url","mysql://ser:heslo@localhost:3306/ser")</P>
<P>modparam("acc", "log_level", 1)</P>
<P>modparam("acc", "log_flag", 1)</P>
<P>modparam("acc", "db_flag", 1)</P>
<P>modparam("acc", "db_missed_flag", 2)</P>
<P>modparam("acc", "log_fmt", "miocfst")</P>
<P>modparam("acc", "failed_transactions" ,1)</P>
<P>#modparam("acc", "radius_flag", 1)</P>
<P># -- rr params --</P>
<P># add value to ;lr param to make some broken UAs happy</P>
<P>modparam("rr", "enable_full_lr", 1)</P>
<P># !! Nathelper</P>
<P>modparam("registrar", "nat_flag", 6)</P>
<P>modparam("nathelper", "natping_interval", 30) # Pinginterval 30 s</P>
<P>modparam("nathelper", "ping_nated_only", 1) # Pingonly clients behind NAT</P>
<P>&nbsp;</P>
<P># -- cpl-c module --</P>
<P>modparam("cpl-c","cpl_db","mysql://ser:heslo@localhost/ser")</P>
<P>modparam("cpl-c","cpl_table","cpl")</P>
<P>modparam("cpl-c","cpl_dtd_file","/usr/local/etc/ser/cpl-06.dtd")</P>
<P>modparam("cpl-c","log_dir","/var/log/")</P>
<P>modparam("cpl-c","proxy_recurse",0)</P>
<P># ------------------------- request routing logic-------------------</P>
<P># main routing logic</P>
<P>route{</P>
<P># initial sanity checks -- messages with</P>
<P># max_forwards==0, or excessively long requests</P>
<P>if (!mf_process_maxfwd_header("10")) {</P>
<P>sl_send_reply("483","Too Many Hops");</P>
<P>break;</P>
<P>};</P>
<P>if (msg:len &gt;= max_len ) {</P>
<P>sl_send_reply("513", "Message toobig");</P>
<P>break;</P>
<P>};</P>
<P># !! Nathelper</P>
<P># Special handling for NATed clients; first,NAT test is</P>
<P># executed: it looks for via!=received andRFC1918 addresses</P>
<P># in Contact (may fail if line-folding isused); also,</P>
<P># the received test should, if completed,should check all</P>
<P># vias for rpesence of received</P>
<P>if (nat_uac_test("3")) {</P>
<P># Allow RR-ed requests, as these mayindicate that</P>
<P># a NAT-enabled proxy takes care ofit; unless it is</P>
<P># a REGISTER</P>
<P>if (method == "REGISTER" || !search("^Record-Route:")) {</P>
<P>log("LOG: Someone trying toregister from private IP, rewriting\n");</P>
<P># This will work only for useragents that support symmetric</P>
<P># communication. We tested quitemany of them and majority is</P>
<P># smart enough to be symmetric. Insome phones it takes a configuration</P>
<P># option. With Cisco 7960, it iscalled NAT_Enable=Yes, with kphone it is</P>
<P># called "symmetric media" and"symmetric signalling".</P>
<P>fix_nated_contact(); # Rewritecontact with source IP of signalling</P>
<P>if (method == "INVITE") {</P>
<P>fix_nated_sdp("1"); # Adddirection=active to SDP</P>
<P>};</P>
<P>force_rport(); # Add rportparameter to topmost Via</P>
<P>setflag(6); # Mark as NATed</P>
<P>};</P>
<P>};</P>
<P>setflag(1);</P>
<P>setflag(2);</P>
<P># we record-route all messages -- to make surethat</P>
<P># subsequent messages will go through ourproxy; that's</P>
<P># particularly good if upstream and downstreamentities</P>
<P># use different transport protocol</P>
<P>if (!method=="REGISTER") record_route();</P>
<P># subsequent messages withing a dialog shouldtake the</P>
<P># path determined by record-routing</P>
<P>if (loose_route()) {</P>
<P># mark routing logic in request</P>
<P>append_hf("P-hint: rr-enforced\r\n");</P>
<P>route(1);</P>
<P>break;</P>
<P>};</P>
<P>if (!uri==myself) {</P>
<P># mark routing logic in request</P>
<P>append_hf("P-hint: outbound\r\n");</P>
<P>route(1);</P>
<P>break;</P>
<P>};</P>
<P># if the request is for other domain useUsrLoc</P>
<P># (in case, it does not work, use thefollowing command</P>
<P># with proper names and addresses in it)</P>
<P></P>
<P># Uncomment this if you want to use digestauthentication</P>
<P>if (uri==myself)</P>
<P>{</P>
<P>if(method=="REGISTER")</P>
<P>{</P>
<P>if(!www_authorize("xxx.xxxx.xxx.in", "subscriber")) {</P>
<P>www_challenge("xxx.xxxx.xxx.in", "0");</P>
<P>break;</P>
<P>};</P>
<P>save("location");</P>
<P>break;</P>
<P>};</P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>if (method=="INVITE")</P>
<P>{</P>
<P>log(1, "INVITE\n");</P>
<P>cpl_process_register();</P>
<P>setflag(1); /* set foraccounting (the same valueas in log_flag!) */</P>
<P>};</P>
<P>if (method=="MESSAGE")</P>
<P>{</P>
<P>log(1, "MESSAGE\n");</P>
<P>setflag(1); /* set foraccounting (the same valueas in log_flag!) */</P>
<P>};</P>
<P>if ( method=="BYE" || method=="CANCEL" )</P>
<P>{</P>
<P>log (1, "BYE or CANCEL\n");</P>
<P>setflag(1);</P>
<P>};</P>
<P>lookup("aliases");</P>
<P>if (!uri==myself) {</P>
<P>append_hf("P-hint: outboundalias\r\n");</P>
<P>route(1);</P>
<P>break;</P>
<P>};</P>
<P># native SIP destinations are handledusing our USRLOC DB</P>
<P>if (!lookup("location")) {</P>
<P>sl_send_reply("404", "NotFound");</P>
<P>break;</P>
<P>};</P>
<P>};</P>
<P>append_hf("P-hint: usrloc applied\r\n");</P>
<P>route(1);</P>
<P>}</P>
<P>route[1]</P>
<P>{</P>
<P># !! Nathelper</P>
<P>if(uri=~"[@:](192\.168\.|10\.|172\.(1[6-9]|2[0-9]|3[0-1])\.)"&amp;&amp; !search("^Route:"))</P>
<P>{</P>
<P>sl_send_reply("479", "We don't forward toprivate IP addresses");</P>
<P>break;</P>
<P>};</P>
<P># if client or server know to be behind a NAT,enable relay</P>
<P>if (isflagset(6)) {</P>
<P>force_rtp_proxy();</P>
<P>};</P>
<P># NAT processing of replies; apply to alltransactions (for example,</P>
<P># re-INVITEs from public to private UA arehard to identify as</P>
<P># NATed at the moment of request processing);look at replies</P>
<P>t_on_reply("1");</P>
<P># send it out now; use stateful forwarding asit works reliably</P>
<P># even for UDP2TCP</P>
<P>if (!t_relay()) {</P>
<P>sl_reply_error();</P>
<P>};</P>
<P>}</P>
<P># !! Nathelper</P>
<P>onreply_route[1] {</P>
<P># NATed transaction ?</P>
<P>if (isflagset(6) &amp;&amp; status =~ "(183)|2[0-9][0-9]")</P>
<P>{</P>
<P>fix_nated_contact();</P>
<P>force_rtp_proxy();</P>
<P># otherwise, is it a transaction behind a NAT andwe did not</P>
<P># know at time of request processing ? (RFC1918contacts)</P>
<P>} else if (nat_uac_test("1")) {</P>
<P>fix_nated_contact();</P>
<P>};</P>
<P>}</P></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>*****************************************************************************************************</DIV>
<DIV>&nbsp;</DIV>
<DIV>with regards</DIV>
<DIV>rama kanth</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV></DIV><p>__________________________________________________<br>Do You Yahoo!?<br>Tired of spam?  Yahoo! Mail has the best spam protection around <br>http://mail.yahoo.com