INVITE is not repeated with credentials

PT
Philipp Trenz
Tue, Aug 21, 2018 5:16 PM

Hey there,

I’m walking my first steps with PJSIP and facing an strange issue.
After a successful REGISTER on a Fritz!Box Router establishing a call fails because credentials are missing in the INVITE-Request. In fact there is only one request without credentials failing in a 401 error, after that the call gets canceled.

Am I missing something? Can I enable to send credentials on every request while using Python?

Language: Python 3
Software: PJSIP 2.7.2 with SWIG
Hardware: Raspberry Pi 3 (ARM)

Many thanks for your help!

Log:

19:08:59.053   pjsua_call.c !Making call with acc #0 to sip:*************@fritz.box
19:08:59.053    pjsua_aud.c  .Set sound device: capture=-1, playback=-2
19:08:59.053    pjsua_aud.c  ..Opening sound device (speaker + mic) PCM@16000/1/20ms
19:08:59.261    ec0x16f7f00  ...AEC created, clock_rate=16000, channel=1, samples per frame=320, tail length=200 ms, latency=0 ms
19:08:59.261  pjsua_media.c  .Call 0: initializing media..
19:08:59.262  pjsua_media.c !..RTP socket reachable at 192.168.178.35:4000
19:08:59.262  pjsua_media.c  ..RTCP socket reachable at 192.168.178.35:4001
19:08:59.262  pjsua_media.c  ..Media index 0 selected for audio call 0
19:08:59.263   pjsua_core.c  ....TX 1110 bytes Request msg INVITE/cseq=1896 (tdta0x174fb14) to UDP 192.168.178.1:5060:
INVITE sip:***@fritz.box SIP/2.0
Via: SIP/2.0/UDP 192.168.178.35:5060;rport;branch=z9hG4bKPjJG5FUN-i6jY8uUWZJl-ajFF8xqefHXph
Max-Forwards: 70
From: sip:doorPi___@fritz.box;tag=8SQ965bp3vvR0akSuvn08yDFYSstmoBk
To: sip:***@fritz.box
Contact: <sip:doorPi___@192.168.178.35:5060;ob>
Call-ID: caowZaPuYyhtz31tFR17B2hfHv7xyGQa
CSeq: 1896 INVITE
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Supported: replaces, 100rel, timer, norefersub
Session-Expires: 1800
Min-SE: 90
Content-Type: application/sdp
Content-Length:   506

v=0
o=- 3743860139 3743860139 IN IP4 192.168.178.35
s=pjmedia
b=AS:84
t=0 0
a=X-nat:0
m=audio 4000 RTP/AVP 98 97 99 104 3 0 8 9 105 96
c=IN IP4 192.168.178.35
b=TIAS:64000
a=rtcp:4001 IN IP4 192.168.178.35
a=sendrecv
a=rtpmap:98 speex/16000
a=rtpmap:97 speex/8000
a=rtpmap:99 speex/32000
a=rtpmap:104 iLBC/8000
a=fmtp:104 mode=30
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:9 G722/8000
a=rtpmap:105 AMR/8000
a=rtpmap:96 telephone-event/8000
a=fmtp:96 0-16

--end msg--
19:08:59.264   pjsua_call.c  Call 0 hanging up: code=0..
19:08:59.264   inv0x1749d04  ..Delaying CANCEL since no provisional response is received yet
19:08:59.268   pjsua_core.c  .RX 425 bytes Response msg 401/INVITE/cseq=1896 (rdata0x7470129c) from UDP 192.168.178.1:5060:
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.178.35:5060;rport=5060;branch=z9hG4bKPjJG5FUN-i6jY8uUWZJl-ajFF8xqefHXph
From: <sip:doorPi___@fritz.box>;tag=8SQ965bp3vvR0akSuvn08yDFYSstmoBk
To: <sip:***@fritz.box>;tag=1DB92510A104653A
Call-ID: caowZaPuYyhtz31tFR17B2hfHv7xyGQa
CSeq: 1896 INVITE
WWW-Authenticate: Digest realm="fritz.box", nonce="E909EA0C9A903463"
User-Agent: FRITZ!OS
Content-Length: 0


--end msg--
19:08:59.269   pjsua_core.c  ..TX 355 bytes Request msg ACK/cseq=1896 (tdta0x74703234) to UDP 192.168.178.1:5060:
ACK sip:***@fritz.box SIP/2.0
Via: SIP/2.0/UDP 192.168.178.35:5060;rport;branch=z9hG4bKPjJG5FUN-i6jY8uUWZJl-ajFF8xqefHXph
Max-Forwards: 70
From: sip:doorPi___@fritz.box;tag=8SQ965bp3vvR0akSuvn08yDFYSstmoBk
To: sip:***@fritz.box;tag=1DB92510A104653A
Call-ID: caowZaPuYyhtz31tFR17B2hfHv7xyGQa
CSeq: 1896 ACK
Content-Length:  0


