我有一台运行星号11.16.0的服务器。它接收来自web sipml5客户端的调用。现在,我正在尝试让此服务器接受来自Android应用的呼叫。
编译 PJSIP lib for android ,生成PJSUA2示例项目,将其导入eclipse并运行它。从那以后我就被困住了。当我尝试连接时,我的星号CLI不会打印任何内容,并且示例说“呼叫已断开连接:未经授权”。
当添加好友并选中订阅状态框时,LOG也会说“SIP / 2.0 401 Unauthorized”。
添加好友的完整日志,并选中了订阅状态框:
06-29 16:30:59.914: I/System.out(28834): 16:30:59.914 pjsua_pres.c Adding buddy: sip:003032@0.0.0.0
06-29 16:30:59.914: I/System.out(28834): 16:30:59.914 pjsua_pres.c .Buddy 0 added.
06-29 16:30:59.914: I/System.out(28834): 16:30:59.914 pjsua_pres.c .Buddy 0: unsubscribing presence..
06-29 16:30:59.914: I/System.out(28834): 16:30:59.914 pjsua_pres.c ..Buddy 0: updating presence..
06-29 16:30:59.914: I/System.out(28834): 16:30:59.914 pjsua_pres.c ...Buddy 0: subscribing presence,using account 0..
06-29 16:30:59.915: I/System.out(28834): 16:30:59.915 pjsua_core.c ......TX 595 bytes Request msg SUBSCRIBE/cseq=19731 (tdta0xb9114598) to UDP 0.0.0.0:5060:
06-29 16:30:59.915: I/System.out(28834): SUBSCRIBE sip:003032@0.0.0.0 SIP/2.0
06-29 16:30:59.915: I/System.out(28834): Via: SIP/2.0/UDP 177.132.208.49:6000;rport;branch=z9hG4bKPjegELMumdLOSusL9mQeOZRJqdIjlee2rH
06-29 16:30:59.915: I/System.out(28834): Max-Forwards: 70
06-29 16:30:59.915: I/System.out(28834): From: sip:localhost;tag=GTyVBRnFBBf3OuDUT6dsbUR1f-cxc3wN
06-29 16:30:59.915: I/System.out(28834): To: sip:003032@0.0.0.0
06-29 16:30:59.915: I/System.out(28834): Contact: <sip:177.132.208.49:6000;ob>;+sip.ice
06-29 16:30:59.915: I/System.out(28834): Call-ID: 7ERxRcgeUPGvWZ07lsYfhS4b5ZBdJfIz
06-29 16:30:59.915: I/System.out(28834): CSeq: 19731 SUBSCRIBE
06-29 16:30:59.915: I/System.out(28834): Event: presence
06-29 16:30:59.915: I/System.out(28834): Expires: 600
06-29 16:30:59.915: I/System.out(28834): Supported: replaces, 100rel, timer, norefersub
06-29 16:30:59.915: I/System.out(28834): Accept: application/pidf+xml, application/xpidf+xml
06-29 16:30:59.915: I/System.out(28834): Allow-Events: presence, message-summary, refer
06-29 16:30:59.915: I/System.out(28834): User-Agent: Pjsua2 Android 2.4
06-29 16:30:59.915: I/System.out(28834): Content-Length: 0
06-29 16:30:59.915: I/System.out(28834):
06-29 16:30:59.915: I/System.out(28834): --end msg--
06-29 16:30:59.927: I/System.out(28834): 16:30:59.926 evsub0xb90d9aa ........Subscription state changed NULL --> SENT
06-29 16:30:59.927: I/System.out(28834): 16:30:59.927 pjsua_pres.c .........Presence subscription to sip:003032@0.0.0.0 is SENT
06-29 16:30:59.927: I/System.out(28834): 16:30:59.927 pjsua_pres.c Buddy 0: unsubscribing presence..
06-29 16:30:59.927: I/System.out(28834): 16:30:59.927 pjsua_pres.c .Buddy 0: updating presence..
06-29 16:31:00.092: I/System.out(28834): 16:31:00.091 pjsua_core.c !.RX 571 bytes Response msg 401/SUBSCRIBE/cseq=19731 (rdata0xb8dd5a1c) from UDP 0.0.0.0:5060:
06-29 16:31:00.092: I/System.out(28834): SIP/2.0 401 Unauthorized
06-29 16:31:00.092: I/System.out(28834): Via: SIP/2.0/UDP 192.168.25.7:6000;branch=z9hG4bKPjegELMumdLOSusL9mQeOZRJqdIjlee2rH;received=177.132.208.49;rport=6000
06-29 16:31:00.092: I/System.out(28834): From: sip:localhost;tag=GTyVBRnFBBf3OuDUT6dsbUR1f-cxc3wN
06-29 16:31:00.092: I/System.out(28834): To: sip:003032@0.0.0.0;tag=as4f8b5cb0
06-29 16:31:00.092: I/System.out(28834): Call-ID: 7ERxRcgeUPGvWZ07lsYfhS4b5ZBdJfIz
06-29 16:31:00.092: I/System.out(28834): CSeq: 19731 SUBSCRIBE
06-29 16:31:00.092: I/System.out(28834): Server: Asterisk PBX 11.16.0
06-29 16:31:00.092: I/System.out(28834): Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
06-29 16:31:00.092: I/System.out(28834): Supported: replaces, timer
06-29 16:31:00.092: I/System.out(28834): WWW-Authenticate: Digest algorithm=MD5, realm="0.0.0.0", nonce="2bd940cd"
06-29 16:31:00.092: I/System.out(28834): Content-Length: 0
06-29 16:31:00.092: I/System.out(28834):
06-29 16:31:00.092: I/System.out(28834): --end msg--
06-29 16:31:00.093: I/System.out(28834): 16:31:00.093 sip_auth_clien ....Unable to set auth for tdta0xb9114598: can not find credential for 0.0.0.0/Digest
06-29 16:31:00.094: I/System.out(28834): 16:31:00.093 evsub0xb90d9aa ....Subscription state changed SENT --> TERMINATED
06-29 16:31:00.095: I/System.out(28834): 16:31:00.094 pjsua_pres.c .....Presence subscription to sip:003032@0.0.0.0 is TERMINATED
06-29 16:31:00.096: I/System.out(28834): 16:31:00.095 pjsua_pres.c ......Resubscribing buddy id 0 in 298427 ms (reason: Unauthorized)
06-29 16:31:05.100: I/System.out(28834): 16:31:05.097 evsub0xb90d9aa ...Subscription destroyed
我尝试拨打电话的日志:
06-29 16:31:17.206: I/System.out(28834): 16:31:17.206 pjsua_call.c !Making call with acc #0 to sip:003032@0.0.0.0
06-29 16:31:17.206: I/System.out(28834): 16:31:17.206 pjsua_aud.c .Set sound device: capture=-1, playback=-2
06-29 16:31:17.206: I/System.out(28834): 16:31:17.206 pjsua_aud.c ..Opening sound device PCM@16000/1/20ms
06-29 16:31:17.206: I/System.out(28834): 16:31:17.206 android_jni_de ...Creating Android JNI stream
06-29 16:31:17.216: I/System.out(28834): 16:31:17.216 android_jni_de ...Using audio input source : 7
06-29 16:31:17.226: I/System.out(28834): 16:31:17.226 android_jni_de ...Audio record initialized successfully.
06-29 16:31:17.232: I/System.out(28834): 16:31:17.232 android_jni_de ...Audio track initialized successfully.
06-29 16:31:17.245: I/System.out(28834): 16:31:17.245 ec0xb914a1d0 ...AEC created, clock_rate=16000, channel=1, samples per frame=320, tail length=200 ms, latency=0 ms
06-29 16:31:17.245: I/System.out(28834): 16:31:17.245 android_jni_de ...Android JNI stream started
06-29 16:31:17.246: I/System.out(28834): 16:31:17.246 pjsua_media.c .Call 0: initializing media..
06-29 16:31:17.246: I/System.out(28834): 16:31:17.246 icetp00 ..Creating ICE stream transport with 2 component(s)
06-29 16:31:17.250: I/System.out(28834): 16:31:17.250 android_jni_de !Setting thread priority successful
06-29 16:31:17.258: I/System.out(28834): 16:31:17.257 android_jni_de !Setting thread priority successful
06-29 16:31:17.262: I/System.out(28834): 16:31:17.262 icetp00 !...Comp 1: srflx candidate starts Binding discovery
06-29 16:31:17.284: I/System.out(28834): 16:31:17.283 icetp00 ...Comp 1: host candidate 192.168.25.7:46074 added
06-29 16:31:17.284: I/System.out(28834): 16:31:17.284 icetp00 ...Comp 2: srflx candidate starts Binding discovery
06-29 16:31:17.287: I/System.out(28834): 16:31:17.287 icetp00 ...Comp 2: host candidate 192.168.25.7:35330 added
06-29 16:31:17.287: I/System.out(28834): 16:31:17.287 icetp00 ...ICE stream transport 0xb9144acc created
06-29 16:31:17.287: I/System.out(28834): 16:31:17.287 pjsua_media.c ..Media index 0 selected for audio call 0
06-29 16:31:17.472: I/System.out(28834): 16:31:17.471 stuntp0xb91543 !.STUN mapped address found/changed: 177.132.208.49:46074
06-29 16:31:17.476: I/System.out(28834): 16:31:17.474 icetp00 .Comp 1: Binding discovery complete, srflx address is 177.132.208.49:46074
06-29 16:31:17.482: I/System.out(28834): 16:31:17.481 stuntp0xb90beb .STUN mapped address found/changed: 177.132.208.49:35330
06-29 16:31:17.490: I/System.out(28834): 16:31:17.488 icetp00 .Comp 2: Binding discovery complete, srflx address is 177.132.208.49:35330
06-29 16:31:17.495: I/System.out(28834): 16:31:17.494 icetp00 ICE session created, comp_cnt=2, role is Controlling agent
06-29 16:31:17.496: I/System.out(28834): 16:31:17.495 icetp00 ICE nomination type set to aggressive
06-29 16:31:17.497: I/System.out(28834): 16:31:17.496 icetp00 Candidate 0 added: comp_id=1, type=srflx, foundation=Sc0a81907, addr=177.132.208.49:46074, base=192.168.25.7:46074, prio=0x6effffff (1862270975)
06-29 16:31:17.498: I/System.out(28834): 16:31:17.497 icetp00 Candidate 1 added: comp_id=1, type=host, foundation=Hc0a81907, addr=192.168.25.7:46074, base=192.168.25.7:46074, prio=0x64ffffff (1694498815)
06-29 16:31:17.500: I/System.out(28834): 16:31:17.499 icetp00 Candidate 2 added: comp_id=2, type=srflx, foundation=Sc0a81907, addr=177.132.208.49:35330, base=192.168.25.7:35330, prio=0x6efffffe (1862270974)
06-29 16:31:17.501: I/System.out(28834): 16:31:17.500 icetp00 Candidate 3 added: comp_id=2, type=host, foundation=Hc0a81907, addr=192.168.25.7:35330, base=192.168.25.7:35330, prio=0x64fffffe (1694498814)
06-29 16:31:17.507: I/System.out(28834): 16:31:17.506 tcpc0xb8fedf4c ...TCP client transport created
06-29 16:31:17.508: I/System.out(28834): 16:31:17.508 tcpc0xb8fedf4c ...TCP transport 192.168.25.7:50535 is connecting to 0.0.0.0:5060...
06-29 16:31:17.510: I/System.out(28834): 16:31:17.509 pjsua_core.c ...TX 1491 bytes Request msg INVITE/cseq=1599 (tdta0xb9028db0) to TCP 0.0.0.0:5060:
06-29 16:31:17.510: I/System.out(28834): INVITE sip:003032@0.0.0.0 SIP/2.0
06-29 16:31:17.510: I/System.out(28834): Via: SIP/2.0/TCP 192.168.25.7:50535;rport;branch=z9hG4bKPjy4Yv3yHJdognhMlKcSMv.YTVGPVZ75WR;alias
06-29 16:31:17.510: I/System.out(28834): Max-Forwards: 70
06-29 16:31:17.510: I/System.out(28834): From: sip:localhost;tag=Lsup6NqS0a9sXkWvAmx0JkNQAvagsfiD
06-29 16:31:17.510: I/System.out(28834): To: sip:003032@0.0.0.0
06-29 16:31:17.510: I/System.out(28834): Contact: <sip:177.132.208.49:6000;ob>;+sip.ice
06-29 16:31:17.510: I/System.out(28834): Call-ID: XgfXiO2Crn.sfuvArPspUXmCqrSRDVv5
06-29 16:31:17.510: I/System.out(28834): CSeq: 1599 INVITE
06-29 16:31:17.510: I/System.out(28834): Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
06-29 16:31:17.510: I/System.out(28834): Supported: replaces, 100rel, timer, norefersub
06-29 16:31:17.510: I/System.out(28834): Session-Expires: 1800
06-29 16:31:17.510: I/System.out(28834): Min-SE: 90
06-29 16:31:17.510: I/System.out(28834): User-Agent: Pjsua2 Android 2.4
06-29 16:31:17.510: I/System.out(28834): Content-Type: application/sdp
06-29 16:31:17.510: I/System.out(28834): Content-Length: 863
06-29 16:31:17.510: I/System.out(28834):
06-29 16:31:17.510: I/System.out(28834): v=0
06-29 16:31:17.510: I/System.out(28834): o=- 3644595077 3644595077 IN IP4 177.132.208.49
06-29 16:31:17.510: I/System.out(28834): s=pjmedia
06-29 16:31:17.510: I/System.out(28834): b=AS:84
06-29 16:31:17.510: I/System.out(28834): t=0 0
06-29 16:31:17.510: I/System.out(28834): a=X-nat:8
06-29 16:31:17.510: I/System.out(28834): m=audio 46074 RTP/AVP 98 97 99 104 3 0 8 9 96
06-29 16:31:17.510: I/System.out(28834): c=IN IP4 177.132.208.49
06-29 16:31:17.510: I/System.out(28834): b=TIAS:64000
06-29 16:31:17.510: I/System.out(28834): a=rtcp:35330 IN IP4 177.132.208.49
06-29 16:31:17.510: I/System.out(28834): a=sendrecv
06-29 16:31:17.510: I/System.out(28834): a=rtpmap:98 speex/16000
06-29 16:31:17.510: I/System.out(28834): a=rtpmap:97 speex/8000
06-29 16:31:17.510: I/System.out(28834): a=rtpmap:99 speex/32000
06-29 16:31:17.510: I/System.out(28834): a=rtpmap:104 iLBC/8000
06-29 16:31:17.510: I/System.out(28834): a=fmtp:104 mode=30
06-29 16:31:17.510: I/System.out(28834): a=rtpmap:3 GSM/8000
06-29 16:31:17.510: I/System.out(28834): a=rtpmap:0 PCMU/8000
06-29 16:31:17.510: I/System.out(28834): a=rtpmap:8 PCMA/8000
06-29 16:31:17.510: I/System.out(28834): a=rtpmap:9 G722/8000
06-29 16:31:17.510: I/System.out(28834): a=rtpmap:96 telephone-event/8000
06-29 16:31:17.511: I/System.out(28834): a=fmtp:96 0-16
06-29 16:31:17.511: I/System.out(28834): a=ice-ufrag:68e21bca
06-29 16:31:17.511: I/System.out(28834): a=ice-pwd:63dec485
06-29 16:31:17.511: I/System.out(28834): a=candidate:Sc0a81907 1 UDP 1862270975 177.132.208.49 46074 typ srflx raddr 192.168.25.7 rport 46074
06-29 16:31:17.511: I/System.out(28834): a=candidate:Hc0a81907 1 UDP 1694498815 192.168.25.7 46074 typ host
06-29 16:31:17.511: I/System.out(28834): a=candidate:Sc0a81907 2 UDP 1862270974 177.132.208.49 35330 typ srflx raddr 192.168.25.7 rport 35330
06-29 16:31:17.511: I/System.out(28834): a=candidate:Hc0a81907 2 UDP 1694498814 192.168.25.7 35330 typ host
06-29 16:31:17.511: I/System.out(28834): --end msg--
06-29 16:31:17.673: I/System.out(28834): 16:31:17.672 tcpc0xb8fedf4c TCP connect() error: Connection refused [code=120111]
06-29 16:31:17.674: I/System.out(28834): 16:31:17.673 tsx0xb90c6f1c Temporary failure in sending Request msg INVITE/cseq=1599 (tdta0xb9028db0), will try next server: Connection refused
06-29 16:31:17.675: I/System.out(28834): 16:31:17.674 pjsua_core.c TX 1486 bytes Request msg INVITE/cseq=1599 (tdta0xb9028db0) to UDP 0.0.0.0:5060:
06-29 16:31:17.675: I/System.out(28834): INVITE sip:003032@0.0.0.0 SIP/2.0
06-29 16:31:17.675: I/System.out(28834): Via: SIP/2.0/UDP 177.132.208.49:6000;rport;branch=z9hG4bKPjy4Yv3yHJdognhMlKcSMv.YTVGPVZ75WR
06-29 16:31:17.675: I/System.out(28834): Max-Forwards: 70
06-29 16:31:17.675: I/System.out(28834): From: sip:localhost;tag=Lsup6NqS0a9sXkWvAmx0JkNQAvagsfiD
06-29 16:31:17.675: I/System.out(28834): To: sip:003032@0.0.0.0
06-29 16:31:17.675: I/System.out(28834): Contact: <sip:177.132.208.49:6000;ob>;+sip.ice
06-29 16:31:17.675: I/System.out(28834): Call-ID: XgfXiO2Crn.sfuvArPspUXmCqrSRDVv5
06-29 16:31:17.675: I/System.out(28834): CSeq: 1599 INVITE
06-29 16:31:17.675: I/System.out(28834): Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
06-29 16:31:17.675: I/System.out(28834): Supported: replaces, 100rel, timer, norefersub
06-29 16:31:17.675: I/System.out(28834): Session-Expires: 1800
06-29 16:31:17.675: I/System.out(28834): Min-SE: 90
06-29 16:31:17.675: I/System.out(28834): User-Agent: Pjsua2 Android 2.4
06-29 16:31:17.675: I/System.out(28834): Content-Type: application/sdp
06-29 16:31:17.676: I/System.out(28834): Content-Length: 863
06-29 16:31:17.676: I/System.out(28834):
06-29 16:31:17.676: I/System.out(28834): v=0
06-29 16:31:17.676: I/System.out(28834): o=- 3644595077 3644595077 IN IP4 177.132.208.49
06-29 16:31:17.676: I/System.out(28834): s=pjmedia
06-29 16:31:17.676: I/System.out(28834): b=AS:84
06-29 16:31:17.676: I/System.out(28834): t=0 0
06-29 16:31:17.676: I/System.out(28834): a=X-nat:8
06-29 16:31:17.676: I/System.out(28834): m=audio 46074 RTP/AVP 98 97 99 104 3 0 8 9 96
06-29 16:31:17.676: I/System.out(28834): c=IN IP4 177.132.208.49
06-29 16:31:17.676: I/System.out(28834): b=TIAS:64000
06-29 16:31:17.676: I/System.out(28834): a=rtcp:35330 IN IP4 177.132.208.49
06-29 16:31:17.676: I/System.out(28834): a=sendrecv
06-29 16:31:17.676: I/System.out(28834): a=rtpmap:98 speex/16000
06-29 16:31:17.676: I/System.out(28834): a=rtpmap:97 speex/8000
06-29 16:31:17.676: I/System.out(28834): a=rtpmap:99 speex/32000
06-29 16:31:17.676: I/System.out(28834): a=rtpmap:104 iLBC/8000
06-29 16:31:17.676: I/System.out(28834): a=fmtp:104 mode=30
06-29 16:31:17.676: I/System.out(28834): a=rtpmap:3 GSM/8000
06-29 16:31:17.676: I/System.out(28834): a=rtpmap:0 PCMU/8000
06-29 16:31:17.676: I/System.out(28834): a=rtpmap:8 PCMA/8000
06-29 16:31:17.676: I/System.out(28834): a=rtpmap:9 G722/8000
06-29 16:31:17.676: I/System.out(28834): a=rtpmap:96 telephone-event/8000
06-29 16:31:17.676: I/System.out(28834): a=fmtp:96 0-16
06-29 16:31:17.676: I/System.out(28834): a=ice-ufrag:68e21bca
06-29 16:31:17.676: I/System.out(28834): a=ice-pwd:63dec485
06-29 16:31:17.676: I/System.out(28834): a=candidate:Sc0a81907 1 UDP 1862270975 177.132.208.49 46074 typ srflx raddr 192.168.25.7 rport 46074
06-29 16:31:17.676: I/System.out(28834): a=candidate:Hc0a81907 1 UDP 1694498815 192.168.25.7 46074 typ host
06-29 16:31:17.676: I/System.out(28834): a=candidate:Sc0a81907 2 UDP 1862270974 177.132.208.49 35330 typ srflx raddr 192.168.25.7 rport 35330
06-29 16:31:17.676: I/System.out(28834): a=candidate:Hc0a81907 2 UDP 1694498814 192.168.25.7 35330 typ host
06-29 16:31:17.676: I/System.out(28834): --end msg--
06-29 16:31:17.679: I/System.out(28834): 16:31:17.678 pjsua_acc.c Disconnected notification for transport tcpc0xb8fedf4c
06-29 16:31:17.681: I/System.out(28834): 16:31:17.681 tcpc0xb8fedf4c TCP transport destroyed with reason 120111: Connection refused
06-29 16:31:17.931: I/System.out(28834): 16:31:17.930 pjsua_core.c .RX 567 bytes Response msg 401/INVITE/cseq=1599 (rdata0xb8dd5a1c) from UDP 0.0.0.0:5060:
06-29 16:31:17.931: I/System.out(28834): SIP/2.0 401 Unauthorized
06-29 16:31:17.931: I/System.out(28834): Via: SIP/2.0/UDP 192.168.25.7:6000;branch=z9hG4bKPjy4Yv3yHJdognhMlKcSMv.YTVGPVZ75WR;received=177.132.208.49;rport=6000
06-29 16:31:17.931: I/System.out(28834): From: sip:localhost;tag=Lsup6NqS0a9sXkWvAmx0JkNQAvagsfiD
06-29 16:31:17.931: I/System.out(28834): To: sip:003032@0.0.0.0;tag=as2dc039f2
06-29 16:31:17.931: I/System.out(28834): Call-ID: XgfXiO2Crn.sfuvArPspUXmCqrSRDVv5
06-29 16:31:17.931: I/System.out(28834): CSeq: 1599 INVITE
06-29 16:31:17.931: I/System.out(28834): Server: Asterisk PBX 11.16.0
06-29 16:31:17.931: I/System.out(28834): Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
06-29 16:31:17.931: I/System.out(28834): Supported: replaces, timer
06-29 16:31:17.931: I/System.out(28834): WWW-Authenticate: Digest algorithm=MD5, realm="0.0.0.0", nonce="6ba922a0"
06-29 16:31:17.931: I/System.out(28834): Content-Length: 0
06-29 16:31:17.931: I/System.out(28834):
06-29 16:31:17.931: I/System.out(28834): --end msg--
06-29 16:31:17.932: I/System.out(28834): 16:31:17.932 pjsua_core.c ..TX 337 bytes Request msg ACK/cseq=1599 (tdta0xb8f8b3a0) to UDP 0.0.0.0:5060:
06-29 16:31:17.932: I/System.out(28834): ACK sip:003032@0.0.0.0 SIP/2.0
06-29 16:31:17.932: I/System.out(28834): Via: SIP/2.0/UDP 177.132.208.49:6000;rport;branch=z9hG4bKPjy4Yv3yHJdognhMlKcSMv.YTVGPVZ75WR
06-29 16:31:17.932: I/System.out(28834): Max-Forwards: 70
06-29 16:31:17.932: I/System.out(28834): From: sip:localhost;tag=Lsup6NqS0a9sXkWvAmx0JkNQAvagsfiD
06-29 16:31:17.932: I/System.out(28834): To: sip:003032@0.0.0.0;tag=as2dc039f2
06-29 16:31:17.932: I/System.out(28834): Call-ID: XgfXiO2Crn.sfuvArPspUXmCqrSRDVv5
06-29 16:31:17.932: I/System.out(28834): CSeq: 1599 ACK
06-29 16:31:17.932: I/System.out(28834): Content-Length: 0
06-29 16:31:17.933: I/System.out(28834):
06-29 16:31:17.933: I/System.out(28834): --end msg--
06-29 16:31:17.934: I/System.out(28834): 16:31:17.933 sip_auth_clien ....Unable to set auth for tdta0xb9028db0: can not find credential for 0.0.0.0/Digest
06-29 16:31:17.940: I/System.out(28834): 16:31:17.939 pjsua_media.c .....Call 0: deinitializing media..
06-29 16:31:17.941: I/System.out(28834): 16:31:17.940 pjsua_media.c ......Call 0: cleaning up provisional media, prov_med_cnt=1, med_cnt=0
06-29 16:31:17.942: I/System.out(28834): 16:31:17.941 icetp00 ......Stopping ICE, reason=media stop requested
06-29 16:31:17.942: I/System.out(28834): 16:31:17.942 icetp00 ......Destroying ICE session 0xb90d109c
06-29 16:31:17.943: I/System.out(28834): 16:31:17.943 icetp00 .......ICE stream transport 0xb9144acc destroyed
06-29 16:31:17.944: I/System.out(28834): 16:31:17.944 ice_session.c .......ICE session 0xb90d109c destroyed
06-29 16:31:18.945: I/System.out(28834): 16:31:18.944 pjsua_aud.c Closing sound device after idle for 1 second(s)
06-29 16:31:18.946: I/System.out(28834): 16:31:18.946 pjsua_aud.c .Closing Android JNI sound playback device and Android JNI sound capture device
06-29 16:31:18.947: I/System.out(28834): 16:31:18.946 android_jni_de .Android JNI stream stopped
06-29 16:31:18.948: I/System.out(28834): 16:31:18.947 android_jni_de .Destroying Android JNI stream...
06-29 16:31:18.994: I/System.out(28834): 16:31:18.994 android_jni_de .Audio record released
06-29 16:31:18.996: I/System.out(28834): 16:31:18.995 android_jni_de .Audio track released
06-29 16:31:18.996: I/System.out(28834): 16:31:18.996 android_jni_de .Android JNI stream destroyed
主要问题是我不知道设置设置的方式和位置,如服务器IP,ICE服务器,STUN,websocket_proxy_url。日志中甚至还有一些localhost,不知道为什么。
尝试了这个 JNI thing,但不明白如何使用它,所以现在看一下JNI。
如果有人使用JSIP for android并且有一些副词,那么任何想法或教程都不受欢迎。
使用Sipml5堆栈:
sipStack = new SIPml.Stack({
realm: sip_ip,
impi: sip_id,
impu: 'sip:'+sip_id+'@'+sip_ip+':'+sip_port,
password: sip_pw,
display_name: sip_id,
websocket_proxy_url: 'ws://'+sip_ip+':'+sip_port+'/ws',
ice_servers: "[{url:'stun:stun.l.google.com:19302'}]",
outbound_proxy_url: '',
enable_rtcweb_breaker: false,
events_listener: { events: '*', listener: sipEventsListener },
enable_early_ims: false,
enable_media_stream_cache: true,
bandwidth: (window.localStorage ? tsk_string_to_object('') : null),
video_size: (window.localStorage ? tsk_string_to_object('') : null),
sip_headers: [
{ name: 'User-Agent', value: 'IM-client/OMA1.0 sipML5-v1.0.0.0' },
{ name: 'Organization', value: 'Tralala'}
]
}
);
答案 0 :(得分:0)
您需要为pjsua2客户端提供连接到星号的凭据,可能与sipml5客户端使用的凭据相同