[SR-Users] Count number of headers of type

Alex Balashov abalashov at evaristesys.com
Sat Jun 25 02:53:31 CEST 2016


On 06/24/2016 07:51 PM, Joel Serrano | VOZELIA wrote:

> - How many 'via' headers: $hdrcount(Via) ?
> - How many 'diversion' headers: $hdrcount(Diversion) ?

Unfortunately, it's probably going to come down to:

    $var(i) = 0;

    while(defined $(hdr(Via)[$var(i)]))
       $var(i) = $var(i) + 1;

  -- Alex


-- 
Alex Balashov | Principal | Evariste Systems LLC
1447 Peachtree Street NE, Suite 700
Atlanta, GA 30309
United States

Tel: +1-800-250-5920 (toll-free) / +1-678-954-0671 (direct)
Web: http://www.evaristesys.com/, http://www.csrpswitch.com/



More information about the sr-users mailing list