AF
Asterisk Forum
обсуждения телефонии, VoIP и IP-PBX
12разделов
5 423тем
34 385сообщений
← К списку тем

Oktell за натом

Asterisk IP PBX 9 сообщений -
#1

Oktell за натом


Oktell - простейший sip-gsm шлюз, предназначенный для gsm модемов
поставил, настроил на астере, и клиент и октел работают за натом, сам астер с белым ip. настроки пира
[1300]
type=friend
insecure=invite,port
host=dynamic
canreinvite=no
context=context
qualify=yes
call-limit=1
username=1300
secret=pwd
nat=yes
host=dynamic
dtmfmode=rfc2833
disallow=all
allow=ulaw

на пире тоже самое, nat=yes

однако как только проходит звонок и открывается rtp сессия, у меня почему то астериск валит RTP пакеты на локальный ip 192.168.0.45 (где стоит октрел), и никак я не могу заставить отправлять пакеты правильно на внешний ip.
где забыл в пире что дописать, что б понятно было что пир за натом.?
directmedia=no так же ставил, не помогает.
#2

Если на сетевом уровне asterisk видит Oktell без ната, то без доп настроек(см. route -v) пакеты будут ходить напрямую.
#3

окител за натом


Астер висит на VPS, имеет белый ip. Окител висит у меня на комьютере, с которого работаю (внутри локалки, имеет офисный IP), порты не проброшены. инициализация вызова идет, но когда поднимаю трубку, астериск кидает RTP пакеты не на мой офисный внешний IP а на 192,168,0,45 (внутренний ip окитела) и tcpdump показывает тоже самое (отправка в интернет РТП пакетов на хост 192,168,0,45) . Тут на лицо проблема настроек пира для окитела, но что поделать еще я не знаю.
#4

Дамп будет к месту.
#5

ну держитесь


178.142.125.8 - мой офинсый ip, где стоит xlite and Oktell
192.168.0.45 - локальный ip компьютера на котором стоит xlite and oktell
46.32.142.148 - астериск с белым IP порт сип 5487
74957531616 - телефон куда звоню
102 - номер xlite с которого звоню
1300 - пир Otkell с gsm модемом




INVITE sip:74957531616@46.32.142.148:5487 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.45:65164;branch=z9hG4bK-d8754z-2e0c844a710b0546-1---d8754z-;rport
Max-Forwards: 70
Contact:
To: "74957531616"
From: "my_aster";tag=ae271e4f
Call-ID: YmJjOTJkZTU3OTRhZmM4NTI2ZTYwMzZmZWU4MTEwMmI.
CSeq: 2 INVITE
Session-Expires: 95
Min-SE: 90
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO
Content-Type: application/sdp
Supported: timer
User-Agent: eyeBeam release 1102u stamp 52345
Authorization: Digest username="102",realm="asterisk",nonce="753dbf02",uri="sip:74957531616@46.32.142.148:5487",response="7172d799b0675e2f2680da9bfc1219a9",algorithm=MD5
Content-Length: 239

v=0
o=- 8 2 IN IP4 192.168.0.45
s=CounterPath eyeBeam 1.5
c=IN IP4 192.168.0.45
t=0 0
m=audio 65030 RTP/AVP 0 8 101
a=alt:1 1 : WaTfJCHQ u1PgD7Nr 192.168.0.45 65030
a=fmtp:101 0-15
a=rtpmap:101 telephone-event/8000
a=sendrecv

