The second suggestion in the stackoverflow link says to use boost. As kamailio already uses boost (?), that might be more portable ?
—Reply to this email directly or view it on GitHub.