[pjsip] Copy from a stl string to a pj_str_t struct
andreas.backman at sesca.com
Thu Feb 7 06:06:49 EST 2008
This is probably a very simple question, but I'm still finding it hard
to figure out the best approach.
I'm making a c++ wrapper for the pjsip stack and receives the username,
password etc in a function as stl strings.
I then want to set them in the pjsua_acc_config struct.
For example: The username stl string into pjsua_acc_config.id. What is
the most efficient and best way to do this?
I tried (among other solutions) this one:
but the pointer to pjsuaAccountConfig.id.ptr is null, so it can't be
used by memcpy.
I've figured out this one, but it feels a bit clumsy
char* tmpUsername = new char[username.size()];
pjsuaAccountConfig.id = pj_str(tmpUserId);
Any other ideas?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the pjsip