Hi Mehdi,
Indeed, there is no difference in the return code - find attached a
small patch witch will make cpl to return "2" if the script is not
found. You can test is via $retcode variable like:
cpl_run_script();
switch ($retcode) {
case 1:
break;
case 2:
#no script
break;
default:
# error
exit;
}
Regards,
Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com
On 01/24/2013 07:41 PM, Mehdi BOUDOU wrote:
hello,
I'm actually using opensip 1.5 with cpl module.
I would like to redirect the SIP packets if there is no cpl script to
execute for the client in database.
Can i use a special return of cpl_run_script ? or is there another way
to do that ?
is the send function ( send(destination [, headers])) the best way to
redirect SIP packets ?
Thanks in advance,
Best Regards
_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Index: modules/cpl-c/cpl.c
===================================================================
--- modules/cpl-c/cpl.c (revision 9630)
+++ modules/cpl-c/cpl.c (working copy)
@@ -570,7 +570,7 @@
/* has the user a non-empty script? if not, return normally, allowing the
* script execution to continue */
if ( !script.s || !script.len )
- return 1;
+ return 2;
/* build a new script interpreter */
if ( (cpl_intr=new_cpl_interpreter(msg,&script))==0 )
_______________________________________________
Users mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users