From cerien.jean@gmail.com Tue Sep 26 15:08:34 2017 From: Jean =?utf-8?q?C=C3=A9rien?= To: sr-users@lists.kamailio.org Subject: [SR-Users] UACREG - answering to 401 on invite Date: Tue, 26 Sep 2017 09:08:26 -0400 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0801433047==" --===============0801433047== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hello I'm using Kamailio 5.0.1 With the UACREG module, I am registering to a remote provider. Register goes out, 401 back, Register goes out with nonce & co, OK Later, when I send an invite, the provider issues an 401 Unauthorized. I guess it expects me to resubmit an INVITE with the authentication data, but I dont see how to do that. Any help would be appreciated ! J. --===============0801433047== Content-Type: text/html Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="attachment.html" MIME-Version: 1.0 PGRpdiBkaXI9Imx0ciI+PGJyPjxkaXY+SGVsbG88L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2Pkkm IzM5O20gdXNpbmcgS2FtYWlsaW8gNS4wLjE8L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2PldpdGgg dGhlIFVBQ1JFRyBtb2R1bGUsIEkgYW0gcmVnaXN0ZXJpbmcgdG8gYSByZW1vdGUgcHJvdmlkZXIu IFJlZ2lzdGVyIGdvZXMgb3V0LCA0MDEgYmFjaywgUmVnaXN0ZXIgZ29lcyBvdXQgd2l0aCBub25j ZSAmYW1wOyBjbywgT0s8L2Rpdj48ZGl2Pjxicj48L2Rpdj48ZGl2PkxhdGVyLCB3aGVuIEkgc2Vu ZCBhbiBpbnZpdGUsIHRoZSBwcm92aWRlciBpc3N1ZXMgYW4gNDAxIFVuYXV0aG9yaXplZC4gSSBn dWVzcyBpdCBleHBlY3RzIG1lIHRvIHJlc3VibWl0IGFuIElOVklURSB3aXRoIHRoZSBhdXRoZW50 aWNhdGlvbiBkYXRhLCBidXQgSSBkb250IHNlZSBob3cgdG8gZG8gdGhhdC48L2Rpdj48ZGl2Pjxi cj48L2Rpdj48ZGl2PkFueSBoZWxwIHdvdWxkIGJlIGFwcHJlY2lhdGVkICE8L2Rpdj48ZGl2Pjxi cj48L2Rpdj48ZGl2PkouPC9kaXY+PC9kaXY+Cg== --===============0801433047==-- From d.tryba@pocos.nl Tue Sep 26 15:27:38 2017 From: Daniel Tryba To: sr-users@lists.kamailio.org Subject: Re: [SR-Users] UACREG - answering to 401 on invite Date: Tue, 26 Sep 2017 15:27:31 +0200 Message-ID: <20170926132731.GL13309@office.pocos.nl> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0375776508==" --===============0375776508== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit On Tue, Sep 26, 2017 at 09:08:26AM -0400, Jean Cérien wrote: > With the UACREG module, I am registering to a remote provider. Register > goes out, 401 back, Register goes out with nonce & co, OK > > Later, when I send an invite, the provider issues an 401 Unauthorized. I > guess it expects me to resubmit an INVITE with the authentication data, but > I dont see how to do that. Are you saying the 401 doesn't contain a challenge? Otherwise you should just use uac_auth() (just like you probably already do for the REGISTER), following URL contains an example for an INVITE: https://www.kamailio.org/docs/modules/stable/modules/uac.html#uac.f.uac_auth --===============0375776508==-- From cerien.jean@gmail.com Tue Sep 26 15:36:28 2017 From: Jean =?utf-8?q?C=C3=A9rien?= To: sr-users@lists.kamailio.org Subject: Re: [SR-Users] UACREG - answering to 401 on invite Date: Tue, 26 Sep 2017 09:36:19 -0400 Message-ID: In-Reply-To: <20170926132731.GL13309@office.pocos.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0036986299==" --===============0036986299== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Thanks Daniel for your usual help, it is really appreciated ! I've inserted the following block on the failure route: if (t_check_status("401|407")) { xlog("L_INFO","failure_route(ROUTEFAIL) @@ call to uac_auth()\n"); uac_auth(); t_relay(); exit; } Logs show: Sep 26 15:29:08 kamailio /usr/sbin/kamailio[108044]: INFO: