Transcoding

От: Alexander Lapshin <CGatePro_at_mx_ru>
Дата: Tue 29 Apr 2014 - 16:46:45 MSK


Решил попробовать транскодирование в CGP и столкнулся с вопросами...   Использовал в качестве стенда:
Клиент:

    EyeBeam, ip: 10.0.0.7, кодек: G729 (only) Софт-свитч:

    Communigate 6.0.9, ip: 10.0.0.1, кодеки G711 (only) , медиа порты: 48000-48999 Транскодер:

    Communigate 6.0.9 IPP, ip: 10.0.0.3, Кодеки G711, G729 , медиа порты: 47000-47999 Астериск:

    Asterisk 1.8.21.0, ip: 10.0.0.193, кодеки все доступные  

На Софт-Свитче прописал Транскодер (10.0.0.3) в качестве внешнего медиа сервера. На Астериске Софт-Свитч прописан как транк (pbx-gw).  

Эксперимент ?1



На Софт-Свитче прописываем Астериск как шлюз PSTN Используем проксирование. Домен Шлюза: *domain.dom
Адрес Шлюза: 10.0.0.193

Звоним с клиента (test1) на Asterisk номер 333 Всё в порядке. Звонок проходит. Вот что видит Астериск:

---
<------------->
[Apr 29 14:49:07] VERBOSE[28021] chan_sip.c: --- (9 headers 0 lines) --- [Apr 29 14:49:07] VERBOSE[28021] chan_sip.c:
<--- SIP read from UDP:10.0.0.1:5060 ---> INVITE sip:333@domain.dom SIP/2.0
Via: SIP/2.0/UDP 10.0.0.1:5060;branch=z9hG4bK7768;rport
P-Asserted-Identity: <sip:test1@domain.dom>
Record-Route: <sip:10.0.0.1:5060;lr>
Record-Route: <sip:rev.4412.dialog.cgatepro;lr>
Max-Forwards: 68
From: <sip:test1@domain.dom>;tag=55B01B2A-10438-458EE097
To: <sip:333@domain.dom>
Call-ID: ZGIyOWI0YTEyODljNmMyN2QzNjk4NzhmM2FlMzJlNjk..gwout5949
Contact: <sip:signode-10438-458EE097@10.0.0.1>
CSeq: 2 INVITE
Supported: 100rel,timer,replaces,histinfo,precondition
Session-Expires: 300
Min-SE: 90
User-Agent: CommuniGatePro-callLeg/6.0.9
Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,INFO,MESSAGE,SUBSCRIBE,NOTIFY,PRACK,UPDATE,REFER
Authorization: Digest username=.............
Content-Type: application/sdp
Content-Length: 395

v=0
o=CGPLeg010438 2337585044 1168792523 IN IP4 10.0.0.1 s=CounterPath eyeBeam 1.5 c=IN IP4 10.0.0.1 t=0 0
a=mediagateway:mail.domain.dom:4412
m=audio 48002 RTP/AVP 18 101
c=IN IP4 10.0.0.1
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=yes
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
a=rtcpping:T:1652:82678
a=ice-pwd:9FC7E66AE13173F93745E2CA
a=ice-ufrag:pt0001652
<------------->
Apr 29 14:49:07] VERBOSE[28021] chan_sip.c: --- (19 headers 16 lines) --- [Apr 29 14:49:07] VERBOSE[28021] chan_sip.c: Sending to 10.0.0.1:5060 (NAT) [Apr 29 14:49:07] VERBOSE[28021] chan_sip.c: Using INVITE request as basis request - ZGIyOWI0YTEyODljNmMyN2QzNjk4NzhmM2FlMzJlNjk..gwout5949
[Apr 29 14:49:07] VERBOSE[28021] chan_sip.c: Found peer 'pbx-gw' for 'alex' from 10.0.0.1:5060 [Apr 29 14:49:07] VERBOSE[28021] netsock2.c: == Using SIP VIDEO TOS bits 136 [Apr 29 14:49:07] VERBOSE[28021] netsock2.c: == Using SIP VIDEO CoS mark 6 [Apr 29 14:49:07] VERBOSE[28021] netsock2.c: == Using SIP RTP TOS bits 184 [Apr 29 14:49:07] VERBOSE[28021] netsock2.c: == Using SIP RTP CoS mark 5 [Apr 29 14:49:07] VERBOSE[28021] netsock.c: == Using UDPTL TOS bits 184 [Apr 29 14:49:07] VERBOSE[28021] netsock.c: == Using UDPTL CoS mark 5 [Apr 29 14:49:07] VERBOSE[28021] chan_sip.c: Found RTP audio format 18 [Apr 29 14:49:07] VERBOSE[28021] chan_sip.c: Found RTP audio format 101 [Apr 29 14:49:07] VERBOSE[28021] chan_sip.c: Found audio description format G729 for ID 18 [Apr 29 14:49:07] VERBOSE[28021] chan_sip.c: Found audio description format telephone-event for ID 101 [Apr 29 14:49:07] VERBOSE[28021] chan_sip.c: Capabilities: us - 0x80030c7fffff (g723|gsm|ulaw|alaw|g726|adpcm|slin|lpc10|g729|speex|speex16|ilbc|g726aal2|g722|slin16|jpeg|png|h261|h263|h263p|h264|mpeg4|red|t140|siren7|siren14|testlaw|g719), peer - audio=0x100 (g729)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0x100 (g729) [Apr 29 14:49:07] VERBOSE[28021] chan_sip.c: Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|) [Apr 29 14:49:07] VERBOSE[28021] chan_sip.c: Peer audio RTP is at port 10.0.0.1:48002 [Apr 29 14:49:07] VERBOSE[28021] chan_sip.c: Peer doesn't provide video [Apr 29 14:49:07] VERBOSE[28021] chan_sip.c: Looking for 333 in from-internal (domain domain.dom) [Apr 29 14:49:07] VERBOSE[28021] chan_sip.c: list_route: hop: <sip:10.0.0.1:5060;lr> [Apr 29 14:49:07] VERBOSE[28021] chan_sip.c: list_route: hop: <sip:rev.4412.dialog.cgatepro;lr>
---