--- (16 headers 10 lines) ---
Sending to 178.142.125.8:33807 (NAT)
Using INVITE request as basis request - YmJjOTJkZTU3OTRhZmM4NTI2ZTYwMzZmZWU4MTEwMmI.
Found peer '102' for '102' from 178.142.125.8:33807
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
Found RTP audio format 0
Found RTP audio format 8
Found RTP audio format 101
Found audio description format telephone-event for ID 101
Capabilities: us - (ulaw|alaw), peer - audio=(ulaw|alaw)/video=(nothing)/text=(nothing), combined - (ulaw|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.0.45:65030 - вот тут мне кажеться трабла
Looking for 74957531616 in context (domain 46.32.142.148)
list_route: hop:


SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.0.45:65164;branch=z9hG4bK-d8754z-2e0c844a710b0546-1---d8754z-;received=178.142.125.8;rport=33807
From: "my_aster";tag=ae271e4f
To: "74957531616"
Call-ID: YmJjOTJkZTU3OTRhZmM4NTI2ZTYwMzZmZWU4MTEwMmI.
CSeq: 2 INVITE
Server: Planet
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Session-Expires: 95;refresher=uas
Contact:
Content-Length: 0




-- Executing [74957531616@context:1] NoOp("SIP/102-00000006", "Start") in new stack
-- Executing [74957531616@context:2] Dial("SIP/102-00000006", "SIP/74957531616@1300") in new stack
== Using SIP RTP TOS bits 184
== Using SIP RTP CoS mark 5
Audio is at 18864
Adding codec 100003 (ulaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 178.142.125.8:26494:
INVITE sip:74957531616@178.142.125.8 SIP/2.0
Via: SIP/2.0/UDP 46.32.142.148:5487;branch=z9hG4bK24f33886;rport
Max-Forwards: 70
From: "my_aster" ;tag=as2f2bc02f
To:
Contact:
Call-ID: 5444820e0fcceb0c5ce4b6437f55c5a2@46.32.142.148:5487
CSeq: 102 INVITE
User-Agent: Planet
Date: Tue, 10 Jun 2014 10:47:39 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 231

v=0
o=root 373706042 373706042 IN IP4 46.32.142.148
s=Asterisk PBX 11.6.0
c=IN IP4 46.32.142.148
t=0 0
m=audio 18864 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv

---
-- Called SIP/74957531616@1300
Retransmitting #1 (NAT) to 178.142.125.8:26494:
INVITE sip:74957531616@178.142.125.8 SIP/2.0
Via: SIP/2.0/UDP 46.32.142.148:5487;branch=z9hG4bK24f33886;rport
Max-Forwards: 70
From: "my_aster" ;tag=as2f2bc02f
To:
Contact:
Call-ID: 5444820e0fcceb0c5ce4b6437f55c5a2@46.32.142.148:5487
CSeq: 102 INVITE
User-Agent: Planet
Date: Tue, 10 Jun 2014 10:47:39 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 231

v=0
o=root 373706042 373706042 IN IP4 46.32.142.148
s=Asterisk PBX 11.6.0
c=IN IP4 46.32.142.148
t=0 0
m=audio 18864 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv

---


SIP/2.0 100 Trying
Via: SIP/2.0/UDP 46.32.142.148:5487;branch=z9hG4bK24f33886;rport=5544;received=46.32.142.148
From: "my_aster" ;tag=as2f2bc02f
To:
CSeq: 102 INVITE
Call-ID: 5444820e0fcceb0c5ce4b6437f55c5a2@46.32.142.148:5487
Content-Length: 0


--- (7 headers 0 lines) ---


SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP 46.32.142.148:5487;branch=z9hG4bK24f33886;rport=5544;received=46.32.142.148
From: "my_aster" ;tag=as2f2bc02f
To: ;tag=af6cb100-643a0000-4c4d8e04
CSeq: 102 INVITE
Call-ID: 5444820e0fcceb0c5ce4b6437f55c5a2@46.32.142.148:5487
Server: Oktell
Content-Type: application/sdp
Content-Length: 207

v=0
o=- 10286060 10286060 IN IP4 192.168.0.45
s=oktell v2
c=IN IP4 192.168.0.45
t=0 0
a=sendrecv
m=audio 9006 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15

--- (9 headers 10 lines) ---
list_route: no route
Found RTP audio format 0
Found RTP audio format 101
Found audio description format PCMU for ID 0
Found audio description format telephone-event for ID 101
Capabilities: us - (ulaw), peer - audio=(ulaw)/video=(nothing)/text=(nothing), combined - (ulaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 192.168.0.45:9006
-- SIP/1300-00000007 is making progress passing it to SIP/102-00000006
Audio is at 17586
Adding codec 100003 (ulaw) to SDP
Adding codec 100004 (alaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP


SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP 192.168.0.45:65164;branch=z9hG4bK-d8754z-2e0c844a710b0546-1---d8754z-;received=178.142.125.8;rport=33807
From: "my_aster";tag=ae271e4f
To: "74957531616";tag=as2ea10980
Call-ID: YmJjOTJkZTU3OTRhZmM4NTI2ZTYwMzZmZWU4MTEwMmI.
CSeq: 2 INVITE
Server: Planet
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Session-Expires: 95;refresher=uas
Contact:
Content-Type: application/sdp
Require: timer
Content-Length: 257

v=0
o=root 1469981949 1469981949 IN IP4 46.32.142.148
s=Asterisk PBX 11.6.0
c=IN IP4 46.32.142.148
t=0 0
m=audio 17586 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv


> 0x7f6e880da1b0 -- Probation passed - setting RTP source address to 178.142.125.8:50463
> 0x7f6e880da1b0 -- Probation passed - setting RTP source address to 178.142.125.8:50463


SIP/2.0 200 OK
Via: SIP/2.0/UDP 46.32.142.148:5487;branch=z9hG4bK24f33886;rport=5544;received=46.32.142.148
From: "my_aster" ;tag=as2f2bc02f
To: ;tag=af6cb100-643a0000-4c4d8e04
CSeq: 102 INVITE
Call-ID: 5444820e0fcceb0c5ce4b6437f55c5a2@46.32.142.148:5487
Contact:
Server: Oktell
Content-Type: application/sdp
Content-Length: 207

v=0
o=- 10294609 10294609 IN IP4 192.168.0.45
s=oktell v2
c=IN IP4 192.168.0.45
t=0 0
a=sendrecv
m=audio 9006 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15

--- (10 headers 10 lines) ---
Found RTP audio format 0
Found RTP audio format 101
Found audio description format PCMU for ID 0
Found audio description format telephone-event for ID 101
Capabilities: us - (ulaw), peer - audio=(ulaw)/video=(nothing)/text=(nothing), combined - (ulaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 192.168.0.45:9006
list_route: hop:
set_destination: Parsing for address/port to send to
set_destination: set destination to 192.168.0.45:5066
Transmitting (NAT) to 178.142.125.8:26494:
ACK sip:102@192.168.0.45:5066 SIP/2.0
Via: SIP/2.0/UDP 46.32.142.148:5487;branch=z9hG4bK6299e04f;rport
Max-Forwards: 70
From: "my_aster" ;tag=as2f2bc02f
To: ;tag=af6cb100-643a0000-4c4d8e04
Contact:
Call-ID: 5444820e0fcceb0c5ce4b6437f55c5a2@46.32.142.148:5487
CSeq: 102 ACK
User-Agent: Planet
Content-Length: 0


---
-- SIP/1300-00000007 answered SIP/102-00000006
Audio is at 17586
Adding codec 100003 (ulaw) to SDP
Adding codec 100004 (alaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP


SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.0.45:65164;branch=z9hG4bK-d8754z-2e0c844a710b0546-1---d8754z-;received=178.142.125.8;rport=33807
From: "my_aster";tag=ae271e4f
To: "74957531616";tag=as2ea10980
Call-ID: YmJjOTJkZTU3OTRhZmM4NTI2ZTYwMzZmZWU4MTEwMmI.
CSeq: 2 INVITE
Server: Planet
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Session-Expires: 95;refresher=uas
Contact:
Content-Type: application/sdp
Require: timer
Content-Length: 257

v=0
o=root 1469981949 1469981950 IN IP4 46.32.142.148
s=Asterisk PBX 11.6.0
c=IN IP4 46.32.142.148
t=0 0
m=audio 17586 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv


-- Locally bridging SIP/102-00000006 and SIP/1300-00000007
Retransmitting #1 (NAT) to 178.142.125.8:33807:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.0.45:65164;branch=z9hG4bK-d8754z-2e0c844a710b0546-1---d8754z-;received=178.142.125.8;rport=33807
From: "my_aster";tag=ae271e4f
To: "74957531616";tag=as2ea10980
Call-ID: YmJjOTJkZTU3OTRhZmM4NTI2ZTYwMzZmZWU4MTEwMmI.
CSeq: 2 INVITE
Server: Planet
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Session-Expires: 95;refresher=uas
Contact:
Content-Type: application/sdp
Require: timer
Content-Length: 257

v=0
o=root 1469981949 1469981950 IN IP4 46.32.142.148
s=Asterisk PBX 11.6.0
c=IN IP4 46.32.142.148
t=0 0
m=audio 17586 RTP/AVP 0 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv

---


ACK sip:74957531616@46.32.142.148:5487 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.45:65164;branch=z9hG4bK-d8754z-973b4a644b3cb30f-1---d8754z-;rport
Max-Forwards: 70
Contact:
To: "74957531616";tag=as2ea10980
From: "my_aster";tag=ae271e4f
Call-ID: YmJjOTJkZTU3OTRhZmM4NTI2ZTYwMzZmZWU4MTEwMmI.
CSeq: 2 ACK
User-Agent: eyeBeam release 1102u stamp 52345
Authorization: Digest username="102",realm="asterisk",nonce="753dbf02",uri="sip:74957531616@46.32.142.148:5487",response="7172d799b0675e2f2680da9bfc1219a9",algorithm=MD5
Content-Length: 0


--- (11 headers 0 lines) ---


ACK sip:74957531616@46.32.142.148:5487 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.45:65164;branch=z9hG4bK-d8754z-973b4a644b3cb30f-1---d8754z-;rport
Max-Forwards: 70
Contact:
To: "74957531616";tag=as2ea10980
From: "my_aster";tag=ae271e4f
Call-ID: YmJjOTJkZTU3OTRhZmM4NTI2ZTYwMzZmZWU4MTEwMmI.
CSeq: 2 ACK
User-Agent: eyeBeam release 1102u stamp 52345
Authorization: Digest username="102",realm="asterisk",nonce="753dbf02",uri="sip:74957531616@46.32.142.148:5487",response="7172d799b0675e2f2680da9bfc1219a9",algorithm=MD5
Content-Length: 0


--- (11 headers 0 lines) ---




и RTP дебаг отображает:

ent RTP P2P packet to 192.168.0.45:9006 (type 00, len 000160)
Sent RTP P2P packet to 192.168.0.45:9006 (type 00, len 000160)
Sent RTP P2P packet to 192.168.0.45:9006 (type 00, len 000160)
Sent RTP P2P packet to 192.168.0.45:9006 (type 00, len 000160)
Sent RTP P2P packet to 192.168.0.45:9006 (type 00, len 000160)
Sent RTP P2P packet to 192.168.0.45:9006 (type 00, len 000160)
Sent RTP P2P packet to 192.168.0.45:9006 (type 00, len 000160)
Sent RTP P2P packet to 192.168.0.45:9006 (type 00, len 000160)
#6

В настройках oktell можно указать stun?
#7

cr80, вы ведь не первый год уже тут, что за ботва с портянками в форуме? делайте как положено, уважайте комьюнти.
#8

не совсем понял


не владею терминалогией "портянки" - вы имеете ввиду вывод дебага?
#9

Цитата:
-- Called SIP/74957531616@1300
Retransmitting #1 (NAT) to 178.142.125.8:26494:


Что там с настройками externip и localnet в [general]?

directmedia=no - ДОЛЖНО стоять, а не "пробовал".

_________________
http://mh.otx.ru Гибкие SIP/E1 шлюзы Alvis. SIP-Модернизация LDK/TDA:VoIP, Добавь E1 к Asterisk.
UPDATE! Теперь и T.38! Скидки для форумчан!!