[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
Tue Jul 27 21:12:44 CDT 2010


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

Review request for Asterisk Developers and Tilghman Lesher.


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
-----

  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