[Serusers] how-to "loop" in the ser.cfg file

Greger V. Teigre greger at teigre.com
Tue Apr 17 21:18:31 CEST 2007


Sorry, I misunderstood. Maybe you can create a new route for iteration? 
In failure route you forward to this new route, the route clears a flag, 
loads the correct extension, forwards to the route for checks, the 
checking is done and the flag is set only if everything was ok, the 
intermediate route, if no flag was set, deletes the avp holding the 
extension, then calls itself.
Better?
g-)

Steve Blair wrote:
>
> So I do that now. The problem is how do I repeat the process until all 
> extensions in the huntlist have been attempted? As I see it I need 
> something like the following but I do not see how to implement this.
>
> top: (   "loop until no more extensions" )
>      check permissions of current extension
>      permission check failed
>         delete extension
>         goto top
>      set failure route flag to this failure route
>      t_relay to current extension
>
> -Steve
>
>
> Greger V. Teigre wrote:
>> You store the extensions in an avpair and then in failure route do 
>> avp_delete()  on your "huntlist" (don't use /g, because all will be 
>> deleted).
>> g-)
>>
>> Steve Blair wrote:
>>>
>>> Hello:
>>>
>>>  I need to perform a check several times within a failure_route and 
>>> I'm not sure how to accomplish this task.
>>>
>>>  The way I implemented sequentially hunting I perform the relay to 
>>> the first number in the hunt list within route block 0. If this 
>>> number is unavailable I "fail" to a failure block then interate 
>>> through the remaining numbers in the huntlist in that failure route 
>>> but this presents a problem.
>>>
>>>  All of the "feature" and "call permission" checks which I normally 
>>> perform on an extension are only performed in route block 0. This 
>>> means I am not checking the feature and call permission flags for 
>>> the 2nd through Nth number in the huntlist once I enter the failure 
>>> route.
>>>
>>>  I created a route block to perform the necessary checks but the 
>>> problem is I do not see how to return to the failure route if the 
>>> feature check for a given number fails.
>>>
>>>  For example. If the t_relay to extension 1234 fails I will enter 
>>> failure_route #1. In failure_route #1 I load the next extension, 
>>> 2345, but if the call permission check for 2345 fails how do I skip 
>>> this number in the huntlist, load the next number in the list and 
>>> repeat the failure_route #1 processing?
>>>
>>> Thanks,Steve
>>>
>>> _______________________________________________
>>> Serusers mailing list
>>> Serusers at lists.iptel.org
>>> http://lists.iptel.org/mailman/listinfo/serusers
>>>
>>>
>>
>
>



More information about the sr-users mailing list