...oops, too fast clickin... 2009/3/9 Fabio Margarido <fabiomargar...@gmail.com>: > I'd like to know it there is a way for me to pass a variable number of > tagged parameters for Sofia functions. For example, I have an array with an > unknown number of strings that represent headers, and I'd like to call > nua_invite() with a SIP_HEADER_STR() tag for each member of the array. > As I don't think there are tags for loops, is there a way to do this?
You can pass an array of tagi_t structs, like invite_with_headers(nua_handle_t *nh, char **headers, size_t n_headers) { tagi_t *tags = su_zalloc(NULL, sizeof(*tags) * (n_headers + 1); for (i = 0; i < n_headers; i++) { tags[i].t_tag = siptag_header_str; tags[i].t_value = (tag_value_t)headers[i]; } nua_invite(nh, ...other tags..., TAG_NEXT(tags)); su_free(NULL, tags); } --Pekka -- Pekka.Pessi mail at nokia.com ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Sofia-sip-devel mailing list Sofia-sip-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sofia-sip-devel