Re: Asterisk в роли SIP клиента
Добавлено: 11 май 2011, 16:10
В платный суппорт.gofer_k писал(а):Не помогло картина та же самая
В платный суппорт.gofer_k писал(а):Не помогло картина та же самая
Код: Выделить всё
server*CLI> sip set debug on
SIP Debugging enabled
<--- SIP read from UDP:ip_addr_NEC:5070 --->
INVITE sip:213@ip_addr_asterisk:5060 SIP/2.0
From: "BeloglazovAV"<sip:234@ip_addr_NEC>;tag=96B73246313536410001C245
To: <sip:213@ip_addr_asterisk>
Contact: <sip:ip_addr_NEC:5070>
Content-Type: application/sdp
Session-Expires: 180;refresher=uac
Min-SE: 180
Expires: 180
Allow: INVITE,ACK,BYE,CANCEL,PRACK,REFER,NOTIFY
Supported: 100rel,timer
Date: Wed, 11 May 2011 12:11:03 GMT
Call-ID: 01FFE492A981400000000070@ip_addr_NEC
CSeq: 1 INVITE
Max-Forwards: 70
User-Agent: NEC-i SV8100-GE 04.00
Via: SIP/2.0/UDP ip_addr_NEC:5070;branch=z9hG4bKC3714DDB633AD713
Content-Length: 296
v=0
o=- 0 0 IN IP4 ip_addr_NEC
s=-
c=IN IP4 ip_addr_NEC_IPLA
t=0 0
m=audio 10020 RTP/AVP 8 2 18 9 96
a=rtpmap:8 PCMA/8000
a=ptime:20
a=rtpmap:2 G726-32/8000
a=ptime:30
a=rtpmap:18 G729/8000
a=ptime:20
a=rtpmap:9 G722/8000
a=ptime:30
a=rtpmap:96 telephone-event/8000
a=fmtp:96 0-15
<------------->
--- (17 headers 16 lines) ---
== Using SIP RTP CoS mark 5
Sending to ip_addr_NEC : 5070 (NAT)
Using INVITE request as basis request - 01FFE492A981400000000070@ip_addr_NEC
Found peer '213' for '234' from ip_addr_NEC:5070
<--- Reliably Transmitting (NAT) to ip_addr_NEC:5070 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP ip_addr_NEC:5070;branch=z9hG4bKC3714DDB633AD713;received=ip_addr_NEC
From: "BeloglazovAV"<sip:234@ip_addr_NEC>;tag=96B73246313536410001C245
To: <sip:213@ip_addr_asterisk>;tag=as063fd638
Call-ID: 01FFE492A981400000000070@ip_addr_NEC
CSeq: 1 INVITE
Server: Asterisk PBX 1.6.2.17
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="700abdd7"
Content-Length: 0
<------------>
Scheduling destruction of SIP dialog '01FFE492A981400000000070@ip_addr_NEC' in 32000 ms (Method: INVITE)
<--- SIP read from UDP:ip_addr_NEC:5070 --->
ACK sip:213@ip_addr_asterisk:5060 SIP/2.0
Call-ID: 01FFE492A981400000000070@ip_addr_NEC
CSeq: 1 ACK
From: "BeloglazovAV"<sip:234@ip_addr_NEC>;tag=96B73246313536410001C245
To: <sip:213@ip_addr_asterisk>;tag=as063fd638
Via: SIP/2.0/UDP ip_addr_NEC:5070;branch=z9hG4bKC3714DDB633AD713
Max-Forwards: 70
User-Agent: NEC-i SV8100-GE 04.00
Content-Length: 0
<------------->
--- (9 headers 0 lines) ---
<--- SIP read from UDP:ip_addr_NEC:5070 --->
INVITE sip:213@ip_addr_asterisk SIP/2.0
From: "BeloglazovAV"<sip:234@ip_addr_NEC>;tag=96BC3246313536410001C246
To: <sip:213@ip_addr_asterisk:5060>
Contact: <sip:234@ip_addr_NEC:5070>
Content-Type: application/sdp
CSeq: 2 INVITE
Authorization: Digest username="",realm="asterisk",algorithm=MD5,nonce="700abdd7",opaque="",uri="sip:213@ip_addr_asterisk",response="2026e20dc1f2c7081531a934b9ea705a"
Allow: INVITE,ACK,BYE,CANCEL,PRACK,REFER,NOTIFY
Supported: 100rel,timer
Expires: 180
Date: Wed, 11 May 2011 12:11:04 GMT
Session-Expires: 180
Min-SE: 180
Call-ID: 01FFE492A981400000000070@ip_addr_NEC
Max-Forwards: 70
User-Agent: NEC-i SV8100-GE 04.00
Via: SIP/2.0/UDP ip_addr_NEC:5070;branch=z9hG4bK59B4C951767FC6EE
Content-Length: 296
v=0
o=- 0 0 IN IP4 ip_addr_NEC
s=-
c=IN IP4 ip_addr_NEC_IPLA
t=0 0
m=audio 10020 RTP/AVP 8 2 18 9 96
a=rtpmap:8 PCMA/8000
a=ptime:20
a=rtpmap:2 G726-32/8000
a=ptime:30
a=rtpmap:18 G729/8000
a=ptime:20
a=rtpmap:9 G722/8000
a=ptime:30
a=rtpmap:96 telephone-event/8000
a=fmtp:96 0-15
<------------->
--- (18 headers 16 lines) ---
Sending to ip_addr_NEC : 5070 (NAT)
Using INVITE request as basis request - 01FFE492A981400000000070@ip_addr_NEC
Found peer '213' for '234' from ip_addr_NEC:5070
[2011-05-11 16:11:09] WARNING[15949]: chan_sip.c:12872 check_auth: username mismatch, have <213>, digest has <>
[2011-05-11 16:11:09] NOTICE[15949]: chan_sip.c:20235 handle_request_invite: Failed to authenticate device "BeloglazovAV"<sip:234@ip_addr_NEC>;tag=96BC3246313536410001C246
<--- Reliably Transmitting (NAT) to ip_addr_NEC:5070 --->
SIP/2.0 403 Forbidden
Via: SIP/2.0/UDP ip_addr_NEC:5070;branch=z9hG4bK59B4C951767FC6EE;received=ip_addr_NEC
From: "BeloglazovAV"<sip:234@ip_addr_NEC>;tag=96BC3246313536410001C246
To: <sip:213@ip_addr_asterisk:5060>;tag=as063fd638
Call-ID: 01FFE492A981400000000070@ip_addr_NEC
CSeq: 2 INVITE
Server: Asterisk PBX 1.6.2.17
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Content-Length: 0
<------------>
Scheduling destruction of SIP dialog '01FFE492A981400000000070@ip_addr_NEC' in 32000 ms (Method: INVITE)
<--- SIP read from UDP:ip_addr_NEC:5070 --->
ACK sip:213@ip_addr_asterisk SIP/2.0
Call-ID: 01FFE492A981400000000070@ip_addr_NEC
CSeq: 2 ACK
From: "BeloglazovAV"<sip:234@ip_addr_NEC>;tag=96BC3246313536410001C246
To: <sip:213@ip_addr_asterisk:5060>;tag=as063fd638
Via: SIP/2.0/UDP ip_addr_NEC:5070;branch=z9hG4bK59B4C951767FC6EE
Max-Forwards: 70
User-Agent: NEC-i SV8100-GE 04.00
Content-Length: 0
<------------->
--- (9 headers 0 lines) ---
server*CLI> sip set debug off
SIP Debugging Disabled
server*CLI>
??ddkprog писал(а): Authorization: Digest username="",realm="asterisk",algorithm=MD5,nonce="700abdd7",opaque="",uri="sip:213@ip_addr_asterisk",response="2026e20dc1f2c7081531a934b9ea705a"
User-Agent: NEC-i SV8100-GE 04.00
ddkprog писал(а):выбрасывайте свой NEС
Код: Выделить всё
*CLI> sip show registry
Host dnsmgr Username Refresh State Reg.Time
10.16.18.2:5060 N 784XXXXXX1 285 Registered Tue, 17 May 2011 16:00:20
10.16.18.2:5060 N 784XXXXXX2 285 Registered Tue, 17 May 2011 16:00:20
10.16.18.2:5060 N 784XXXXXX3 285 Registered Tue, 17 May 2011 16:00:20
Код: Выделить всё
[general]
static=yes
writeprotect=no
autofallthrough=yes
clearglobalvars=no
[globals]
CONSOLE=Console/dsp
IAXINFO=guest
TRUNK=DAHDI/G2
TRUNKMSD=1
Trunk77 = SIP/784XXXXXX1
Trunk78 = SIP/784XXXXXX2
Trunk82 = SIP/7784XXXXX3
......
Mobile = _89XXXXXXXXX
.......
.......
[outgoing]
exten => ${Mobile},1,Answer
same => n,Dial(${Trunk77}/${EXTEN})
same => n,Dial(${Trunk78}/${EXTEN})
same => n,Dial(${Trunk82}/${EXTEN})
same => n,Hangup
....
....
....
Сделал так:ded писал(а):Код: Выделить всё
Re: Нужен обработчик hangupcause-ов для trix 2.6 /2.8 ISUP Cause value SIP response ---------------- ------------ 1 unallocated number 404 Not Found 2 no route to network 404 Not found 3 no route to destination 404 Not found 16 normal call clearing --- (*) 17 user busy 486 Busy here 18 no user responding 408 Request Timeout 19 no answer from the user 480 Temporarily unavailable 20 subscriber absent 480 Temporarily unavailable 21 call rejected 403 Forbidden (+) 22 number changed (w/o diagnostic) 410 Gone 22 number changed (w/ diagnostic) 301 Moved Permanently 23 redirection to new destination 410 Gone 26 non-selected user clearing 404 Not Found (=) 27 destination out of order 502 Bad Gateway 28 address incomplete 484 Address incomplete 29 facility rejected 501 Not implemented 31 normal unspecified 480 Temporarily unavailable Q.931 cause 28 address incomplete = SIP 484 Address incomplete = AST_CAUSE_INVALID_NUMBER_FORMAT Значит можно без AGI - exten => s,n,NoOp(HANGUPCAUSE is ${HANGUPCAUSE}) exten => s,n,gotoif,($[${HANGUPCAUSE} = 28]?s-INVALID,1) exten => s-INVALID,1,Playback(invalid) Правда это надо вставлять в macro-dialout-trunk-predial-hook, потому что macro-dialout-trunk - динамический, находится в extensions_additional.conf и перепишется при первом Apply.
ded писал(а):равда это надо вставлять в macro-dialout-trunk-predial-hook, потому что macro-dialout-trunk - динамический, находится в extensions_additional.conf и перепишется при первом Apply
Бывает!gofer_k писал(а):Только не понял насчет вот этого:
ded писал(а):