<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY style="COLOR: #000000; FONT-FAMILY: Arial" bgColor=#ffffff><LABEL
id=HbSession SessionId="1084349586"></LABEL>
<DIV><FONT size=2>Greetings everyone,</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>I'm trying to use the cpl-c module in ser
0.8.12.</FONT></DIV>
<DIV><FONT size=2>I uploaded through CPLEd a small script that would redirect to
user1 the calls destined to user3.</FONT></DIV>
<DIV><FONT size=2>Calls between users that don´t have a CPL script associated
are established. </FONT></DIV>
<DIV><FONT size=2>But if a call is destined to user3, when the cpl_run_script
function is called, I get the following errors from the logs: </FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>ERROR: t_reply: cannot send a t_reply to a message for which
no T-state has been established<BR>ERROR:cpl_invoke_script: unable to send 100
reply!<BR></FONT><FONT size=2></FONT></DIV>
<DIV><FONT size=2>My configuration file is:</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>#<BR># $Id: ser.cfg,v 1.21.4.1 2003/11/10 15:35:15 andrei Exp
$<BR>#<BR># simple quick-start config script<BR>#</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2># ----------- global configuration parameters
------------------------</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>debug=3 #
debug level (cmd line: -dddddddddd)<BR>fork=yes<BR>log_stderror=no # (cmd
line: -E)</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>/* Uncomment these lines to enter debugging mode
<BR>debug=7<BR>fork=no<BR>log_stderror=yes<BR>*/</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>check_via=no # (cmd. line:
-v)<BR>dns=no #
(cmd. line: -r)<BR>rev_dns=no # (cmd. line:
-R)<BR>port=5060<BR>children=4<BR>fifo="/tmp/ser_fifo"<BR>fifo_mode=0666 #permite
acesso ao fifo</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV><FONT size=2>
<DIV><BR># ------------------ module loading
----------------------------------</DIV>
<DIV> </DIV>
<DIV># Uncomment this if you want to use SQL database<BR>loadmodule
"/usr/local/lib/ser/modules/mysql.so"</DIV>
<DIV> </DIV>
<DIV>loadmodule "/usr/local/lib/ser/modules/cpl-c.so"<BR>loadmodule
"/usr/local/lib/ser/modules/sl.so"<BR>loadmodule
"/usr/local/lib/ser/modules/tm.so"<BR>loadmodule
"/usr/local/lib/ser/modules/rr.so"<BR>loadmodule
"/usr/local/lib/ser/modules/maxfwd.so"<BR>loadmodule
"/usr/local/lib/ser/modules/usrloc.so"<BR>loadmodule
"/usr/local/lib/ser/modules/registrar.so"</DIV>
<DIV> </DIV>
<DIV># Uncomment this if you want digest authentication<BR># mysql.so must be
loaded !<BR>loadmodule "/usr/local/lib/ser/modules/auth.so"<BR>loadmodule
"/usr/local/lib/ser/modules/auth_db.so"</DIV>
<DIV> </DIV>
<DIV># ----------------- setting module-specific parameters
---------------</DIV>
<DIV> </DIV>
<DIV># -- usrloc params --</DIV>
<DIV> </DIV>
<DIV>#modparam("usrloc", "db_mode", 0)</DIV>
<DIV> </DIV>
<DIV># Uncomment this if you want to use SQL database <BR># for persistent
storage and comment the previous line<BR>modparam("usrloc", "db_mode", 2)</DIV>
<DIV> </DIV>
<DIV># -- auth params --<BR># Uncomment if you are using auth
module<BR>#<BR>modparam("auth_db", "calculate_ha1", yes)<BR>#<BR># If you set
"calculate_ha1" parameter to yes (which true in this config), <BR># uncomment
also the following parameter)<BR>#<BR>modparam("auth_db", "password_column",
"password")</DIV>
<DIV> </DIV>
<DIV># -- rr params --<BR># add value to ;lr param to make some broken UAs
happy<BR>modparam("rr", "enable_full_lr", 1)</DIV>
<DIV> </DIV>
<DIV># -- cpl-c module
--<BR>modparam("cpl-c","cpl_db","mysql://ser:heslo@localhost/ser")<BR>modparam("cpl-c","cpl_table","cpl")<BR>modparam("cpl-c","cpl_dtd_file","/usr/local/etc/ser/cpl-06.dtd")<BR>modparam("cpl-c","log_dir","/var/log/ser/cpl")<BR>modparam("cpl-c","proxy_recurse",0)</DIV>
<DIV> </DIV>
<DIV># ------------------------- request routing logic
-------------------</DIV>
<DIV> </DIV>
<DIV># main routing logic</DIV>
<DIV> </DIV>
<DIV>route{<BR> # initial sanity checks -- messages with<BR> #
max_forwards==0, or excessively long requests<BR> if
(!mf_process_maxfwd_header("10")) {<BR> sl_send_reply("483","Too Many
Hops");<BR> break;<BR> };<BR> if ( msg:len > max_len )
{<BR> sl_send_reply("513", "Message too
big");<BR> break;<BR> };</DIV>
<DIV> </DIV>
<DIV> # we record-route all messages -- to make sure that<BR> #
subsequent messages will go through our proxy; that's<BR> # particularly
good if upstream and downstream entities<BR> # use different transport
protocol<BR> record_route(); <BR> # loose-route
processing<BR> if (loose_route())
{<BR> t_relay();<BR> break;<BR> };<BR> lookup("aliases");<BR> setflag(1);</DIV>
<DIV> </DIV>
<DIV> # if the request is for other domain use UsrLoc<BR> # (in case,
it does not work, use the following command<BR> # with proper names and
addresses in it)<BR> if (uri=~"klingon.av.it.pt") {</DIV>
<DIV> </DIV>
<DIV> if (method=="REGISTER") {</DIV>
<DIV> </DIV>
<DIV> # Uncomment this if you want to use digest
authentication<BR> if(!cpl_process_register())<BR> {<BR> break;<BR> };<BR> if
(!www_authorize("klingon.av.it.pt", "subscriber"))
{<BR> www_challenge("klingon.av.it.pt",
"0");<BR> break;<BR> };<BR> <BR> save("location");<BR> break;<BR> <BR> };</DIV>
<DIV> </DIV>
<DIV> if(method=="INVITE") {<BR> log(1,"Invite
\n");<BR> cpl_run_script("incoming");<BR> cpl_run_script("outgoing");<BR> };</DIV>
<DIV> </DIV>
<DIV> # native SIP destinations are handled using our USRLOC
DB<BR> if (!lookup("location"))
{<BR> sl_send_reply("404", "Not
Found");<BR> break;<BR> };<BR> };<BR> #
forward to current uri now; use stateful forwarding; that<BR> # works
reliably even if we forward from TCP to UDP<BR> if (!t_relay())
{<BR> sl_reply_error();<BR> };</DIV>
<DIV> </DIV>
<DIV>}<BR></FONT></DIV>
<DIV><FONT size=2>
<DIV><FONT size=2>If I use t_newtran prior to cpl_run_script, I get errors for
every calls:</FONT></DIV>
<DIV><FONT size=2> ERROR: t_newtran: transaction already
in process 0x422baf48<BR> ERROR: sl_reply_error used:
I'm terribly sorry, server error occured (1/SL)<BR>
WARNING: script writer didn't release transaction<BR></DIV></FONT></FONT></DIV>
<DIV><FONT size=2>Can anyone help me on this?</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>José Nunes</FONT></DIV>
<P></P></BODY></HTML>