Эксперимент ?2
---------------
На Софт-Свитче прописываем Астериск как шлюз PSTN Используем миксер, для того, что-бы задействовать транскодирование.
Домен Шлюза: #domain.dom	  	
Адрес Шлюза: 10.0.0.193

Звоним с клиента (test1) на Asterisk номер 333 Звонок не проходит.

Вот что вилим на Софт-свиче:
---
14:58:32.362 2 SIGNAL-067030 SIPS-050498: INVITE sip:333@domain.dom
14:58:32.362 2 SIGNAL-067030 401 generated
14:58:32.362 2 SIGNAL-067030 401 relaying
14:58:32.362 2 SIGNAL-067030 releasing
14:58:32.362 2 SIGNAL-067032 SIPS-050500: INVITE sip:333@domain.dom
14:58:32.362 2 DIALOG-004413 created(authOut)
14:58:32.362 2 SIGNAL-067032 INVITE sip:333@domain.dom via sip:333@domain.dom
14:58:32.362 2 PBXLEG-010442 'gatewaycaller' created for pbx@domain.dom
14:58:32.362 2 SIGNAL-067032 {1} sent to NODE-010442: INVITE sip:333@domain.dom
14:58:32.362 2 DIALOG-004414 created as DIALOG-004413 copy(copy)
14:58:32.362 2 PBXLEG-010442 DIALOG-004414(inp) started with test1@domain.dom(sip:test1@10.0.0.7:34254;transport=udp)(canTransfer)
14:58:32.362 2 PBXLEG-010442 session refresh=95(passive)
14:58:32.362 2 PBXLEG-010442 peer authenticated as 'test1@domain.dom'
14:58:32.362 2 PBXLEG-010442 gatewaycaller.sppr(Main) started
14:58:32.362 2 PBXLEG-010442 ProgramLog: "calling '333'..."
14:58:32.362 2 PBXLEG-010442 ProgramLog: "caller SDP media protocol: RTP/AVP"
14:58:32.362 2 PBXLEG-010442 ProgramLog: "Price: #NULL#"
14:58:32.377 2 PBXLEG-010442 ProgramLog: "callerLeg:{\"\"=\"sip:333@domain.dom\";Call-ID=MWZiMTZiOWJkZDYxYTBiODgzZDBkN2UyNWI5MmViYTY..gwout5537;From=\"sip:test1@domain.dom\";Max-Forwards=#69;P-Billing-Id=\"\";Via=10.0.0.193;activeSide=YES;allowedAudioCodecs=(\"PCMU/8000\",\"PCMA/8000\",\"PCMU/8000/1\",\"PCMA/8000/1\",\"G729/8000\",\"telephone-event/8000\");allowedVideoCodecs=();authPassword=********;authUsername=********;encryptMedia=NO;impersonate=test1@domain.dom;provisionDTMF=YES;us
14:58:32.377 2 PBXLEG-010442 spawning PBXLEG-010444
14:58:32.377 2 PBXLEG-010444 spawned by PBXLEG-010442
14:58:32.377 2 PBXLEG-010444 callerleg.sppi(bridgeCaller) started
14:58:32.377 2 PBXLEG-010444 impersonated as 'test1@domain.dom'(test1@domain.dom)
14:58:32.377 2 MEDIA-000901 processor started
14:58:32.377 2 MEDIA-000901 audio set:[10.0.0.3]:47000:47001 encrypted SDP(101=DTMF 0=PCMU/8000,8=PCMA/8000,101=telephone-event/8000)sendrecv <-> (PCMU/8000)sendrecv rtcpping=M:669:966874871
14:58:32.377 2 MEDIA-000901 transcoder [10.0.0.3]-669 attached
14:58:32.377 2 MEDIA-000901 created(444447CB) for PBXLEG-010444, audio port [0.0.0.0]:48000
14:58:32.377 2 PBXLEG-010444 calling sip:333@domain.dom
14:58:32.377 2 SIGNAL-067034 NODE-010444: INVITE sip:333@domain.dom
14:58:32.377 2 DIALOG-004415 created(authOut)
14:58:32.377 2 SIGNAL-067034 INVITE sip:333@domain.dom via sip:10.0.0.193.relay.cgatepro;lr
14:58:32.377 2 SIGNAL-067034 relaying sip:333@domain.dom via special 10.0.0.193.relay.cgatepro
14:58:32.377 2 SIGNAL-067034 {1} sent to SIPC-007778: INVITE sip:333@domain.dom
14:58:32.377 2 DIALOG-004416 created as DIALOG-004415 copy(copy)
14:58:32.377 2 DIALOG-004416 MEDIAPROXY-000821 created
14:58:32.377 2 SIGNAL-067034 401 received from SIPC-007778
14:58:32.377 2 SIGNAL-067034 DIALOG-004415 updating on negative 401-response
14:58:32.377 2 DIALOG-004416 dequeued(kill)
14:58:32.377 2 DIALOG-004416 MEDIAPROXY-000821 removing
14:58:32.377 2 SIGNAL-067034 401 relaying
14:58:32.377 2 SIGNAL-067034 releasing
14:58:32.377 2 DIALOG-004415 released
14:58:32.377 2 SIGNAL-067036 NODE-010444: INVITE sip:333@domain.dom
14:58:32.377 2 DIALOG-004417 created(authOut)
14:58:32.377 2 SIGNAL-067036 INVITE sip:333@domain.dom via sip:10.0.0.193.relay.cgatepro;lr
14:58:32.377 2 SIGNAL-067036 relaying sip:333@domain.dom via special 10.0.0.193.relay.cgatepro
14:58:32.377 2 SIGNAL-067036 {1} sent to SIPC-007780: INVITE sip:333@domain.dom
14:58:32.377 2 DIALOG-004418 created as DIALOG-004417 copy(copy)
14:58:32.377 2 DIALOG-004418 MEDIAPROXY-000822 created
14:58:32.377 2 SIGNAL-067036 488 received from SIPC-007780
14:58:32.377 2 SIGNAL-067036 DIALOG-004417 updating on negative 488-response
14:58:32.377 2 DIALOG-004418 dequeued(kill)
14:58:32.377 2 DIALOG-004418 MEDIAPROXY-000822 removing
14:58:32.377 2 ACCOUNT(test1@domain.dom) out call failed(333@domain.dom). Error Code=Not acceptable here
14:58:32.377 2 SIGNAL-067036 488 relaying
14:58:32.377 2 SIGNAL-067036 releasing
14:58:32.377 4 MEDIA-000901 closing
14:58:32.502 2 MEDIA-000901 processor finished
14:58:32.596 2 DIALOG-004416 released
14:58:32.611 2 DIALOG-004418 released
14:58:32.814 2 MEDIA-000901 released. 0(0) <-> 0(0)
14:58:32.814 2 MEDIA-000901 channel released
14:58:32.814 2 PBXLEG-010444 Event([asyncCallFinal]) retrieved
14:58:32.814 2 PBXLEG-010444 ProgramLog: "call failed: 488-Not acceptable here"
14:58:32.814 2 PBXLEG-010444 program stopped
14:58:32.814 2 PBXLEG-010444 releasing
14:58:32.814 2 PBXLEG-010442 Event(error) from NODE-010444 retrieved
14:58:32.814 2 PBXLEG-010442 ProgramLog: "call failed: errorCode=488-Not acceptable here"
14:58:32.814 2 PBXLEG-010442 DIALOG-004414 killing
14:58:32.814 2 DIALOG-004414 dequeued(kill)
14:58:32.814 2 SIGNAL-067032 488 received from NODE-010442
14:58:32.814 2 DIALOG-004414 released
14:58:32.814 2 SIGNAL-067032 DIALOG-004413 updating on negative 488-response
14:58:32.814 2 PBXLEG-010442 rejecting done
14:58:32.814 2 PBXLEG-010442 program stopped
14:58:32.814 2 PBXLEG-010442 releasing
14:58:32.814 2 ACCOUNT(test1@domain.dom) out call failed(333@domain.dom). Error Code=Not acceptable here
14:58:32.814 2 ACCOUNT(pbx@domain.dom) inp call failed(test1@domain.dom). Error Code=Not acceptable here 14:58:32.830 2 SIGNAL-067032 488 relaying 14:58:32.830 2 SIGNAL-067032 releasing
---

