[OpenSIPS-Users] return of cpl_script

Bogdan-Andrei Iancu bogdan at opensips.org
Fri Jan 25 14:00:27 CET 2013


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
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20130125/2f5d44f1/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cpl_return_code.patch
Type: text/x-patch
Size: 464 bytes
Desc: not available
URL: <http://lists.opensips.org/pipermail/users/attachments/20130125/2f5d44f1/attachment.bin>


More information about the Users mailing list