Re: PJSIP registration Issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have increased to log level on Xcode Console. Can you check?


07:34:44.215 os_core_unix.c !pjlib 2.2.1 for POSIX initialized

07:34:44.217 sip_endpoint.c  .Creating endpoint instance...

07:34:44.222          pjlib  .select() I/O Queue created (0x102816c28)

07:34:44.223 sip_endpoint.c  .Module "mod-msg-print" registered

07:34:44.223 sip_transport.  .Transport manager created.

07:34:44.223   pjsua_core.c  .PJSUA state changed: NULL --> CREATED

07:34:44.324   pjsua_core.c  .pjsua version 2.2.1 for iOS-12.1.4/arm-iPhone6,1/iOS-SDK-7.1 initialized

07:34:48.973         call.m  '"33333333401"<sip:33333333401@phone.domen.com:5070;transport=TCP>'

07:34:48.974         call.m  REALM '*'

07:34:48.974         call.m  SCHEME 'phone.domen.com:5070;transport=TCP'

07:34:48.974         call.m  USERNAME '33333333401'

07:34:48.974         call.m  DATA '123456'

07:34:48.974         call.m  PROXY.PTR 'sip:phone.domen.com:5070;transport=TCP'

07:34:48.974         call.m  PROXY 'phone.domen.com:5070;transport=TCP'

07:34:48.974         call.m  PROXY.SLEN '41'

07:34:48.984         call.m  ACC_CFG '1860631464'

07:34:48.984         call.m  ACC_ID '33641124'

07:34:49.570    pjsua_acc.c !....IP address change detected for account 0 (192.188.1.24:5070 --> 106.204.32.95:60261). Updating registration (using method 4)

07:34:49.570    pjsua_acc.c  ....SIP registration error: No suitable credential (PJSIP_ENOCREDENTIAL) [status=171101]


On Wed, Mar 27, 2019 at 11:28 PM Max Truxa <dev@xxxxxxxxxxxx> wrote:
PJSIP_ENOCREDENTIALS means PJSIP can't find credentials matching the realm specified by the WWW-Authenticate header (for specifics look at "pjsip/src/pjsip/sip_auth_client.c").

I would increase the log level and look for anything logged from "sip_auth_client.c". Specifically something like "can not find credential for".

Side note:
Don't use pj_ansi_snprintf to build SIP URIs. That's what pjsip_sip_uri_init, pjsip_uri_print, etc are for.

On Wed, Mar 27, 2019, 5:51 PM Vivek Shukla <vivek.shukla@xxxxxxxxxxxxx> wrote:

Hello,

Can some help me troubleshoot this small registration issue? 

Client is sending

######
REGISTER sip:phone.domain.com:5070;transport=tcp SIP/2.0.
Via: SIP/2.0/TCP 192.168.1.24:51776;rport;branch=z9hG4bKPjOHIF64viYJs7.tqvZdvrGFoW00g39bOv;alias.
Max-Forwards: 70.
From: <sip:3333331401@xxxxxxxxxxxxxxxx>;tag=FPD8atihhLeRHySmQTCaWgSCKilOayRZ.
Call-ID: ATS5FAzJ5zq2EAYb07uZMiMSN86hVQy4.
CSeq: 27035 REGISTER.
Supported: outbound, path.
Contact: <sip:3333331401@192.168.1.24:5070;transport=TCP;ob>;reg-id=1;+sip.instance="<urn:uuid:00000000-0000-0000-0000-00008340d0fa>".
Expires: 300.
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS.
Content-Length:  0.
.

Responding 401 (Normal as expected)
##
SIP/2.0 401 Unauthorized.
Via: SIP/2.0/TCP 192.168.1.24:51776;received=192.168.86.73;rport=51776;branch=z9hG4bKPjOHIF64viYJs7.tqvZdvrGFoW00g39bOv;alias.
From: <sip:3333331401@xxxxxxxxxxxxxxxx>;tag=FPD8atihhLeRHySmQTCaWgSCKilOayRZ.
To: <sip:3333331401@xxxxxxxxxxxxxxxx>;tag=b1eab96f5e317aeed15d7d983cd6a57a.5ee8.
Call-ID: ATS5FAzJ5zq2EAYb07uZMiMSN86hVQy4.
CSeq: 27035 REGISTER.
WWW-Authenticate: Digest realm="phone.domain.com", nonce="5c9b1d7d000008d1ac3940669816334b2844844f87cc0d61".
Server: OpenSIPS (2.4.4 (x86_64/linux)).
Content-Length: 0.
.

Now Client is not sending authorization string in the SIP header. 
###
REGISTER sip:phone.domain.com:5070;transport=tcp SIP/2.0.
Via: SIP/2.0/TCP 192.168.1.24:51776;rport;branch=z9hG4bKPjK14sfI9ZcYFQdkbU.3cQmDzSZuHnCFI2;alias.
Max-Forwards: 70.
From: <sip:3333331401@xxxxxxxxxxxxxxxx>;tag=8-Yjprgu-tqzLUl6K9Woot8OtbA45XG..
Call-ID: E8FaNOF-ShLPmkINx7YAbU0vL7A3X9-W.
CSeq: 1904 REGISTER.
Supported: outbound, path.
Contact: <sip:3333331401@192.168.1.24:5070;transport=TCP;ob>;reg-id=1;+sip.instance="<urn:uuid:00000000-0000-0000-0000-00008340d0fa>".
Expires: 300.
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS.
Content-Length:  0.


It should be something like this. 
###
REGISTER sip:phone.domain.com:5070;transport=tcp SIP/2.0.
Via: SIP/2.0/TCP 192.168.1.24:51776;rport;branch=z9hG4bKPjK14sfI9ZcYFQdkbU.3cQmDzSZuHnCFI2;alias.
Max-Forwards: 70.
From: <sip:3333331401@xxxxxxxxxxxxxxxx>;tag=8-Yjprgu-tqzLUl6K9Woot8OtbA45XG..
Call-ID: E8FaNOF-ShLPmkINx7YAbU0vL7A3X9-W.
CSeq: 1904 REGISTER.
Supported: outbound, path.
Contact: <sip:3333331401@192.168.1.24:5070;transport=TCP;ob>;reg-id=1;+sip.instance="<urn:uuid:00000000-0000-0000-0000-00008340d0fa>".
Expires: 300.
Authorization: Digest username="3333331401", realm="phone.domain.com", nonce="5c9b1d0d000008d0a3685893e9b9332887b96ca4ff2a0963", uri="sip:phone.domain.com:5070", response="8233c8f96b16ab62ddfef08633555687", algorithm=MD5.
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS.
Content-Length:  0.


I am calling: 
        if ((status = sip_connect(_app_config.pool, &_sip_acc_id)) != PJ_SUCCESS)
sip_connect is calling
status = pjsua_acc_add(&acc_cfg, PJ_TRUE, acc_id);
As per document that should take care proper SIP headers. 
Can some point me in the right direction? 
--
Best Regards 

Vivek Shukla 
Sr. iOS Developer 

_______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@xxxxxxxxxxxxxxx
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
_______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@xxxxxxxxxxxxxxx
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org


--
Best Regards 

Vivek Shukla 
Sr. iOS Developer 

_______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@xxxxxxxxxxxxxxx
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux