{"action":"created","issue":{"url":"https://api.github.com/repos/meetecho/janus-gateway/issues/450","labels_url":"https://api.github.com/repos/meetecho/janus-gateway/issues/450/labels{/name}","comments_url":"https://api.github.com/repos/meetecho/janus-gateway/issues/450/comments","events_url":"https://api.github.com/repos/meetecho/janus-gateway/issues/450/events","html_url":"https://github.com/meetecho/janus-gateway/issues/450","id":129599628,"number":450,"title":"Missing the authorization header in SIP message","user":{"login":"hoangtuansu","id":75421,"avatar_url":"https://avatars.githubusercontent.com/u/75421?v=3","gravatar_id":"","url":"https://api.github.com/users/hoangtuansu","html_url":"https://github.com/hoangtuansu","followers_url":"https://api.github.com/users/hoangtuansu/followers","following_url":"https://api.github.com/users/hoangtuansu/following{/other_user}","gists_url":"https://api.github.com/users/hoangtuansu/gists{/gist_id}","starred_url":"https://api.github.com/users/hoangtuansu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hoangtuansu/subscriptions","organizations_url":"https://api.github.com/users/hoangtuansu/orgs","repos_url":"https://api.github.com/users/hoangtuansu/repos","events_url":"https://api.github.com/users/hoangtuansu/events{/privacy}","received_events_url":"https://api.github.com/users/hoangtuansu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-01-28T22:19:10Z","updated_at":"2016-02-02T09:03:54Z","closed_at":null,"body":"Hello,\r\n\r\nWhen I test the gateway with OpenCoreIMS, it fails at REGISTER step to P-CSCF because of the missing of authorization field in SIP message. I tried to add some codes in janus_sip.c (just for the sake of getting through REGISTER step) as following but it still not work. \r\n`...\r\n_static char *authorization_h;_\r\n\r\n...\r\n\r\ngpointer janus_sip_sofia_thread(gpointer user_data) {\r\n\r\n...\r\n\r\n_authorization_h = g_strdup(\"Digest USERNAME=\\\"alice@open-ims.test\\\", REALM=\\\"open-ims.test\\\", NONCE=\\\"\\\", RESPONSE=\\\"\\\", URI=\\\"sip:open-ims.test\\\"\");_\r\n\r\nsession->stack->s_nua = nua_create(session->stack->s_root,\r\n                                janus_sip_sofia_callback,\r\n                                session,\r\n                                SIPTAG_ALLOW_STR(\"INVITE, ACK, BYE, CANCEL, OPTIONS\"),\r\n                                NUTAG_M_USERNAME(session->account.username),\r\n                                NUTAG_URL(sip_url),\r\n                                _SIPTAG_AUTHORIZATION_STR(authorization_h),_\r\n                                TAG_IF(session->account.sips, NUTAG_SIPS_URL(sips_url)),\r\n                                SIPTAG_USER_AGENT_STR(user_agent),\r\n                                NUTAG_KEEPALIVE(keepalive_interval * 1000),     /* Sofia expects it in milliseconds */\r\n                                NUTAG_OUTBOUND(outbound_options),\r\n                                SIPTAG_SUPPORTED(NULL),\r\n                                TAG_NULL());\r\n...\r\n\r\n`\r\nI don't know if this is an issue of gateway or I should check further with sofia-sip (and rebuild the sofia lib ). So please correct me if I'm wrong.\r\n\r\nRegards,"},"comment":{"url":"https://api.github.com/repos/meetecho/janus-gateway/issues/comments/178456513","html_url":"https://github.com/meetecho/janus-gateway/issues/450#issuecomment-178456513","issue_url":"https://api.github.com/repos/meetecho/janus-gateway/issues/450","id":178456513,"user":{"login":"lminiero","id":3684796,"avatar_url":"https://avatars.githubusercontent.com/u/3684796?v=3","gravatar_id":"","url":"https://api.github.com/users/lminiero","html_url":"https://github.com/lminiero","followers_url":"https://api.github.com/users/lminiero/followers","following_url":"https://api.github.com/users/lminiero/following{/other_user}","gists_url":"https://api.github.com/users/lminiero/gists{/gist_id}","starred_url":"https://api.github.com/users/lminiero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lminiero/subscriptions","organizations_url":"https://api.github.com/users/lminiero/orgs","repos_url":"https://api.github.com/users/lminiero/repos","events_url":"https://api.github.com/users/lminiero/events{/privacy}","received_events_url":"https://api.github.com/users/lminiero/received_events","type":"User","site_admin":false},"created_at":"2016-02-02T09:03:54Z","updated_at":"2016-02-02T09:03:54Z","body":"The Digest usually works on the username. If the whole URI is the username in your context, then yes, you should use authuser for that, as otherwise we just strip the username part from the provided SIP URI and use that.\r\n\r\nI'll make some tests to make sure your proposed fix (authorization header right away) doesn't break anything in other contexts."}}