В логах Транскодера:
---
14:58:32.363 2 MEDIA-000669 created(4444497D), audio port [0.0.0.0]:47000
14:58:32.363 2 MEDIA-000669 audio set:[10.0.0.1]:48000:48001 encrypted SDP(101=DTMF 0=PCMU/8000,8=PCMA/8000,101=telephone-event/8000)sendrecv <-> (PCMU/8000)sendrecv rtcpping=M:901:1224913594
14:58:32.363 2 MEDIA-000669-01 peer(4444497E) added(transcoder)
14:58:32.363 2 MEDIA-000669 local SDP generated
14:58:32.363 2 MEDIA-000669 processor started
14:58:32.363 2 MEDIA-000669-01 local SDP generated
14:58:32.598 4 MEDIA-000669 closing
14:58:32.707 2 MEDIA-000669 processor finished
14:58:32.816 2 MEDIA-000669-01 released. 0(0) <-> 0(0)
14:58:32.816 2 MEDIA-000669 released. 0(0) <-> 0(0)
14:58:32.816 2 MEDIA-000669 channel released
---

А вот что приходит на Астериск:
---
<------------->
[Apr 29 15:03:04] VERBOSE[28021] chan_sip.c: --- (9 headers 0 lines) --- [Apr 29 15:03:04] VERBOSE[28021] chan_sip.c:
<--- SIP read from UDP:10.0.0.1:5060 ---> INVITE sip:333@domain.dom SIP/2.0
Via: SIP/2.0/UDP 10.0.0.1:5060;branch=z9hG4bK7784;rport
P-Asserted-Identity: <sip:test1@domain.dom>
Record-Route: <sip:10.0.0.1:5060;lr>
Record-Route: <sip:rev.4426.dialog.cgatepro;lr>
Max-Forwards: 68
From: <sip:test1@domain.dom>;tag=D03A3301-10452-458EE097
To: <sip:333@domain.dom>
Call-ID: ODNjM2ZkNzBhYTdjMDc2MDU0MGVmZWZkNzM4NTI4OTA..gwout2584
Contact: <sip:signode-10452-458EE097@10.0.0.1>
CSeq: 2 INVITE
Supported: 100rel,timer,replaces,histinfo,precondition
Session-Expires: 300
Min-SE: 90
User-Agent: CommuniGatePro-callLeg/6.0.9
Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,INFO,MESSAGE,SUBSCRIBE,NOTIFY,PRACK,UPDATE,REFER
Authorization: Digest username=.......
Content-Type: application/sdp
Content-Length: 732

