Генерированные по AMI PHP звонки рвутся через 2 секунды
Есть проблема
Генерированные по AMI PHP звонки рвутся через 2 секунды
Вот код PHP
| Code: |
| #!/usr/bin/php -q |
extensions.conf
[cmr1]
exten => h,1,noop("extended CDR")
exten => h,2,NoOp(Call was hung up - ${CDR(billsec)})
exten => h,n,Set(CDR(media)=${CHANNEL(rtpqos,audio,all)})
exten => h,n,Set(CDR(hangupcause)=${HANGUPCAUSE})
exten => h,n,Set(CDR(peerip)=${CHANNEL(peerip)})
exten => h,n,Set(CDR(recvip)=${CHANNEL(recvip)})
exten => h,n,Set(CDR(from)=${CHANNEL(from)})
exten => h,n,Set(CDR(uri)=${CHANNEL(uri)})
exten => h,n,Set(CDR(useragent)=${CHANNEL(useragent)})
exten => h,n,Set(CDR(codec1)=${CHANNEL(audioreadformat)})
exten => h,n,Set(CDR(codec2)=${CHANNEL(audiowriteformat)})
exten => 12,1,Set(fname=${STRFTIME(${EPOCH},,%Y%m%d%H%M)}-${CALLERID(num)}-${EXTEN})
exten => 12,2,MixMonitor(/var/lib/asterisk/sounds/ourtest/${fname}.wav,W(2))
sip.conf
[mvts2_live]
type=peer
host=XXX.XXX.XXX.XXX
canreinvite=no
nat=no
qualify=yes
context=toswitch
disallow=all
allow=g729
Вывод CLI
== Manager 'user' logged on from 10.10.10.10
== Using SIP RTP CoS mark 5
Audio is at 5060
Adding codec 0x100 (g729) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (no NAT) to 10.10.10.101:5060:
INVITE sip:9090125212555@10.10.10.101;user=phone SIP/2.0
Via: SIP/2.0/UDP 10.10.10.105:5060;branch=z9hG4bK6cf3490e
Max-Forwards: 70
From: "asterisk" ;tag=as77033efc
To:
Contact:
Call-ID: 30a436141d573c3b3bd09b770ddf3506@10.10.10.105:5060
CSeq: 102 INVITE
User-Agent: Asterisk
Date: Fri, 19 Aug 2011 12:42:52 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 292
v=0
o=root 1754394478 1754394478 IN IP4 10.10.10.105
s=Asterisk PBX 1.8.6.0-rc1
c=IN IP4 10.10.10.105
t=0 0
m=audio 13902 RTP/AVP 18 101
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv
---
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.10.10.105:5060;branch=z9hG4bK6cf3490e
From: "asterisk" ;tag=as77033efc
To:
Call-ID: 30a436141d573c3b3bd09b770ddf3506@10.10.10.105:5060
CSeq: 102 INVITE
Contact:
Server: MERA MVTS3G v.4.3.0-44
Content-Length: 0
--- (9 headers 0 lines) ---
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 10.10.10.105:5060;branch=z9hG4bK6cf3490e
From: "asterisk" ;tag=as77033efc
To: ;tag=3201773987-3759235274-352330156-37213975
Call-ID: 30a436141d573c3b3bd09b770ddf3506@10.10.10.105:5060
CSeq: 102 INVITE
Contact:
Server: MERA MVTS3G v.4.3.0-44
Content-Length: 0
--- (9 headers 0 lines) ---
Reliably Transmitting (no NAT) to 10.10.10.101:5060:
OPTIONS sip:10.10.10.101;user=phone SIP/2.0
Via: SIP/2.0/UDP 10.10.10.105:5060;branch=z9hG4bK40366877
Max-Forwards: 70
From: "asterisk" ;tag=as5141579d
To:
Contact:
Call-ID: 7bc7847e4cc579d3793ce8551a67defc@10.10.10.105:5060
CSeq: 102 OPTIONS
User-Agent: Asterisk
Date: Fri, 19 Aug 2011 12:42:59 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0
---
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.10.10.105:5060;branch=z9hG4bK40366877
From: "asterisk" ;tag=as5141579d
To: ;tag=1913481127-3759235274-352330156-37213975
Call-ID: 7bc7847e4cc579d3793ce8551a67defc@10.10.10.105:5060
CSeq: 102 OPTIONS
Allow: ACK, BYE, CANCEL, INFO, INVITE, OPTIONS, PRACK, REFER, REGISTER, UPDATE
Accept: application/dtmf-relay
Accept: application/ISUP
Accept: application/sdp
Supported: 100rel
Server: MERA MVTS3G v.4.3.0-44
Content-Length: 0
--- (13 headers 0 lines) ---
Really destroying SIP dialog '7bc7847e4cc579d3793ce8551a67defc@10.10.10.105:5060' Method: OPTIONS
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.10.10.105:5060;branch=z9hG4bK6cf3490e
From: "asterisk" ;tag=as77033efc
To: ;tag=3201773987-3759235274-352330156-37213975
Call-ID: 30a436141d573c3b3bd09b770ddf3506@10.10.10.105:5060
CSeq: 102 INVITE
Contact:
Content-Type: application/sdp
Allow: ACK, BYE, CANCEL, INFO, INVITE, OPTIONS, REFER, REGISTER, UPDATE
Server: MERA MVTS3G v.4.3.0-44
X-mera-expires: 86460
Content-Length: 266
v=0
o=- 1313757733 1313757733 IN IP4 10.10.10.101
s=-
c=IN IP4 10.10.10.101
t=0 0
m=audio 46064 RTP/AVP 18 101
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=ptime:20
a=sendrecv
a=silenceSupp:off - - - -
--- (12 headers 13 lines) ---
Found RTP audio format 18
Found RTP audio format 101
Found audio description format G729 for ID 18
Found audio description format telephone-event for ID 101
Capabilities: us - 0x100 (g729), peer - audio=0x100 (g729)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0x100 (g729)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 10.10.10.101:46064
list_route: hop:
set_destination: Parsing for address/port to send to
set_destination: set destination to 10.10.10.101:5060
Transmitting (no NAT) to 10.10.10.101:5060:
ACK sip:9090125212555@10.10.10.101:5060;user=phone SIP/2.0
Via: SIP/2.0/UDP 10.10.10.105:5060;branch=z9hG4bK09131b6a
Max-Forwards: 70
From: "asterisk" ;tag=as77033efc
To: ;tag=3201773987-3759235274-352330156-37213975
Contact:
Call-ID: 30a436141d573c3b3bd09b770ddf3506@10.10.10.105:5060
CSeq: 102 ACK
User-Agent: Asterisk
Content-Length: 0
---
> Channel SIP/mvts2_live-00000041 was answered.
-- Executing [12@cmr1] Set("SIP/mvts2_live-00000041", "CALLERID(all)=104255833") in new stack
-- Executing [12@cmr1] Set("SIP/mvts2_live-00000041", "fname=201108191243-104255833-12") in new stack
-- Executing [12@cmr1] MixMonitor("SIP/mvts2_live-00000041", "/var/lib/asterisk/sounds/ourtest/201108191243-104255833-12.wav,W(2)") in new stack
== Begin MixMonitor Recording SIP/mvts2_live-00000041
-- Auto fallthrough, channel 'SIP/mvts2_live-00000041' status is 'UNKNOWN'
-- Executing [h@cmr1] NoOp("SIP/mvts2_live-00000041", ""extended CDR"") in new stack
-- Executing [h@cmr1] NoOp("SIP/mvts2_live-00000041", "Call was hung up - 0") in new stack
-- Executing [h@cmr1] Set("SIP/mvts2_live-00000041", "CDR(media)=ssrc=1972856309;themssrc=484690642;lp=0;rxjitter=0.000619;rxcount=68;txjitter=0.000000;txcount=0;rlp=0;rtt=0.000000") in new stack
-- Executing [h@cmr1] Set("SIP/mvts2_live-00000041", "CDR(hangupcause)=16") in new stack
-- Executing [h@cmr1] Set("SIP/mvts2_live-00000041", "CDR(peerip)=10.10.10.101") in new stack
-- Executing [h@cmr1] Set("SIP/mvts2_live-00000041", "CDR(recvip)=10.10.10.101") in new stack
-- Executing [h@cmr1] Set("SIP/mvts2_live-00000041", "CDR(from)=") in new stack
-- Executing [h@cmr1] Set("SIP/mvts2_live-00000041", "CDR(uri)=sip:9090125212555@10.10.10.101:5060") in new stack
-- Executing [h@cmr1] Set("SIP/mvts2_live-00000041", "CDR(useragent)=") in new stack
-- Executing [h@cmr1] Set("SIP/mvts2_live-00000041", "CDR(codec1)=g729") in new stack
-- Executing [h@cmr1] Set("SIP/mvts2_live-00000041", "CDR(codec2)=g729") in new stack
Scheduling destruction of SIP dialog '30a436141d573c3b3bd09b770ddf3506@10.10.10.105:5060' in 6400 ms (Method: INVITE)
set_destination: Parsing for address/port to send to
set_destination: set destination to 10.10.10.101:5060
Reliably Transmitting (no NAT) to 10.10.10.101:5060:
BYE sip:9090125212555@10.10.10.101:5060;user=phone SIP/2.0
Via: SIP/2.0/UDP 10.10.10.105:5060;branch=z9hG4bK409a8897
Max-Forwards: 70
From: "asterisk" ;tag=as77033efc
To: ;tag=3201773987-3759235274-352330156-37213975
Call-ID: 30a436141d573c3b3bd09b770ddf3506@10.10.10.105:5060
CSeq: 103 BYE
User-Agent: Asterisk
Reason: Q.850;cause=16
X-Asterisk-HangupCause: Normal Clearing
X-Asterisk-HangupCauseCode: 16
Content-Length: 0
---
== End MixMonitor Recording SIP/mvts2_live-00000041
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.10.10.105:5060;branch=z9hG4bK409a8897
From: "asterisk" ;tag=as77033efc
To: ;tag=3201773987-3759235274-352330156-37213975
Call-ID: 30a436141d573c3b3bd09b770ddf3506@10.10.10.105:5060
CSeq: 103 BYE
Contact:
Server: MERA MVTS3G v.4.3.0-44
Content-Length: 0
--- (9 headers 0 lines) ---
Really destroying SIP dialog '30a436141d573c3b3bd09b770ddf3506@10.10.10.105:5060' Method: INVITE
== Manager 'user' logged off from 10.10.10.10
Однако при запуске из CLI все нормально
channel originate SIP/9090125212555@mvts2_live extension 12@cmr
Помогите пожалуйста.
Это не бот!
Added after 2 minutes:
Даже если не брать трубку звонок все равно рвется после 2х звонков.