--end msg--
19:08:59.269  pjsua_media.c  .....Call 0: deinitializing media..
19:08:59.269  pjsua_media.c  ......Call 0: cleaning up provisional media, prov_med_cnt=1, med_cnt=0
19:09:00.269    pjsua_aud.c !Closing sound device after idle for 1 second(s)
19:09:00.269    pjsua_aud.c  .Closing default:CARD=ALSA sound playback device and default:CARD=HD3000 sound capture device
Hey there, I’m walking my first steps with PJSIP and facing an strange issue. After a successful REGISTER on a Fritz!Box Router establishing a call fails because credentials are missing in the INVITE-Request. In fact there is only one request without credentials failing in a 401 error, after that the call gets canceled. Am I missing something? Can I enable to send credentials on every request while using Python? Language: Python 3 Software: PJSIP 2.7.2 with SWIG Hardware: Raspberry Pi 3 (ARM) Many thanks for your help! Log: ``` 19:08:59.053 pjsua_call.c !Making call with acc #0 to sip:*************@fritz.box 19:08:59.053 pjsua_aud.c .Set sound device: capture=-1, playback=-2 19:08:59.053 pjsua_aud.c ..Opening sound device (speaker + mic) PCM@16000/1/20ms 19:08:59.261 ec0x16f7f00 ...AEC created, clock_rate=16000, channel=1, samples per frame=320, tail length=200 ms, latency=0 ms 19:08:59.261 pjsua_media.c .Call 0: initializing media.. 19:08:59.262 pjsua_media.c !..RTP socket reachable at 192.168.178.35:4000 19:08:59.262 pjsua_media.c ..RTCP socket reachable at 192.168.178.35:4001 19:08:59.262 pjsua_media.c ..Media index 0 selected for audio call 0 19:08:59.263 pjsua_core.c ....TX 1110 bytes Request msg INVITE/cseq=1896 (tdta0x174fb14) to UDP 192.168.178.1:5060: INVITE sip:***@fritz.box SIP/2.0 Via: SIP/2.0/UDP 192.168.178.35:5060;rport;branch=z9hG4bKPjJG5FUN-i6jY8uUWZJl-ajFF8xqefHXph Max-Forwards: 70 From: sip:doorPi___@fritz.box;tag=8SQ965bp3vvR0akSuvn08yDFYSstmoBk To: sip:***@fritz.box Contact: <sip:doorPi___@192.168.178.35:5060;ob> Call-ID: caowZaPuYyhtz31tFR17B2hfHv7xyGQa CSeq: 1896 INVITE Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS Supported: replaces, 100rel, timer, norefersub Session-Expires: 1800 Min-SE: 90 Content-Type: application/sdp Content-Length: 506 v=0 o=- 3743860139 3743860139 IN IP4 192.168.178.35 s=pjmedia b=AS:84 t=0 0 a=X-nat:0 m=audio 4000 RTP/AVP 98 97 99 104 3 0 8 9 105 96 c=IN IP4 192.168.178.35 b=TIAS:64000 a=rtcp:4001 IN IP4 192.168.178.35 a=sendrecv a=rtpmap:98 speex/16000 a=rtpmap:97 speex/8000 a=rtpmap:99 speex/32000 a=rtpmap:104 iLBC/8000 a=fmtp:104 mode=30 a=rtpmap:3 GSM/8000 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:9 G722/8000 a=rtpmap:105 AMR/8000 a=rtpmap:96 telephone-event/8000 a=fmtp:96 0-16 --end msg-- 19:08:59.264 pjsua_call.c Call 0 hanging up: code=0.. 19:08:59.264 inv0x1749d04 ..Delaying CANCEL since no provisional response is received yet 19:08:59.268 pjsua_core.c .RX 425 bytes Response msg 401/INVITE/cseq=1896 (rdata0x7470129c) from UDP 192.168.178.1:5060: SIP/2.0 401 Unauthorized Via: SIP/2.0/UDP 192.168.178.35:5060;rport=5060;branch=z9hG4bKPjJG5FUN-i6jY8uUWZJl-ajFF8xqefHXph From: <sip:doorPi___@fritz.box>;tag=8SQ965bp3vvR0akSuvn08yDFYSstmoBk To: <sip:***@fritz.box>;tag=1DB92510A104653A Call-ID: caowZaPuYyhtz31tFR17B2hfHv7xyGQa CSeq: 1896 INVITE WWW-Authenticate: Digest realm="fritz.box", nonce="E909EA0C9A903463" User-Agent: FRITZ!OS Content-Length: 0 --end msg-- 19:08:59.269 pjsua_core.c ..TX 355 bytes Request msg ACK/cseq=1896 (tdta0x74703234) to UDP 192.168.178.1:5060: ACK sip:***@fritz.box SIP/2.0 Via: SIP/2.0/UDP 192.168.178.35:5060;rport;branch=z9hG4bKPjJG5FUN-i6jY8uUWZJl-ajFF8xqefHXph Max-Forwards: 70 From: sip:doorPi___@fritz.box;tag=8SQ965bp3vvR0akSuvn08yDFYSstmoBk To: sip:***@fritz.box;tag=1DB92510A104653A Call-ID: caowZaPuYyhtz31tFR17B2hfHv7xyGQa CSeq: 1896 ACK Content-Length: 0 --end msg-- 19:08:59.269 pjsua_media.c .....Call 0: deinitializing media.. 19:08:59.269 pjsua_media.c ......Call 0: cleaning up provisional media, prov_med_cnt=1, med_cnt=0 19:09:00.269 pjsua_aud.c !Closing sound device after idle for 1 second(s) 19:09:00.269 pjsua_aud.c .Closing default:CARD=ALSA sound playback device and default:CARD=HD3000 sound capture device ```