Twilio起源呼叫问题 - 间歇性传入问题

时间:2016-07-04 21:14:39

标签: twilio asterisk sip sip-server freepbx

我正在尝试在我的Asterisk / Freepbx实例上设置Twilio Elastic SIP Trunking并且很难设置可靠的发起(终止工作非常好)。

背景 - 我按照twilio指南完成了所有设置,在freepbx和stackoverflow上发布了很多论坛帖子,而且大部分都是一个有效的设置。

  1. 来自分机/ pbx的出站 - 效果非常好,清晰度很高。
  2. 从PSTN到Twilio的入站号码:我先听到一些短铃声,然后是几声长铃声,它'可能'最终会拨打我的分机号码。呼叫到达我的分机的时间的25%(并且从一个Twilio白名单IP成功和随机地,不一定是相同的IP)。 75%的时间呼叫与哔声断开,呼叫无法连接等消息。
  3. 当我使用“拨打测试呼叫”按钮从Twilio'Origination'设置页面拨打电话时,该呼叫是即时的,并且工作正常。
  4. 在上面的#2中,我注意到我听到的每个戒指都在Twilio中有一个“失败”的日志。我无法从日志中解读太多信息(没有任何401,403等)。有人可以帮忙吗?为什么#3总是有效(Twilio的测试呼叫按钮)?

    以下是失败电话的Twilio日志:

    INVITE sip:+1TWILIONUMBER@MYASTERSIKIP SIP/2.0
    Record-Route: <sip:54.172.60.0:5060;lr;ftag=90304243_6772d868_40eb6ad8-c345-48cf-955c-425fd0246d38>
    From: <sip:+1MYPSTNPHONE@MYTWILIOORGID.pstn.twilio.com;isup-oli=0;pstn-params=9084818088;cpc=ordinary>;tag=90304243_6772d868_40eb6ad8-c345-48cf-955c-425fd0246d38
    To: <sip:+1TWILIONUMBER@MYASTERSIKIP;user=phone>
    CSeq: 9141 INVITE
    Max-Forwards: 63
    Accept: application/sdp
    Accept: application/isup
    Accept: application/dtmf
    Accept: application/dtmf-relay
    Accept: multipart/mixed
    Session-Expires: 1800
    Min-SE: 90
    Content-Disposition: session;handling=required
    Diversion: <sip:+1TWILIONUMBER@public-vip.us1.twilio.com>;reason=unconditional
    Call-ID: 3612263d48dd307c857c2d3c1815ba73@0.0.0.0
    Via: SIP/2.0/UDP 54.172.60.0:5060;branch=z9hG4bK18.e94819e6.0
    Via: SIP/2.0/UDP 172.18.12.93:5060;rport=5060;received=172.18.12.93;branch=z9hG4bK40eb6ad8-c345-48cf-955c-425fd0246d38_6772d868_285296189381176
    Contact: <sip:+1MYPSTNPHONE@172.18.12.93:5060;transport=udp>
    Allow: INVITE,ACK,CANCEL,BYE,OPTIONS
    User-Agent: Twilio Gateway
    X-Twilio-AccountSid: AC9172c558ab99243b3cccdce67dadd1b9
    X-Twilio-ApiVersion: 2010-04-01
    Content-Type: application/sdp
    X-Twilio-CallSid: CAe5541067a3270dbe765ee9c0b839cec5
    Content-Length: 231
    
    v=0
    o=- 869153823 869153823 IN IP4 54.172.60.79
    s=Twilio Media Gateway
    c=IN IP4 54.172.60.79
    t=0 0
    m=audio 13460 RTP/AVP 0 101
    a=rtpmap:0 PCMU/8000
    a=rtpmap:101 telephone-event/8000
    a=fmtp:101 0-15
    a=ptime:20
    a=sendrecv
    INVITE sip:+1TWILIONUMBER@MYASTERSIKIP SIP/2.0
    Record-Route: <sip:54.172.60.0:5060;lr;ftag=90304243_6772d868_40eb6ad8-c345-48cf-955c-425fd0246d38>
    From: <sip:+1MYPSTNPHONE@MYTWILIOORGID.pstn.twilio.com;isup-oli=0;pstn-params=9084818088;cpc=ordinary>;tag=90304243_6772d868_40eb6ad8-c345-48cf-955c-425fd0246d38
    To: <sip:+1TWILIONUMBER@MYASTERSIKIP;user=phone>
    CSeq: 9141 INVITE
    Max-Forwards: 63
    Accept: application/sdp
    Accept: application/isup
    Accept: application/dtmf
    Accept: application/dtmf-relay
    Accept: multipart/mixed
    Session-Expires: 1800
    Min-SE: 90
    Content-Disposition: session;handling=required
    Diversion: <sip:+1TWILIONUMBER@public-vip.us1.twilio.com>;reason=unconditional
    Call-ID: 3612263d48dd307c857c2d3c1815ba73@0.0.0.0
    Via: SIP/2.0/UDP 54.172.60.0:5060;branch=z9hG4bK18.e94819e6.0
    Via: SIP/2.0/UDP 172.18.12.93:5060;rport=5060;received=172.18.12.93;branch=z9hG4bK40eb6ad8-c345-48cf-955c-425fd0246d38_6772d868_285296189381176
    Contact: <sip:+1MYPSTNPHONE@172.18.12.93:5060;transport=udp>
    Allow: INVITE,ACK,CANCEL,BYE,OPTIONS
    User-Agent: Twilio Gateway
    X-Twilio-AccountSid: AC9172c558ab99243b3cccdce67dadd1b9
    X-Twilio-ApiVersion: 2010-04-01
    Content-Type: application/sdp
    X-Twilio-CallSid: CAe5541067a3270dbe765ee9c0b839cec5
    Content-Length: 231
    
    v=0
    o=- 869153823 869153823 IN IP4 54.172.60.79
    s=Twilio Media Gateway
    c=IN IP4 54.172.60.79
    t=0 0
    m=audio 13460 RTP/AVP 0 101
    a=rtpmap:0 PCMU/8000
    a=rtpmap:101 telephone-event/8000
    a=fmtp:101 0-15
    a=ptime:20
    a=sendrecv
    INVITE sip:+1TWILIONUMBER@MYASTERSIKIP SIP/2.0
    Record-Route: <sip:54.172.60.0:5060;lr;ftag=90304243_6772d868_40eb6ad8-c345-48cf-955c-425fd0246d38>
    From: <sip:+1MYPSTNPHONE@MYTWILIOORGID.pstn.twilio.com;isup-oli=0;pstn-params=9084818088;cpc=ordinary>;tag=90304243_6772d868_40eb6ad8-c345-48cf-955c-425fd0246d38
    To: <sip:+1TWILIONUMBER@MYASTERSIKIP;user=phone>
    CSeq: 9141 INVITE
    Max-Forwards: 63
    Accept: application/sdp
    Accept: application/isup
    Accept: application/dtmf
    Accept: application/dtmf-relay
    Accept: multipart/mixed
    Session-Expires: 1800
    Min-SE: 90
    Content-Disposition: session;handling=required
    Diversion: <sip:+1TWILIONUMBER@public-vip.us1.twilio.com>;reason=unconditional
    Call-ID: 3612263d48dd307c857c2d3c1815ba73@0.0.0.0
    Via: SIP/2.0/UDP 54.172.60.0:5060;branch=z9hG4bK18.e94819e6.0
    Via: SIP/2.0/UDP 172.18.12.93:5060;rport=5060;received=172.18.12.93;branch=z9hG4bK40eb6ad8-c345-48cf-955c-425fd0246d38_6772d868_285296189381176
    Contact: <sip:+1MYPSTNPHONE@172.18.12.93:5060;transport=udp>
    Allow: INVITE,ACK,CANCEL,BYE,OPTIONS
    User-Agent: Twilio Gateway
    X-Twilio-AccountSid: AC9172c558ab99243b3cccdce67dadd1b9
    X-Twilio-ApiVersion: 2010-04-01
    Content-Type: application/sdp
    X-Twilio-CallSid: CAe5541067a3270dbe765ee9c0b839cec5
    Content-Length: 231
    
    v=0
    o=- 869153823 869153823 IN IP4 54.172.60.79
    s=Twilio Media Gateway
    c=IN IP4 54.172.60.79
    t=0 0
    m=audio 13460 RTP/AVP 0 101
    a=rtpmap:0 PCMU/8000
    a=rtpmap:101 telephone-event/8000
    a=fmtp:101 0-15
    a=ptime:20
    a=sendrecv
    INVITE sip:+1TWILIONUMBER@MYASTERSIKIP SIP/2.0
    Record-Route: <sip:54.172.60.0:5060;lr;ftag=90304243_6772d868_40eb6ad8-c345-48cf-955c-425fd0246d38>
    From: <sip:+1MYPSTNPHONE@MYTWILIOORGID.pstn.twilio.com;isup-oli=0;pstn-params=9084818088;cpc=ordinary>;tag=90304243_6772d868_40eb6ad8-c345-48cf-955c-425fd0246d38
    To: <sip:+1TWILIONUMBER@MYASTERSIKIP;user=phone>
    CSeq: 9141 INVITE
    Max-Forwards: 63
    Accept: application/sdp
    Accept: application/isup
    Accept: application/dtmf
    Accept: application/dtmf-relay
    Accept: multipart/mixed
    Session-Expires: 1800
    Min-SE: 90
    Content-Disposition: session;handling=required
    Diversion: <sip:+1TWILIONUMBER@public-vip.us1.twilio.com>;reason=unconditional
    Call-ID: 3612263d48dd307c857c2d3c1815ba73@0.0.0.0
    Via: SIP/2.0/UDP 54.172.60.0:5060;branch=z9hG4bK18.e94819e6.0
    Via: SIP/2.0/UDP 172.18.12.93:5060;rport=5060;received=172.18.12.93;branch=z9hG4bK40eb6ad8-c345-48cf-955c-425fd0246d38_6772d868_285296189381176
    Contact: <sip:+1MYPSTNPHONE@172.18.12.93:5060;transport=udp>
    Allow: INVITE,ACK,CANCEL,BYE,OPTIONS
    User-Agent: Twilio Gateway
    X-Twilio-AccountSid: AC9172c558ab99243b3cccdce67dadd1b9
    X-Twilio-ApiVersion: 2010-04-01
    Content-Type: application/sdp
    X-Twilio-CallSid: CAe5541067a3270dbe765ee9c0b839cec5
    Content-Length: 231
    
    v=0
    o=- 869153823 869153823 IN IP4 54.172.60.79
    s=Twilio Media Gateway
    c=IN IP4 54.172.60.79
    t=0 0
    m=audio 13460 RTP/AVP 0 101
    a=rtpmap:0 PCMU/8000
    a=rtpmap:101 telephone-event/8000
    a=fmtp:101 0-15
    a=ptime:20
    a=sendrecv
    

    Twilio Log View

    成功通话的Twilio日志:

    INVITE sip:+1TWILIONUMBER@MYASTERSIKIP SIP/2.0
    Record-Route: <sip:54.172.60.1:5060;lr;ftag=65942748_6772d868_4b230251-675c-48ca-92d5-24d1f90c4cda>
    From: <sip:+1MYPSTNPHONE@MYTWILIOORGID.pstn.twilio.com;pstn-params=808181808882;cpc=ordinary>;tag=65942748_6772d868_4b230251-675c-48ca-92d5-24d1f90c4cda
    To: <sip:+1TWILIONUMBER@MYASTERSIKIP;user=phone>
    CSeq: 31801 INVITE
    Max-Forwards: 11
    Accept: application/sdp
    Accept: application/isup
    Accept: application/dtmf
    Accept: application/dtmf-relay
    Accept: multipart/mixed
    Session-Expires: 1800
    Min-SE: 90
    Content-Disposition: session;handling=required
    Diversion: <sip:+1TWILIONUMBER@public-vip.us1.twilio.com>;reason=unconditional
    Call-ID: c4d7a4854a1246e4a19d1c56d3f0e169@0.0.0.0
    Via: SIP/2.0/UDP 54.172.60.1:5060;branch=z9hG4bKb67c.e698b2c7.0
    Via: SIP/2.0/UDP 172.18.3.99:5060;rport=5060;received=172.18.3.99;branch=z9hG4bK4b230251-675c-48ca-92d5-24d1f90c4cda_6772d868_285301165960484
    Contact: <sip:+1MYPSTNPHONE@172.18.3.99:5060;transport=udp>
    Allow: INVITE,ACK,CANCEL,BYE,OPTIONS
    User-Agent: Twilio Gateway
    X-Twilio-AccountSid: AC9172c558ab99243b3cccdce67dadd1b9
    X-Twilio-ApiVersion: 2010-04-01
    Content-Type: application/sdp
    X-Twilio-CallSid: CAe6bf2966fc9f8990f508c0d57b7e7dc9
    Content-Length: 233
    
    v=0
    o=- 377936330 377936330 IN IP4 54.172.60.201
    s=Twilio Media Gateway
    c=IN IP4 54.172.60.201
    t=0 0
    m=audio 11960 RTP/AVP 0 101
    a=rtpmap:0 PCMU/8000
    a=rtpmap:101 telephone-event/8000
    a=fmtp:101 0-15
    a=ptime:20
    a=sendrecv
    SIP/2.0 100 Trying
    Via: SIP/2.0/UDP 54.172.60.1:5060;branch=z9hG4bKb67c.e698b2c7.0;received=54.172.60.1;rport=5060
    Via: SIP/2.0/UDP 172.18.3.99:5060;rport=5060;received=172.18.3.99;branch=z9hG4bK4b230251-675c-48ca-92d5-24d1f90c4cda_6772d868_285301165960484
    Record-Route: <sip:54.172.60.1:5060;lr;ftag=65942748_6772d868_4b230251-675c-48ca-92d5-24d1f90c4cda>
    From: <sip:+1MYPSTNPHONE@MYTWILIOORGID.pstn.twilio.com;pstn-params=808181808882;cpc=ordinary>;tag=65942748_6772d868_4b230251-675c-48ca-92d5-24d1f90c4cda
    To: <sip:+1TWILIONUMBER@MYASTERSIKIP:5060;user=phone>
    Call-ID: c4d7a4854a1246e4a19d1c56d3f0e169@0.0.0.0
    CSeq: 31801 INVITE
    Server: FPBX-12.0.70(13.9.1)
    Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
    Supported: replaces, timer
    Contact: <sip:+1TWILIONUMBER@MYASTERSIKIP:5060>
    Content-Length: 0
    
    SIP/2.0 180 Ringing
    Via: SIP/2.0/UDP 54.172.60.1:5060;branch=z9hG4bKb67c.e698b2c7.0;received=54.172.60.1;rport=5060
    Via: SIP/2.0/UDP 172.18.3.99:5060;rport=5060;received=172.18.3.99;branch=z9hG4bK4b230251-675c-48ca-92d5-24d1f90c4cda_6772d868_285301165960484
    Record-Route: <sip:54.172.60.1:5060;lr;ftag=65942748_6772d868_4b230251-675c-48ca-92d5-24d1f90c4cda>
    From: <sip:+1MYPSTNPHONE@MYTWILIOORGID.pstn.twilio.com;pstn-params=808181808882;cpc=ordinary>;tag=65942748_6772d868_4b230251-675c-48ca-92d5-24d1f90c4cda
    To: <sip:+1TWILIONUMBER@MYASTERSIKIP:5060;user=phone>;tag=as3a65945e
    Call-ID: c4d7a4854a1246e4a19d1c56d3f0e169@0.0.0.0
    CSeq: 31801 INVITE
    Server: FPBX-12.0.70(13.9.1)
    Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
    Supported: replaces, timer
    Contact: <sip:+1TWILIONUMBER@MYASTERSIKIP:5060>
    Content-Length: 0
    
    SIP/2.0 180 Ringing
    Via: SIP/2.0/UDP 54.172.60.1:5060;branch=z9hG4bKb67c.e698b2c7.0;received=54.172.60.1;rport=5060
    Via: SIP/2.0/UDP 172.18.3.99:5060;rport=5060;received=172.18.3.99;branch=z9hG4bK4b230251-675c-48ca-92d5-24d1f90c4cda_6772d868_285301165960484
    Record-Route: <sip:54.172.60.1:5060;lr;ftag=65942748_6772d868_4b230251-675c-48ca-92d5-24d1f90c4cda>
    From: <sip:+1MYPSTNPHONE@MYTWILIOORGID.pstn.twilio.com;pstn-params=808181808882;cpc=ordinary>;tag=65942748_6772d868_4b230251-675c-48ca-92d5-24d1f90c4cda
    To: <sip:+1TWILIONUMBER@MYASTERSIKIP:5060;user=phone>;tag=as3a65945e
    Call-ID: c4d7a4854a1246e4a19d1c56d3f0e169@0.0.0.0
    CSeq: 31801 INVITE
    Server: FPBX-12.0.70(13.9.1)
    Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
    Supported: replaces, timer
    Contact: <sip:+1TWILIONUMBER@MYASTERSIKIP:5060>
    Content-Length: 0
    
    SIP/2.0 200 OK
    Via: SIP/2.0/UDP 54.172.60.1:5060;branch=z9hG4bKb67c.e698b2c7.0;received=54.172.60.1;rport=5060
    Via: SIP/2.0/UDP 172.18.3.99:5060;rport=5060;received=172.18.3.99;branch=z9hG4bK4b230251-675c-48ca-92d5-24d1f90c4cda_6772d868_285301165960484
    Record-Route: <sip:54.172.60.1:5060;lr;ftag=65942748_6772d868_4b230251-675c-48ca-92d5-24d1f90c4cda>
    From: <sip:+1MYPSTNPHONE@MYTWILIOORGID.pstn.twilio.com;pstn-params=808181808882;cpc=ordinary>;tag=65942748_6772d868_4b230251-675c-48ca-92d5-24d1f90c4cda
    To: <sip:+1TWILIONUMBER@MYASTERSIKIP:5060;user=phone>;tag=as3a65945e
    Call-ID: c4d7a4854a1246e4a19d1c56d3f0e169@0.0.0.0
    CSeq: 31801 INVITE
    Server: FPBX-12.0.70(13.9.1)
    Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
    Supported: replaces, timer
    Contact: <sip:+1TWILIONUMBER@MYASTERSIKIP:5060>
    Content-Type: application/sdp
    Content-Length: 483
    
    v=0
    o=root 2047240699 2047240699 IN IP4 MYASTERSIKIP
    s=Asterisk PBX 13.9.1
    c=IN IP4 MYASTERSIKIP
    t=0 0
    m=audio 14374 RTP/AVP 0 101
    a=rtpmap:0 PCMU/8000
    a=rtpmap:101 telephone-event/8000
    a=fmtp:101 0-16
    a=ptime:20
    a=maxptime:150
    a=ice-ufrag:29fbe7313c8689b0102f9d503d9eb401
    a=ice-pwd:7eb4637401aca4580b6985857be28247
    a=candidate:Hc0a81d9a 1 UDP 2130706431 192.168.29.154 14374 typ host
    a=candidate:Hc0a81d9a 2 UDP 2130706430 192.168.29.154 14375 typ host
    a=sendrecv
    ACK sip:+1TWILIONUMBER@MYASTERSIKIP:5060 SIP/2.0
    Call-ID: c4d7a4854a1246e4a19d1c56d3f0e169@0.0.0.0
    CSeq: 31801 ACK
    From: <sip:+1MYPSTNPHONE@MYTWILIOORGID.pstn.twilio.com;pstn-params=808181808882;cpc=ordinary>;tag=65942748_6772d868_4b230251-675c-48ca-92d5-24d1f90c4cda
    To: <sip:+1TWILIONUMBER@MYASTERSIKIP;user=phone>;tag=as3a65945e
    Max-Forwards: 69
    User-Agent: Twilio
    X-Twilio-CallSid: CAe6bf2966fc9f8990f508c0d57b7e7dc9
    Via: SIP/2.0/UDP 54.172.60.1:5060;branch=z9hG4bKb67c.e698b2c7.2
    Via: SIP/2.0/UDP 172.18.3.99:5060;rport=5060;received=54.172.60.201;branch=z9hG4bK4b230251-675c-48ca-92d5-24d1f90c4cda_6772d868_285306732657503
    Content-Length: 0
    
    BYE sip:+1TWILIONUMBER@MYASTERSIKIP:5060 SIP/2.0
    CSeq: 31802 BYE
    From: <sip:+1MYPSTNPHONE@MYTWILIOORGID.pstn.twilio.com;pstn-params=808181808882;cpc=ordinary>;tag=65942748_6772d868_4b230251-675c-48ca-92d5-24d1f90c4cda
    To: <sip:+1TWILIONUMBER@MYASTERSIKIP;user=phone>;tag=as3a65945e
    Call-ID: c4d7a4854a1246e4a19d1c56d3f0e169@0.0.0.0
    Max-Forwards: 68
    Via: SIP/2.0/UDP 54.172.60.1:5060;branch=z9hG4bK867c.164aadb4.0
    Via: SIP/2.0/UDP 172.18.3.99:5060;rport=5060;received=54.172.60.201;branch=z9hG4bK4b230251-675c-48ca-92d5-24d1f90c4cda_6772d868_285317504904769
    User-Agent: Twilio Gateway
    X-Twilio-CallSid: CAe6bf2966fc9f8990f508c0d57b7e7dc9
    Content-Length: 0
    
    SIP/2.0 200 OK
    Via: SIP/2.0/UDP 54.172.60.1:5060;branch=z9hG4bK867c.164aadb4.0;received=54.172.60.1;rport=5060
    Via: SIP/2.0/UDP 172.18.3.99:5060;rport=5060;received=54.172.60.201;branch=z9hG4bK4b230251-675c-48ca-92d5-24d1f90c4cda_6772d868_285317504904769
    From: <sip:+1MYPSTNPHONE@MYTWILIOORGID.pstn.twilio.com;pstn-params=808181808882;cpc=ordinary>;tag=65942748_6772d868_4b230251-675c-48ca-92d5-24d1f90c4cda
    To: <sip:+1TWILIONUMBER@MYASTERSIKIP:5060;user=phone>;tag=as3a65945e
    Call-ID: c4d7a4854a1246e4a19d1c56d3f0e169@0.0.0.0
    CSeq: 31802 BYE
    Server: FPBX-12.0.70(13.9.1)
    Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
    Supported: replaces, timer
    Content-Length: 0
    

0 个答案:

没有答案