def build_callback_url(request, urlname, message):
location = reverse(urlname, kwargs={"<STR_LIT>": message.pk})<EOL>callback_domain = getattr(settings, "<STR_LIT>", None)<EOL>if callback_domain:<EOL><INDENT>url = "<STR_LIT>".format(<EOL>"<STR_LIT>" if getattr(settings, "<STR_LIT>", False) else "<STR_LIT:http>",<EOL>callback_domain,<EOL>location<EOL>)<EOL><DEDENT>elif request is not None:<EOL><INDENT>url = request.build_absolute_uri(location)<EOL><DEDENT>else:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT>return url<EOL>
Build Twilio callback url for confirming message delivery status

:type message: OutgoingSMS