[Serusers] Is This Syntax Legal In ser.cfg??

Marian Dumitru marian.dumitru at voice-sistem.ro
Wed Jan 26 16:57:02 CET 2005


Paul,

There is no function to have a fixed false return value. You can try 
some ticks (ugly, but may work) like calling function in such a way to 
return false for sure. Suggestion: reserve a flag which is permanently 
kept unset, and if you want to return false from a route, just call at 
the end isflagset()....as I said...is ugly...

Best regards,
Marian

Java Rockx wrote:
> Thanks for the info.
> 
> I have one more question.
> 
> If "break" always returns true, is there a way to always return false?
> 
> Regards,
> Paul
> 
> --- Marian Dumitru <marian.dumitru at voice-sistem.ro> wrote:
> 
> 
>>Hi Paul,
>>
>>yes, this syntax is valid. A route() call returns as all the other SER 
>>cfg function true or false. The return value of a route is equal to a 
>>return value of the last function call from the route.
>>NOTE: break returns all the time true :-)
>>
>>Best regards,
>>Marian
>>
>>Java Rockx wrote:
>>
>>>Hi All.
>>>
>>>Is this allowed in ser.cfg and if so, what causes route(1) to evaluate true or false?
>>>
>>>
>>>route {
>>>
>>>   if (route(1)) {
>>>
>>>     .. do something
>>>
>>>   } else {
>>>
>>>     .. do something else
>>>
>>>   };
>>>}
>>>
>>>route[1] {
>>>
>>>   if (some_condition) {
>>>
>>>      setflag(xx);
>>>
>>>   } else {
>>>
>>>      break;
>>>
>>>   };
>>>}
>>>
>>>
>>>
>>>		
>>>__________________________________ 
>>>Do you Yahoo!? 
>>>Yahoo! Mail - Helps protect you from nasty viruses. 
>>>http://promotions.yahoo.com/new_mail
>>>
>>>_______________________________________________
>>>Serusers mailing list
>>>serusers at lists.iptel.org
>>>http://lists.iptel.org/mailman/listinfo/serusers
>>>
>>
>>-- 
>>Voice System
>>http://www.voice-system.ro
>>
> 
> 
> 
> 
> 		
> __________________________________ 
> Do you Yahoo!? 
> Yahoo! Mail - Easier than ever with enhanced search. Learn more.
> http://info.mail.yahoo.com/mail_250
> 

-- 
Voice System
http://www.voice-system.ro




More information about the sr-users mailing list