[Serusers] unconditional forwarding cpl script

Bogdan-Andrei IANCU iancu at fokus.fraunhofer.de
Wed May 19 12:25:00 CEST 2004


Hi Richard,

The problem is in your ser configuration. You create the transaction 
(t_newtran) before cpl script execution and when you do so, you tell the 
interpreter to "force_stateful" (force_stateful means there is no 
transaction yet, but if signalling is done from script, switch to 
statefull mode). So basically, you try to create twice a transaction for 
the same request.

so, either remove the t_newtran from script and let cpl interpreter to 
create the transaction, either call cpl_run_script() with "is_stateful".
Please read more carefully the README file from cpl-c modules - there 
are more info about this.

and, btw, your script doesn't do a forward, but a redirect. if you what 
forward, use proxy not instead of redirect.

Regards,
Bogdan



Richard wrote:

>Hi,
>
>I have a simple CPL script. However I can't make it
>work. Can someone help me please? 
>
>Besides, if someone can provide some sample working
>scripts, that would be really appreciated.
>
>I attached ser debug log, part of ser.cfg, and cpl
>script. It does unconditional forwarding which is the
>first example in the cpl rfc draft. It is uploaded via
>SIP successfully.
>
>Thanks,
>Richard
>
>
>================================================
>The ser debug log is,
> 0(3474) about to creat new transaction
> 0(3474) DEBUG: t_newtran: msg id=243 , global msg
>id=29 , T on entrance=0xffffffff
> 0(3474) parse_headers: flags=-1
> 0(3474) parse_headers: flags=60
> 0(3474) t_lookup_request: start searching:
>hash=12601, isACK=0
> 0(3474) DEBUG: RFC3261 transaction matching failed
> 0(3474) DEBUG: t_lookup_request: no transaction found
> 0(3474) DBG: trans=0xbd6c8088, callback type 1, id 0
>entered
> 0(3474) about to run script
> 0(3474) DEBUG:cpl-c:get_dest_user: tring to get user
>from new_uri
> 0(3474) DEBUG:cpl-c:get_dest_user: tring to get user
>from R_uri
> 0(3474) DEBUG:get_user_script: fetching script for
>user <3560071 at o-matrix.org>
> 0(3474) DEBUG:get_user_script: we got the script
>len=52
> 0(3474) DEBUG:cpl_run_script: processing CPL node
> 0(3474) DEBUG:cpl_run_script: processing location
>node
> 0(3474) DEBUG:cpl_run_script: processing redirect
>node
> 0(3474) DEBUG: t_newtran: msg id=243 , global msg
>id=243 , T on entrance=0xbd6c8088
> 0(3474) ERROR: t_newtran: transaction already in
>process 0xbd6c8088
> 0(3474) ERROR:cpl-c:run_redirect: failed to build new
>transaction!
> 0(3474) ERROR:cpl_c:cpl_run_script: runtime error
> 0(3474) DEBUG: t_check: msg id=243 global id=243 T
>start=0xbd6c8088
> 0(3474) DEBUG: t_check: T alredy found!
> 0(3474) parse_headers: flags=-1
> 0(3474) check_via_address(66.135.241.189,
>66.135.241.189, 0)
> 0(3474) WARNING:vqm_resize: resize(0) called
> 0(3474) DEBUG: cleanup_uac_timers: RETR/FR timers
>reset
> 0(3474) DEBUG: add_timer_unsafe[4]: 0xbd6c8134
> 0(3474) DEBUG: add_timer_unsafe[0]: 0xbd6c8144
> 0(3474) DEBUG: reply sent out. buf=0x80ff240: SIP/2.0
>5..., shmem=0xbd6c7d70: SIP/2.0 5
> 0(3474) DEBUG: _reply_light: finished
> 0(3474) receive_msg: cleaning up
>
>
>================================================
>ser.cfg
>if (method=="INVITE") {
>	# cpl interpreter requires a pre-created transaction
>for
>	# the processed INVITE
>log(1, "about to creat new transaction\n");
>	if ( !t_newtran() ) {
>		# it'a a retransmission
>		break;
>	};
>log(1, "about to run script\n");
>	if ( !cpl_run_script("incoming", "force_stateful") )
>{
>		# script execution failed
>		t_reply("500","CPL script execution failed");
>		break;
>	};
>	# we get here only if the CPL interpreter decided
>that server
>	# should follow it default behavior
>
>	# mark that there is already a created
>	# transaction for current INVITE
>	setflag(3);
>};
>
>===================================
>cpl script
><?xml version="1.0" encoding="UTF-8"?>
>
><!DOCTYPE cpl PUBLIC '-//IETF//DTD RFCxxxx CPL
>1.0//EN' 'cpl.dtd'>
>
><cpl>
>  <incoming>
>    <location url="sip:2303940 at o-matrix.org">
>      <redirect />
>    </location>
>  </incoming>
></cpl>
>
>
>
>	
>		
>__________________________________
>Do you Yahoo!?
>SBC Yahoo! - Internet access at a great low price.
>http://promo.yahoo.com/sbc/
>
>_______________________________________________
>Serusers mailing list
>serusers at lists.iptel.org
>http://lists.iptel.org/mailman/listinfo/serusers
>
>  
>




More information about the sr-users mailing list