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

gareth at acsdata.co.nz gareth at acsdata.co.nz
Wed Jul 28 23:15:39 CDT 2010


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

(Updated 2010-07-28 23:15:39.757116)


Review request for Asterisk Developers and Tilghman Lesher.


Changes
-------

Made documentation changes.


Summary
-------

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 (updated)
-----

  /trunk/CHANGES 279754 
  /trunk/funcs/func_strings.c 279754 

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