[asterisk-dev] [Code Review] Add FIELDNUM() function which returns the 1-based offset of a field in a list.

gareth at acsdata.co.nz gareth at acsdata.co.nz
Fri Jul 30 01:05:54 CDT 2010


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/810/
-----------------------------------------------------------

(Updated 2010-07-30 01:05:53.748666)


Review request for Asterisk Developers and Tilghman Lesher.


Summary (updated)
-------

Add FIELDNUM() function which returns the position number of a field in a list. Examples:

Set(LIST=apples/oranges/bananas/grapes)
${FIELDNUM(LIST,/,oranges)} => Returns '2'
${FIELDNUM(LIST,/,bananas)} => Returns '3'
${FIELDNUM(LIST,/,chicken)} => Returns '0'
${FIELDNUM(LIST,#,bananas)} => Returns '0' (Note: wrong delimiter)


This addresses bug 17713.
    https://issues.asterisk.org/view.php?id=17713


Diffs
-----

  /trunk/CHANGES 280587 
  /trunk/funcs/func_strings.c 280587 

Diff: https://reviewboard.asterisk.org/r/810/diff


Testing
-------

Performed a few tests using SetVar/GetVar via AMI. Added test function for TEST_FRAMEWORK and verified that all tests passed.


Thanks,

gareth




More information about the asterisk-dev mailing list