v=0
o=CGPLeg010452 1250553017 625276509 IN IP4 10.0.0.1
s=-
c=IN IP4 10.0.0.1
t=0 0
a=mediagateway:mail.domain.dom:4426
a=msid-semantic:WMS cgp
m=audio 48004 RTP/AVP 0 8 18 101
c=IN IP4 10.0.0.1
a=crypto:1 AES_CM_128_HMAC_SHA1_32 inline:SP+iacKn+sd8bHKmrOfd2gEgf9RK1xfZnOcNJ7nv
a=crypto:2 AES_CM_128_HMAC_SHA1_80 inline:d9SY9jh0xVPpU5dQrnsSEW6QMy8ZuEoggFtW4gxg
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16,32-49,64-89
a=sendrecv
a=rtcpping:T:1660:83078
a=ssrc:1145325954 cname:cgp5325954
a=ssrc:1145325954 label:cgxa0
a=ssrc:1145325954 msid:cgx a0
a=ssrc:1145325954 mslabel:cgx
a=ice-pwd:80B1197646806B8681EFC63A
a=ice-ufrag:pt0001660
<------------->
[Apr 29 15:03:04] VERBOSE[28021] chan_sip.c: --- (19 headers 24 lines) --- [Apr 29 15:03:04] VERBOSE[28021] chan_sip.c: Sending to 10.0.0.1:5060 (NAT) [Apr 29 15:03:04] VERBOSE[28021] chan_sip.c: Using INVITE request as basis request - ODNjM2ZkNzBhYTdjMDc2MDU0MGVmZWZkNzM4NTI4OTA..gwout2584
[Apr 29 15:03:04] VERBOSE[28021] chan_sip.c: Found peer 'pbx-gw' for 'test1' from 10.0.0.1:5060 [Apr 29 15:03:04] VERBOSE[28021] netsock2.c: == Using SIP VIDEO TOS bits 136 [Apr 29 15:03:04] VERBOSE[28021] netsock2.c: == Using SIP VIDEO CoS mark 6 [Apr 29 15:03:04] VERBOSE[28021] netsock2.c: == Using SIP RTP TOS bits 184 [Apr 29 15:03:04] VERBOSE[28021] netsock2.c: == Using SIP RTP CoS mark 5 [Apr 29 15:03:04] VERBOSE[28021] netsock.c: == Using UDPTL TOS bits 184 [Apr 29 15:03:04] VERBOSE[28021] netsock.c: == Using UDPTL CoS mark 5 [Apr 29 15:03:04] VERBOSE[28021] chan_sip.c: Found RTP audio format 0 [Apr 29 15:03:04] VERBOSE[28021] chan_sip.c: Found RTP audio format 8 [Apr 29 15:03:04] VERBOSE[28021] chan_sip.c: Found RTP audio format 18 [Apr 29 15:03:04] VERBOSE[28021] chan_sip.c: Found RTP audio format 101 [Apr 29 15:03:04] DEBUG[28021] sip/sdp_crypto.c: Accepting crypto tag 1 [Apr 29 15:03:04] DEBUG[28021] sip/sdp_crypto.c: Crypto line: a=crypto:1 AES_CM_128_HMAC_SHA1_32 inline:8o5ZvUnCqPR3zz1aaeJEm9IDNe9uY+8CSVQi5fhn
[Apr 29 15:03:04] VERBOSE[28021] chan_sip.c: Found audio description format PCMU for ID 0 [Apr 29 15:03:04] VERBOSE[28021] chan_sip.c: Found audio description format PCMA for ID 8 [Apr 29 15:03:04] VERBOSE[28021] chan_sip.c: Found audio description format G729 for ID 18 [Apr 29 15:03:04] VERBOSE[28021] chan_sip.c: Found audio description format telephone-event for ID 101 [Apr 29 15:03:04] WARNING[28021] chan_sip.c: We are requesting SRTP for audio, but they responded without it!
[Apr 29 15:03:04] VERBOSE[28021] chan_sip.c:
<--- Reliably Transmitting (NAT) to 10.0.0.1:5060 ---> SIP/2.0 488 Not acceptable here
Via: SIP/2.0/UDP 10.0.0.1:5060;branch=z9hG4bK7784;received=10.0.0.1;rport=5060
From: <sip:test1@domain.dom>;tag=D03A3301-10452-458EE097
To: <sip:333@domain.dom>;tag=as3c8f8b54
Call-ID: ODNjM2ZkNzBhYTdjMDc2MDU0MGVmZWZkNzM4NTI4OTA..gwout2584
CSeq: 2 INVITE
Server: FPBX-2.8.1(1.8.21.0)
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0


