Iskratel vs Asterisk
Состыковка Астериска с ИскраТел проходит довольно занятно.
Провайдер телефонной связи может отдавать телефонные звонки по SIP, но сервер сигнализации и голосовые сервера находятся в разных местах.
По умолчанию Астер считает, что источник RTP находится на одном хосте с Сервером сигнализации, чтоб сказать ему о поиске голоса на тех хостах которые приходят в INVITE, а также в SDP, в настройках sip.conf необходимо добавить такие строки
canreinvite=yes dtmfmode=info |
When SIP initiates the call, the INVITE message contains the information on where to send the media streams. Asterisk uses itself as the end-points of media streams when setting up the call. Once the call has been accepted, Asterisk sends another (re)INVITE message to the clients with the information necessary to have the two clients send the media streams directly to each other.
А также опцией permit разрешить посылать голос на хосты отличные от сигнального.
В итоге лог должен содержать что-то типа такого:
INVITE sip:<AsterIP>SIP/2.0 Accept: application/sdp Allow: INVITE,ACK,CANCEL,BYE,INFO,PRACK,UPDATE,OPTIONS,REGISTER,REFER,SUBSCRIBE Call-ID: 41992e6ynw26s0jd4@10.0.2.1 Contact: "2223344" <sip:0442223344@<IskraSIP-IP>:5060;user=phone;cpc=ordinary> CSeq: 13 INVITE Expires: 3600 From: "2223344" <sip:0442223344@<IskraSIP-IP>:5060;user=phone;cpc=ordinary>;tag=2x09yuor83 To: "3334455" <sip:3334455@<IskraSIP-IP>:5060;user=phone>;tag=as19c442a2 Organization: IskraTel Via:SIP/2.0/UDP <IskraSIP-IP>:5060;branch=z9hG4bK-6mlfc-a720b Max-Forwards: 70 Subject: Call from CS6111 Content-Length: 161 Content-Type: application/sdp Content-Disposition: session;handling=required v=0 o=xxxxx yyyyy IN IP4 10.0.2.1 s=- c=IN IP4 <IskraRTP-IP> b=AS:64 t=0 0 m=audio 16474 RTP/AVP 8 a=rtpmap:8 PCMA/8000 a=ptime:20 a=sendrecv <-------------> logger.c: --- (16 headers 10 lines) --- logger.c: Sending to <IskraSIP-IP> : 5060 (no AT) logger.c: Found RTP audio format 8 logger.c: Peer audio RTP is at port <IskraRTP-IP>:16474 logger.c: Found audio description format PCMA for ID 8 logger.c: Capabilities: us - 0x10e (gsm|ulaw|alaw|g729), peer - audio=0x8 (alaw)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0x8 (alaw) logger.c: Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x0 (nothing), combined - 0x0 (nothing) logger.c: Peer audio RTP is at port <IskraRTP-IP>:16474 |
где:
– IskraSIP-IP – адрес SIP сервера
– IskraRTP-IP – адрес голосового сервера
– AsterIP – адрес сервера с Астериском
RFC для понимания SDP (Session Description Protocol)
http://www.faqs.org/rfcs/rfc4317.html
http://www.faqs.org/rfcs/rfc2327.html
http://www.faqs.org/rfcs/rfc3264.html
вырезка о том, что значат поля в логах
Session description v= (protocol version) o= (owner/creator and session identifier). s= (session name) i=* (session information) u=* (URI of description) e=* (email address) p=* (phone number) c=* (connection information - not required if included in all media) b=* (bandwidth information) One or more time descriptions (see below) z=* (time zone adjustments) k=* (encryption key) a=* (zero or more session attribute lines) Zero or more media descriptions (see below) Time description t= (time the session is active) r=* (zero or more repeat times) Media description m= (media name and transport address) i=* (media title) c=* (connection information - optional if included at session-level) b=* (bandwidth information) k=* (encryption key) a=* (zero or more media attribute lines) Optional items are marked with a `*'. |