Asterisk 1.6 регистрация агентов.
Добавлено: 07 дек 2011, 23:05
Схема такая asterisk 1.6 состыкован с АТС Samsung OS7400 по протоколу sip peer-to-peer.
Звонки ходят без проблем.Появилась задача регистрировать агентов для очереди на asterisk из абонентов АТС Samsung.То есть подняв трубку на телефоне подключенном к АТС Samsung и набрав код 4820 зарегистрироваться агентом на asterisk в очереди Call-centr.
Вот секция касающаяся samsung в sip.conf
вот кусок контекста куда валятся вызовы с samsung
вот дебаг самого звонка
вот список зарегистрированных агентов
В итоге мы видим что абонент samsung регистрируется как SIP/centr , а мне нужно SIP/centr/2580
Если прописываю статически в файле queues.conf member = SIP/centr/2580 то все пучком все работает , звонок из очереди уходит на 2580.
Короче как заставить регистрироваться вот в таком формате SIP/centr/2580 ?
Может средствами диалплана выдергивать callerid и посовывать его как то ?
Звонки ходят без проблем.Появилась задача регистрировать агентов для очереди на asterisk из абонентов АТС Samsung.То есть подняв трубку на телефоне подключенном к АТС Samsung и набрав код 4820 зарегистрироваться агентом на asterisk в очереди Call-centr.
Вот секция касающаяся samsung в sip.conf
Код: Выделить всё
[centr]
context=incoming
type=friend
deny=0.0.0.0/0.0.0.0
permit=192.168.254.1
host=192.168.254.1
disallow=all
;allow=h263
;allow=h264
allow=ulaw
allow=alaw
;allow=gsm
;allow=g729
cancallforward=yes
canreinvite=no
;qualify=yes
;t38pt_udptl=no
;t38pt_rtp=no
;t38pt_tcp=no
Language=ru
Код: Выделить всё
[incoming]
..............
exten => 4820,1,Answer
same => n,AddQueueMember(Call_centr)
same => n,Playback(agent-loginok)
same => n,Hangup
exten => 4821,1,Answer
same => n,RemoveQueueMember(Call_centr)
same => n,Playback(agent-loggedoff)
same => n,Hangup
Код: Выделить всё
localhost*CLI> sip set debug peer centr
SIP Debugging Enabled for IP: 192.168.254.1:5060
<--- SIP read from UDP:192.168.254.1:5060 --->
INVITE sip:4820@192.168.254.2:5060;user=phone SIP/2.0
From: "2580"<sip:2580@192.168.254.1:5060;user=phone>;tag=5874898-c0a86401-13c4-50022-e24265-36e15eeb-e24265
To: <sip:4820@192.168.254.2:5060;user=phone>
Call-ID: 58659b0-c0a86401-13c4-50022-e24265-1073267d-e24265
CSeq: 1 INVITE
Via: SIP/2.0/UDP 192.168.254.1:5060;rport;branch=z9hG4bK-e24265-73d35df0-3e864361
Max-Forwards: 70
Supported: replaces
User-Agent: Samsung OfficeServ
Contact: <sip:2580@192.168.254.1:5060>
Content-Type: application/sdp
Content-Length: 361
v=0
o=SAMSUNG_SIP_GATEWAY 1943231985 0 IN IP4 192.168.254.1
s=SIP_CALL
c=IN IP4 192.168.254.1
t=0 0
m=audio 30124 RTP/AVP 8 18 4 101
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=rtpmap:4 G723/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
m=video 40034 RTP/AVP 34
c=IN IP4 192.168.254.1
a=rtpmap:34 H263/90000
a=fmtp:34 CIF=3
a=sendrecv
<------------->
--- (12 headers 16 lines) ---
== Using SIP RTP CoS mark 5
== Using SIP VRTP CoS mark 6
Sending to 192.168.254.1 : 5060 (NAT)
Using INVITE request as basis request - 58659b0-c0a86401-13c4-50022-e24265-1073267d-e24265
Found peer 'centr' for '2580' from 192.168.254.1:5060
Found RTP audio format 8
Found RTP audio format 18
Found RTP audio format 4
Found RTP audio format 101
Found audio description format PCMA for ID 8
Found audio description format G729 for ID 18
Found audio description format G723 for ID 4
Found audio description format telephone-event for ID 101
Found RTP video format 34
Found video description format H263 for ID 34
Capabilities: us - 0xc (ulaw|alaw), peer - audio=0x109 (g723|alaw|g729)/video=0x80000 (h263)/text=0x0 (nothing), combined - 0x8 (alaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x1 (telephone-event), combined - 0x1 (telephone-event)
Peer audio RTP is at port 192.168.254.1:30124
Looking for 4820 in incoming (domain 192.168.254.2)
list_route: hop: <sip:2580@192.168.254.1:5060>
<--- Transmitting (NAT) to 192.168.254.1:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.254.1:5060;branch=z9hG4bK-e24265-73d35df0-3e864361;received=192.168.254.1;rport=5060
From: "2580"<sip:2580@192.168.254.1:5060;user=phone>;tag=5874898-c0a86401-13c4-50022-e24265-36e15eeb-e24265
To: <sip:4820@192.168.254.2:5060;user=phone>
Call-ID: 58659b0-c0a86401-13c4-50022-e24265-1073267d-e24265
CSeq: 1 INVITE
Server: Asterisk PBX 1.6.2.18.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Contact: <sip:4820@192.168.254.2>
Content-Length: 0
<------------>
-- Executing [4820@incoming:1] Answer("SIP/centr-00000013", "") in new stack
Audio is at 192.168.254.2 port 33464
Adding codec 0x8 (alaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
<--- Reliably Transmitting (NAT) to 192.168.254.1:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.254.1:5060;branch=z9hG4bK-e24265-73d35df0-3e864361;received=192.168.254.1;rport=5060
From: "2580"<sip:2580@192.168.254.1:5060;user=phone>;tag=5874898-c0a86401-13c4-50022-e24265-36e15eeb-e24265
To: <sip:4820@192.168.254.2:5060;user=phone>;tag=as328d9bf9
Call-ID: 58659b0-c0a86401-13c4-50022-e24265-1073267d-e24265
CSeq: 1 INVITE
Server: Asterisk PBX 1.6.2.18.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Contact: <sip:4820@192.168.254.2>
Content-Type: application/sdp
Content-Length: 263
v=0
o=root 1492200635 1492200635 IN IP4 192.168.254.2
s=Asterisk PBX 1.6.2.18.1
c=IN IP4 192.168.254.2
t=0 0
m=audio 33464 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv
m=video 0 RTP/AVP 34
<------------>
<--- SIP read from UDP:192.168.254.1:5060 --->
ACK sip:4820@192.168.254.2 SIP/2.0
From: "2580"<sip:2580@192.168.254.1:5060;user=phone>;tag=5874898-c0a86401-13c4-50022-e24265-36e15eeb-e24265
To: <sip:4820@192.168.254.2:5060;user=phone>;tag=as328d9bf9
Call-ID: 58659b0-c0a86401-13c4-50022-e24265-1073267d-e24265
CSeq: 1 ACK
Via: SIP/2.0/UDP 192.168.254.1:5060;rport;branch=z9hG4bK-e24265-73d35e16-8c5b039
Max-Forwards: 70
User-Agent: Samsung OfficeServ
Contact: <sip:2580@192.168.254.1:5060>
Content-Length: 0
<------------->
--- (10 headers 0 lines) ---
-- Executing [4820@incoming:2] AddQueueMember("SIP/centr-00000013", "Call_centr") in new stack
[Dec 7 22:47:28] NOTICE[23079]: app_queue.c:4953 aqm_exec: Added interface 'SIP/centr' to queue 'Call_centr'
-- Executing [4820@incoming:3] Playback("SIP/centr-00000013", "agent-loginok") in new stack
-- <SIP/centr-00000013> Playing 'agent-loginok.alaw' (language 'ru')
-- Executing [4820@incoming:4] Hangup("SIP/centr-00000013", "") in new stack
== Spawn extension (incoming, 4820, 4) exited non-zero on 'SIP/centr-00000013'
Scheduling destruction of SIP dialog '58659b0-c0a86401-13c4-50022-e24265-1073267d-e24265' in 32000 ms (Method: ACK)
set_destination: Parsing <sip:2580@192.168.254.1:5060> for address/port to send to
set_destination: set destination to 192.168.254.1, port 5060
Reliably Transmitting (NAT) to 192.168.254.1:5060:
BYE sip:2580@192.168.254.1:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.254.2:5060;branch=z9hG4bK55e1c7f5;rport
Max-Forwards: 70
From: <sip:4820@192.168.254.2:5060;user=phone>;tag=as328d9bf9
To: "2580"<sip:2580@192.168.254.1:5060;user=phone>;tag=5874898-c0a86401-13c4-50022-e24265-36e15eeb-e24265
Call-ID: 58659b0-c0a86401-13c4-50022-e24265-1073267d-e24265
CSeq: 102 BYE
User-Agent: Asterisk PBX 1.6.2.18.1
X-Asterisk-HangupCause: Normal Clearing
X-Asterisk-HangupCauseCode: 16
Content-Length: 0
---
<--- SIP read from UDP:192.168.254.1:5060 --->
SIP/2.0 200 OK
From: <sip:4820@192.168.254.2:5060;user=phone>;tag=as328d9bf9
To: "2580"<sip:2580@192.168.254.1:5060;user=phone>;tag=5874898-c0a86401-13c4-50022-e24265-36e15eeb-e24265
Call-ID: 58659b0-c0a86401-13c4-50022-e24265-1073267d-e24265
CSeq: 102 BYE
Via: SIP/2.0/UDP 192.168.254.2:5060;rport=5060;branch=z9hG4bK55e1c7f5
Supported: replaces
User-Agent: Samsung OfficeServ
Content-Length: 0
<------------->
--- (9 headers 0 lines) ---
SIP Response message for INCOMING dialog BYE arrived
Really destroying SIP dialog '58659b0-c0a86401-13c4-50022-e24265-1073267d-e24265' Method: ACK
Код: Выделить всё
localhost*CLI> queue show Call_centr
Call_centr has 0 calls (max unlimited) in 'rrmemory' strategy (0s holdtime, 0s talktime), W:0, C:0, A:5, SL:0.0% within 0s
Members:
SIP/centr (dynamic) (Not in use) has taken no calls yet
No Callers
Если прописываю статически в файле queues.conf member = SIP/centr/2580 то все пучком все работает , звонок из очереди уходит на 2580.
Короче как заставить регистрироваться вот в таком формате SIP/centr/2580 ?
Может средствами диалплана выдергивать callerid и посовывать его как то ?