通过 Asterisk 通过简单的 PJSIP 软电话进行呼叫时出现问题

Troubles with calls by simple PJSIP softphone via Asterisk

我需要基于 PJSIP 库制作一个简单的软电话,以通过 Asterisk 服务器拨打电话。我使用了一个用 C ( http://www.pjsip.org/pjsip/docs/html/page_pjsip_sample_simple_pjsuaua_c.htm ) 编写的 PJSIP 官方网站的简单示例。该软电话可以在 Asterisk 服务器上注册(为了使其正常工作,我将第 163 行子字符串 SIP_DOMAIN 替换为 "asterisk"),但无法拨打和接听电话。

使用的软件:

当我从 Zoiper 呼叫我的软电话时,我从 Asterisk 收到以下消息:

...
  == Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5
       > [INSERT INTO cel (eventtype,eventtime,cid_name,cid_num,cid_ani,cid_rdnis,cid_dnid,exten,context,channame,appname,appdata,amaflags,accountcode,uniqueid,linkedid,peer,userdeftype,userfield) VALUES ('CHAN_START',{ts '2015-05-17 22:11:01.20063'},'Danil Dushistov','100','','','','s','from-internal','SIP/100-0000000f','','',3,'','1431889861.15','1431889860.14','','','')]
    -- Called SIP/100
    -- Got SIP response 406 "Not Acceptable" back from 192.168.56.1:5060
    -- Connected line update to SIP/200-0000000e prevented.
       > [INSERT INTO cel (eventtype,eventtime,cid_name,cid_num,cid_ani,cid_rdnis,cid_dnid,exten,context,channame,appname,appdata,amaflags,accountcode,uniqueid,linkedid,peer,userdeftype,userfield) VALUES ('HANGUP',{ts '2015-05-17 22:11:01.23544'},'Danil Dushistov','100','100','','','100','from-internal','SIP/100-0000000f','AppDial','(Outgoing Line)',3,'','1431889861.15','1431889860.14','','','')]
       > [INSERT INTO cel (eventtype,eventtime,cid_name,cid_num,cid_ani,cid_rdnis,cid_dnid,exten,context,channame,appname,appdata,amaflags,accountcode,uniqueid,linkedid,peer,userdeftype,userfield) VALUES ('CHAN_END',{ts '2015-05-17 22:11:01.25763'},'Danil Dushistov','100','100','','','100','from-internal','SIP/100-0000000f','AppDial','(Outgoing Line)',3,'','1431889861.15','1431889860.14','','','')]
  == Everyone is busy/congested at this time (1:0/0/1)
...

192.168.56.1 是我软电话的 IP 地址。 Softphone returns SIP 响应 406。我读到这个错误可能是因为 Asterisk 不支持我的 softphone 中使用的编解码器,但我不知道如何解决这个问题。

当我从软电话呼叫 Zoiper 时,我从 Asterisk 服务器收到以下消息:

  == Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5
[2015-05-17 22:02:59] NOTICE[1796][C-00000008]: chan_sip.c:10460 process_sdp: No compatible codecs, not accepting this offer!

以及来自 PJSIP 的以下日志:

22:41:49.914 os_core_unix.c !pjlib 2.4 for POSIX initialized
22:41:49.916 sip_endpoint.c  .Creating endpoint instance...
22:41:49.916          pjlib  .select() I/O Queue created (0x20164e0)
22:41:49.916 sip_endpoint.c  .Module "mod-msg-print" registered
22:41:49.916 sip_transport.  .Transport manager created.
22:41:49.916   pjsua_core.c  .PJSUA state changed: NULL --> CREATED
22:41:49.916 sip_endpoint.c  .Module "mod-pjsua-log" registered
22:41:49.916 sip_endpoint.c  .Module "mod-tsx-layer" registered
22:41:49.916 sip_endpoint.c  .Module "mod-stateful-util" registered
22:41:49.916 sip_endpoint.c  .Module "mod-ua" registered
22:41:49.916 sip_endpoint.c  .Module "mod-100rel" registered
22:41:49.916 sip_endpoint.c  .Module "mod-pjsua" registered
22:41:49.916 sip_endpoint.c  .Module "mod-invite" registered
22:41:49.975       pa_dev.c  ..PortAudio sound library initialized, status=0
22:41:49.975       pa_dev.c  ..PortAudio host api count=2
22:41:49.975       pa_dev.c  ..Sound device count=9
22:41:49.975          pjlib  ..select() I/O Queue created (0x206ae38)
22:41:49.990 sip_endpoint.c  .Module "mod-evsub" registered
22:41:49.990 sip_endpoint.c  .Module "mod-presence" registered
22:41:49.990 sip_endpoint.c  .Module "mod-mwi" registered
22:41:49.990 sip_endpoint.c  .Module "mod-refer" registered
22:41:49.990 sip_endpoint.c  .Module "mod-pjsua-pres" registered
22:41:49.990 sip_endpoint.c  .Module "mod-pjsua-im" registered
22:41:49.990 sip_endpoint.c  .Module "mod-pjsua-options" registered
22:41:49.990   pjsua_core.c  .1 SIP worker threads created
22:41:49.990   pjsua_core.c  .pjsua version 2.4 for Linux-3.2.0.4/x86_64/glibc-2.19 initialized
22:41:49.990   pjsua_core.c  .PJSUA state changed: CREATED --> INIT
22:41:49.990   pjsua_core.c  SIP UDP socket reachable at 192.168.1.45:5060
22:41:49.990   udp0x2078e30  SIP UDP transport started, published address is 192.168.1.45:5060
22:41:49.991   pjsua_core.c  PJSUA state changed: INIT --> STARTING
22:41:49.991 sip_endpoint.c  .Module "mod-unsolicited-mwi" registered
22:41:49.991   pjsua_core.c  .PJSUA state changed: STARTING --> RUNNING
22:41:49.991    pjsua_acc.c  Adding account: id=sip:100@192.168.56.50
22:41:49.991    pjsua_acc.c  .Account sip:100@192.168.56.50 added with id 0
22:41:49.991    pjsua_acc.c  .Acc 0: setting registration..
22:41:49.991   pjsua_core.c  ...TX 481 bytes Request msg REGISTER/cseq=4600 (tdta0x207e270) to UDP 192.168.56.50:5060:
REGISTER sip:192.168.56.50 SIP/2.0
Via: SIP/2.0/UDP 192.168.56.1:5060;rport;branch=z9hG4bKPjjg7lshYOjbgZMpe-G9PgeT2hJqNpcRdv
Max-Forwards: 70
From: <sip:100@192.168.56.50>;tag=9j1S8GzDdF6Vivl9FKqV3up5oVAenSzj
To: <sip:100@192.168.56.50>
Call-ID: It9SK0FiOteFTrpnKmfLCl6jYX0fHaKA
CSeq: 4600 REGISTER
Contact: <sip:100@192.168.56.1:5060;ob>
Expires: 300
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Content-Length:  0


--end msg--
22:41:49.991    pjsua_acc.c  ..Acc 0: Registration sent
22:41:49.991   pjsua_call.c  Making call with acc #0 to sip:200@192.168.56.50
22:41:49.991    pjsua_aud.c  .Set sound device: capture=-1, playback=-2
22:41:49.991    pjsua_aud.c  ..Opening sound device PCM@16000/1/20ms
Expression 'SetApproximateSampleRate( pcm, hwParams, sr )' failed in 'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1294
Expression 'PaAlsaStreamComponent_InitialConfigure( &self->capture, inParams, self->primeBuffers, hwParamsCapture, &realSr )' failed in 'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1870
Expression 'PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )' failed in 'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1994
Expression 'SetApproximateSampleRate( pcm, hwParams, sr )' failed in 'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1294
Expression 'PaAlsaStreamComponent_InitialConfigure( &self->capture, inParams, self->primeBuffers, hwParamsCapture, &realSr )' failed in 'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1870
Expression 'PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )' failed in 'src/../../../portaudio/src/hostapi/alsa/pa_linux_alsa.c', line: 1994
22:41:49.992    pjsua_aud.c  ..Opening sound device PCM@44100/1/20ms
22:41:50.000   pjsua_core.c  .RX 568 bytes Response msg 401/REGISTER/cseq=4600 (rdata0x207a8b8) from UDP 192.168.56.50:5060:
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.56.1:5060;branch=z9hG4bKPjjg7lshYOjbgZMpe-G9PgeT2hJqNpcRdv;received=192.168.56.1;rport=5060
From: <sip:100@192.168.56.50>;tag=9j1S8GzDdF6Vivl9FKqV3up5oVAenSzj
To: <sip:100@192.168.56.50>;tag=as230b12f3
Call-ID: It9SK0FiOteFTrpnKmfLCl6jYX0fHaKA
CSeq: 4600 REGISTER
Server: FPBX-12.0.38(11.16.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="6d994b8a"
Content-Length: 0


--end msg--
22:41:50.016    ec0x2086730  ...AEC created, clock_rate=44100, channel=1, samples per frame=882, tail length=200 ms, latency=0 ms
22:41:50.017  pjsua_media.c  .Call 0: initializing media..
22:41:50.017  pjsua_media.c  ..RTP socket reachable at 192.168.1.45:4000
22:41:50.017  pjsua_media.c  ..RTCP socket reachable at 192.168.1.45:4001
22:41:50.017  pjsua_media.c  ..Media index 0 selected for audio call 0
22:41:50.018   pjsua_core.c  ....TX 959 bytes Request msg INVITE/cseq=22306 (tdta0x2101770) to UDP 192.168.56.50:5060:
INVITE sip:200@192.168.56.50 SIP/2.0
Via: SIP/2.0/UDP 192.168.56.1:5060;rport;branch=z9hG4bKPjv47uapAPOzpF47Md8ymSg6Mqyye5WXmi
Max-Forwards: 70
From: sip:100@192.168.56.50;tag=tBQEHZS3c8MW5RF9jtG9v-saqjeoX6KP
To: sip:200@192.168.56.50
Contact: <sip:100@192.168.56.1:5060;ob>
Call-ID: 6PpMjSTpXlf8hIQYyHGd8BnZO7ZEGU2I
CSeq: 22306 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:   378

v=0
o=- 3640880510 3640880510 IN IP4 192.168.1.45
s=pjmedia
b=AS:63
t=0 0
a=X-nat:0
m=audio 4000 RTP/AVP 98 97 99 104 96
c=IN IP4 192.168.1.45
b=TIAS:44000
a=rtcp:4001 IN IP4 192.168.1.45
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:96 telephone-event/8000
a=fmtp:96 0-16

--end msg--
22:41:50.018 /media/sda2/te  .......Call 0 state=CALLING
Press 'h' to hangup all calls, 'q' to quit
22:41:50.018   pjsua_core.c  ....TX 640 bytes Request msg REGISTER/cseq=4601 (tdta0x207e270) to UDP 192.168.56.50:5060:
REGISTER sip:192.168.56.50 SIP/2.0
Via: SIP/2.0/UDP 192.168.56.1:5060;rport;branch=z9hG4bKPjNuuL0c7gLTmHBPLM9VtNf5N7-WbWMUKP
Max-Forwards: 70
From: <sip:100@192.168.56.50>;tag=9j1S8GzDdF6Vivl9FKqV3up5oVAenSzj
To: <sip:100@192.168.56.50>
Call-ID: It9SK0FiOteFTrpnKmfLCl6jYX0fHaKA
CSeq: 4601 REGISTER
Contact: <sip:100@192.168.56.1:5060;ob>
Expires: 300
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Authorization: Digest username="100", realm="asterisk", nonce="6d994b8a", uri="sip:192.168.56.50", response="1593a80275d3cd818b5e891d730e7b64", algorithm=MD5
Content-Length:  0


--end msg--
22:41:50.020   pjsua_core.c  .RX 563 bytes Response msg 401/INVITE/cseq=22306 (rdata0x7f2538002908) from UDP 192.168.56.50:5060:
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.56.1:5060;branch=z9hG4bKPjv47uapAPOzpF47Md8ymSg6Mqyye5WXmi;received=192.168.56.1;rport=5060
From: sip:100@192.168.56.50;tag=tBQEHZS3c8MW5RF9jtG9v-saqjeoX6KP
To: sip:200@192.168.56.50;tag=as35b7c5f1
Call-ID: 6PpMjSTpXlf8hIQYyHGd8BnZO7ZEGU2I
CSeq: 22306 INVITE
Server: FPBX-12.0.38(11.16.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="5d5f6113"
Content-Length: 0


--end msg--
22:41:50.020   pjsua_core.c  ..TX 334 bytes Request msg ACK/cseq=22306 (tdta0x7f2538004830) to UDP 192.168.56.50:5060:
ACK sip:200@192.168.56.50 SIP/2.0
Via: SIP/2.0/UDP 192.168.56.1:5060;rport;branch=z9hG4bKPjv47uapAPOzpF47Md8ymSg6Mqyye5WXmi
Max-Forwards: 70
From: sip:100@192.168.56.50;tag=tBQEHZS3c8MW5RF9jtG9v-saqjeoX6KP
To: sip:200@192.168.56.50;tag=as35b7c5f1
Call-ID: 6PpMjSTpXlf8hIQYyHGd8BnZO7ZEGU2I
CSeq: 22306 ACK
Content-Length:  0


--end msg--
22:41:50.020   pjsua_core.c  .......TX 1122 bytes Request msg INVITE/cseq=22307 (tdta0x2101770) to UDP 192.168.56.50:5060:
INVITE sip:200@192.168.56.50 SIP/2.0
Via: SIP/2.0/UDP 192.168.56.1:5060;rport;branch=z9hG4bKPjmB8.3nm0.MWuGbW9R1vOxqgjXMLYvQja
Max-Forwards: 70
From: sip:100@192.168.56.50;tag=tBQEHZS3c8MW5RF9jtG9v-saqjeoX6KP
To: sip:200@192.168.56.50
Contact: <sip:100@192.168.56.1:5060;ob>
Call-ID: 6PpMjSTpXlf8hIQYyHGd8BnZO7ZEGU2I
CSeq: 22307 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
Authorization: Digest username="100", realm="asterisk", nonce="5d5f6113", uri="sip:200@192.168.56.50", response="ad3c39c86d7dd6423961cb288c6c85b3", algorithm=MD5
Content-Type: application/sdp
Content-Length:   378

v=0
o=- 3640880510 3640880510 IN IP4 192.168.1.45
s=pjmedia
b=AS:63
t=0 0
a=X-nat:0
m=audio 4000 RTP/AVP 98 97 99 104 96
c=IN IP4 192.168.1.45
b=TIAS:44000
a=rtcp:4001 IN IP4 192.168.1.45
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:96 telephone-event/8000
a=fmtp:96 0-16

--end msg--
22:41:50.023   pjsua_core.c  .RX 563 bytes Request msg OPTIONS/cseq=102 (rdata0x7f2538002908) from UDP 192.168.56.50:5060:
OPTIONS sip:100@192.168.56.1:5060;ob SIP/2.0
Via: SIP/2.0/UDP 192.168.56.50:5060;branch=z9hG4bK0f2ed1a5;rport
Max-Forwards: 70
From: "Unknown" <sip:Unknown@192.168.56.50>;tag=as483ca5c4
To: <sip:100@192.168.56.1:5060;ob>
Contact: <sip:Unknown@192.168.56.50:5060>
Call-ID: 3f638eff709b69712c4e67c04f27ca33@192.168.56.50:5060
CSeq: 102 OPTIONS
User-Agent: FPBX-12.0.38(11.16.0)
Date: Sun, 17 May 2015 19:41:49 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


--end msg--
22:41:50.023   pjsua_core.c  .TX 697 bytes Response msg 200/OPTIONS/cseq=102 (tdta0x7f2538007790) to UDP 192.168.56.50:5060:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.56.50:5060;rport=5060;received=192.168.56.50;branch=z9hG4bK0f2ed1a5
Call-ID: 3f638eff709b69712c4e67c04f27ca33@192.168.56.50:5060
From: "Unknown" <sip:Unknown@192.168.56.50>;tag=as483ca5c4
To: <sip:100@192.168.56.1;ob>;tag=z9hG4bK0f2ed1a5
CSeq: 102 OPTIONS
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
Accept: application/sdp, application/pidf+xml, application/xpidf+xml, application/simple-message-summary, message/sipfrag;version=2.0, application/im-iscomposing+xml, text/plain
Supported: replaces, 100rel, timer, norefersub
Allow-Events: presence, message-summary, refer
Content-Length:  0


--end msg--
22:41:50.024   pjsua_core.c  .RX 586 bytes Response msg 200/REGISTER/cseq=4601 (rdata0x7f2538002908) from UDP 192.168.56.50:5060:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.56.1:5060;branch=z9hG4bKPjNuuL0c7gLTmHBPLM9VtNf5N7-WbWMUKP;received=192.168.56.1;rport=5060
From: <sip:100@192.168.56.50>;tag=9j1S8GzDdF6Vivl9FKqV3up5oVAenSzj
To: <sip:100@192.168.56.50>;tag=as230b12f3
Call-ID: It9SK0FiOteFTrpnKmfLCl6jYX0fHaKA
CSeq: 4601 REGISTER
Server: FPBX-12.0.38(11.16.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Expires: 300
Contact: <sip:100@192.168.56.1:5060;ob>;expires=300
Date: Sun, 17 May 2015 19:41:49 GMT
Content-Length: 0


--end msg--
22:41:50.024    pjsua_acc.c  ....SIP outbound status for acc 0 is not active
22:41:50.024    pjsua_acc.c  ....sip:100@192.168.56.50: registration success, status=200 (OK), will re-register in 300 seconds
22:41:50.024    pjsua_acc.c  ....Keep-alive timer started for acc 0, destination:192.168.56.50:5060, interval:15s
22:41:50.025   pjsua_core.c  .RX 567 bytes Request msg NOTIFY/cseq=102 (rdata0x7f2538002908) from UDP 192.168.56.50:5060:
NOTIFY sip:100@192.168.56.1:5060;ob SIP/2.0
Via: SIP/2.0/UDP 192.168.56.50:5060;branch=z9hG4bK7fbbd337;rport
Max-Forwards: 70
From: "Unknown" <sip:Unknown@192.168.56.50>;tag=as64a7a4d0
To: <sip:100@192.168.56.1:5060;ob>
Contact: <sip:Unknown@192.168.56.50:5060>
Call-ID: 3caf066966bb0ad629383a7123f7431a@192.168.56.50:5060
CSeq: 102 NOTIFY
User-Agent: FPBX-12.0.38(11.16.0)
Event: message-summary
Content-Type: application/simple-message-summary
Content-Length: 88

Messages-Waiting: no
Message-Account: sip:*97@192.168.56.50
Voice-Message: 0/0 (0/0)

--end msg--
22:41:50.025   pjsua_pres.c  .Got unsolicited NOTIFY from 192.168.56.50:5060..
22:41:50.025   pjsua_core.c  ...TX 323 bytes Response msg 200/NOTIFY/cseq=102 (tdta0x7f2538007790) to UDP 192.168.56.50:5060:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.56.50:5060;rport=5060;received=192.168.56.50;branch=z9hG4bK7fbbd337
Call-ID: 3caf066966bb0ad629383a7123f7431a@192.168.56.50:5060
From: "Unknown" <sip:Unknown@192.168.56.50>;tag=as64a7a4d0
To: <sip:100@192.168.56.1;ob>;tag=z9hG4bK7fbbd337
CSeq: 102 NOTIFY
Content-Length:  0


--end msg--
22:41:50.031   pjsua_core.c  .RX 494 bytes Response msg 488/INVITE/cseq=22307 (rdata0x7f2538002908) from UDP 192.168.56.50:5060:
SIP/2.0 488 Not acceptable here
Via: SIP/2.0/UDP 192.168.56.1:5060;branch=z9hG4bKPjmB8.3nm0.MWuGbW9R1vOxqgjXMLYvQja;received=192.168.56.1;rport=5060
From: sip:100@192.168.56.50;tag=tBQEHZS3c8MW5RF9jtG9v-saqjeoX6KP
To: sip:200@192.168.56.50;tag=as35b7c5f1
Call-ID: 6PpMjSTpXlf8hIQYyHGd8BnZO7ZEGU2I
CSeq: 22307 INVITE
Server: FPBX-12.0.38(11.16.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


--end msg--
22:41:50.032   pjsua_core.c  ..TX 334 bytes Request msg ACK/cseq=22307 (tdta0x7f253800b320) to UDP 192.168.56.50:5060:
ACK sip:200@192.168.56.50 SIP/2.0
Via: SIP/2.0/UDP 192.168.56.1:5060;rport;branch=z9hG4bKPjmB8.3nm0.MWuGbW9R1vOxqgjXMLYvQja
Max-Forwards: 70
From: sip:100@192.168.56.50;tag=tBQEHZS3c8MW5RF9jtG9v-saqjeoX6KP
To: sip:200@192.168.56.50;tag=as35b7c5f1
Call-ID: 6PpMjSTpXlf8hIQYyHGd8BnZO7ZEGU2I
CSeq: 22307 ACK
Content-Length:  0


--end msg--
22:41:50.032 /media/sda2/te  .....Call 0 state=DISCONNCTD
22:41:50.032  pjsua_media.c  .....Call 0: deinitializing media..
22:41:50.032  pjsua_media.c  ......Call 0: cleaning up provisional media, prov_med_cnt=1, med_cnt=0
22:41:50.039 os_core_unix.c  Info: possibly re-registering existing thread
22:41:51.031    pjsua_aud.c !Closing sound device after idle for 1 second(s)
22:41:51.031    pjsua_aud.c  .Closing HDA Intel: ALC272X Analog (hw:0,0) sound playback device and HDA Intel: ALC272X Analog (hw:0,0) sound capture device

不知何故,您的软件电话构建只启用了 Speex 和 iLBC 编解码器,而您的 asterisk 无法处理这些。检查 PJMEDIA_HAS_G711_CODEC 宏值,可能从 pj/config_site.h 开始。

另外:为什么不从 pjsua 开始,也许会减少它(通常比向最简单的应用程序添加功能更简单)?