<------------>
[Apr 29 15:03:04] VERBOSE[28021] chan_sip.c: Scheduling destruction of SIP dialog 'ODNjM2ZkNzBhYTdjMDc2MDU0MGVmZWZkNzM4NTI4OTA..gwout2584' in 6400 ms (Method: INVITE) [Apr 29 15:03:04] VERBOSE[28021] chan_sip.c: 
---


Почему в при испольовании транскодирования предлагается SRTP, а используется RTP ?

Подскажите пожалуйста где поправить? В CGP? В Астериске? Руки.sys?
Может есть подробный мануал, как правильно применять транскодирование? (встроенный читал)

И ещё подскажите пожалуйста. При транскодировании. После установки соединения медиа-поток между клиентами идёт через транскодер?
Т.е.
Клиент1 <--> Транскодер <--> Клиент2

Либо транскодер работает через Софт-свитч? Т.е. медиа-поток проходит только через Софт-свитч (и взаимодействие с транскодером остается "невидимым" для клиента)?

Клиент1  <--> | Софт-Свитч | <--> Клиент2
              |  |    |    |
              | Транскодер |


Наверное слишком запутанно вопросы задаю...

---
(c)ALex 
Получено Tue Apr 29 12:46:01 2014

Этот архив был сгенерирован hypermail 2.1.8 : Tue 29 Apr 2014 - 20:17:45 MSK