Страница 1 из 2

Asterisk - SPA 122 - FXO (wrong password)

Добавлено: 01 сен 2015, 23:44
rdiamond
Добрый вечер,

уперся в регистрацию Циски на Астериске

SPA -10.90.90.33
Asterisk - 10.90.90.3:5262

Изображение
users.conf
[mgts]
;auth = md5
deny = 0.0.0.0/0
permit = 10.90.90.0/255.255.255.0
context = mgts
type = peer
insecure = port, invite
defaultuser = 102
;fromuser = 102
username = 102
secret = 1234
disallow = all
allow = ulaw
host = 10.90.90.33
qualify = yes
callcounter = yes
;nat=no
dtmf=info


peer доступен
mgts/102 10.90.90.33 Auto (No) No A 5060 OK (51 ms)
регистрация на asterisk

<--- SIP read from UDP:10.90.90.33:5060 --->
REGISTER sip:10.90.90.3:5262 SIP/2.0
Via: SIP/2.0/UDP 10.90.90.33:5060;branch=z9hG4bK-db0c8767
From: "102" <sip:102@10.90.90.3>;tag=5846a71e86328d99o0
To: "102" <sip:102@10.90.90.3>
Call-ID: 3835d0b9-434a7e39@10.90.90.33
CSeq: 44777 REGISTER
Max-Forwards: 70
Authorization: Digest username="102",realm="asterisk",nonce="6efe8b18",uri="sip:10.90.90.3:5262",algorithm=MD5,response="76c975670b3392bfdaa596be41fe4a02"
Contact: "102" <sip:102@10.90.90.33:5060>;expires=3600
User-Agent: Cisco/SPA122-1.4.0(001)
P-Station-Name: ;mac=00e16db7f1c0; display=""; sn=CCQ182803GG
Content-Length: 0
Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER
Supported: replaces

<------------->
--- (14 headers 0 lines) ---
Sending to 10.90.90.33:5060 (no NAT)

<--- Transmitting (no NAT) to 10.90.90.33:5060 --->
SIP/2.0 403 Forbidden
Via: SIP/2.0/UDP 10.90.90.33:5060;branch=z9hG4bK-db0c8767;received=10.90.90.33
From: "102" <sip:102@10.90.90.3>;tag=5846a71e86328d99o0
To: "102" <sip:102@10.90.90.3>;tag=as59e1dec0
Call-ID: 3835d0b9-434a7e39@10.90.90.33
CSeq: 44777 REGISTER
Server: Ruslan Konin
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


<------------>
[Sep 1 23:41:38] NOTICE[18817]: chan_sip.c:27774 handle_request_register: Registration from '"102" <sip:102@10.90.90.3>' failed for '10.90.90.33:5060' - Wrong password

Re: Asterisk - SPA 122 - FXO (wrong password)

Добавлено: 02 сен 2015, 07:06
Vlad1983
пир перенести из users.conf в sip.conf
поправить

Код: Выделить всё

[mgts]
...
type = friend
...
;insecure = port, invite
;defaultuser = 102
...
host = dynamic
...

Re: Asterisk - SPA 122 - FXO (wrong password)

Добавлено: 02 сен 2015, 08:09
rdiamond
С friend пробовал.
С файлом users.conf у меня без проблем взлетает регистрация сипнет

Re: Asterisk - SPA 122 - FXO (wrong password)

Добавлено: 02 сен 2015, 08:35
Vlad1983
на сипнет регаетесь вы, а не он на вас

Re: Asterisk - SPA 122 - FXO (wrong password)

Добавлено: 02 сен 2015, 15:06
rdiamond
для чистоты эксперимента сбросил SPA в дефаулт.
настройки только display name = 102, user id=102, password = 123

Конфиг:
[mgts]
;auth = md5
deny = 0.0.0.0/0
permit = 10.90.90.0/255.255.255.0
context = mgts
type = friend
;insecure = port, invite
;defaultuser = 102
;fromuser = 102
username = 102
secret = 123
disallow = all
allow = ulaw
host = dynamic
;host = 10.90.90.33
qualify = yes
callcounter = yes
;nat=no
dtmf=rfc2833

Ошибка та же:
sip set debug peer mgts
Unable to get IP address of peer 'mgts'

<--- SIP read from UDP:10.90.90.33:5060 --->
REGISTER sip:10.90.90.3:5262 SIP/2.0
Via: SIP/2.0/UDP 10.90.90.33:5060;branch=z9hG4bK-4ca0a390
From: "102" <sip:102@10.90.90.3>;tag=759c93c038bbd2co0
To: "102" <sip:102@10.90.90.3>
Call-ID: ad6f273a-25e8b249@10.90.90.33
CSeq: 35463 REGISTER
Max-Forwards: 70
Contact: "102" <sip:102@10.90.90.33:5060>;expires=3600
User-Agent: Cisco/SPA122-1.4.0(001)
P-Station-Name: ;mac=00e16db7f1c0; display=""; sn=CCQ182803GG
Content-Length: 0
Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER
Supported: replaces

<------------->
--- (13 headers 0 lines) ---
Sending to 10.90.90.33:5060 (no NAT)
Sending to 10.90.90.33:5060 (no NAT)

<--- Transmitting (no NAT) to 10.90.90.33:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 10.90.90.33:5060;branch=z9hG4bK-4ca0a390;received=10.90.90.33
From: "102" <sip:102@10.90.90.3>;tag=759c93c038bbd2co0
To: "102" <sip:102@10.90.90.3>;tag=as7c682862
Call-ID: ad6f273a-25e8b249@10.90.90.33
CSeq: 35463 REGISTER
Server: Ruslan Konin
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="6fb9b86f"
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog 'ad6f273a-25e8b249@10.90.90.33' in 32000 ms (Method: REGISTER)

<--- SIP read from UDP:10.90.90.33:5060 --->
REGISTER sip:10.90.90.3:5262 SIP/2.0
Via: SIP/2.0/UDP 10.90.90.33:5060;branch=z9hG4bK-e72762d8
From: "102" <sip:102@10.90.90.3>;tag=759c93c038bbd2co0
To: "102" <sip:102@10.90.90.3>
Call-ID: ad6f273a-25e8b249@10.90.90.33
CSeq: 35464 REGISTER
Max-Forwards: 70
Authorization: Digest username="102",realm="asterisk",nonce="6fb9b86f",uri="sip:10.90.90.3:5262",algorithm=MD5,response="5f3c318b464fd5f8b5cedffb0e9fe707"
Contact: "102" <sip:102@10.90.90.33:5060>;expires=3600
User-Agent: Cisco/SPA122-1.4.0(001)
P-Station-Name: ;mac=00e16db7f1c0; display=""; sn=CCQ182803GG
Content-Length: 0
Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER
Supported: replaces

<------------->
--- (14 headers 0 lines) ---
Sending to 10.90.90.33:5060 (no NAT)

<--- Transmitting (no NAT) to 10.90.90.33:5060 --->
SIP/2.0 403 Forbidden
Via: SIP/2.0/UDP 10.90.90.33:5060;branch=z9hG4bK-e72762d8;received=10.90.90.33
From: "102" <sip:102@10.90.90.3>;tag=759c93c038bbd2co0
To: "102" <sip:102@10.90.90.3>;tag=as7c682862
Call-ID: ad6f273a-25e8b249@10.90.90.33
CSeq: 35464 REGISTER
Server: Ruslan Konin
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0


<------------>
[Sep 2 15:02:31] NOTICE[18817]: chan_sip.c:27774 handle_request_register: Registration from '"102" <sip:102@10.90.90.3>' failed for '10.90.90.33:5060' - Wrong password
Scheduling destruction of SIP dialog 'ad6f273a-25e8b249@10.90.90.33' in 32000 ms (Method: REGISTER)
Really destroying SIP dialog 'ad6f273a-25e8b249@10.90.90.33' Method: REGISTER

Re: Asterisk - SPA 122 - FXO (wrong password)

Добавлено: 02 сен 2015, 15:48
rdiamond
Кстати хоть пир и доступен, но звонки не проходят
mgts/102 10.90.90.33 Auto (No) No A 5060 OK (48 ms)


console dial 100
[Sep 2 15:47:17] WARNING[27001]: chan_oss.c:508 setformat: Unable to set format to 16-bit signed
[Sep 2 15:47:17] NOTICE[27001]: console_video.c:137 console_video_start: voice only, console video support not present
== Using SIP RTP CoS mark 5
Audio is at 17558
Adding codec ulaw to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (no NAT) to 10.90.90.33:5060:
INVITE sip:89686636480@10.90.90.33 SIP/2.0
Via: SIP/2.0/UDP 10.90.90.3:5262;branch=z9hG4bK2099cb31
Max-Forwards: 70
From: "asterisk" <sip:asterisk@10.90.90.3:5262>;tag=as61618a6c
To: <sip:89686636480@10.90.90.33>
Contact: <sip:asterisk@10.90.90.3:5262>
Call-ID: 737587ca0beea7f82394938e2bba7e85@10.90.90.3:5262
CSeq: 102 INVITE
User-Agent: Ruslan Konin
Date: Wed, 02 Sep 2015 12:47:17 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 235

v=0
o=root 1104080025 1104080025 IN IP4 10.90.90.3
s=Asterisk PBX 13.1.0
c=IN IP4 10.90.90.3
t=0 0
m=audio 17558 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:150
a=sendrecv

---

<--- SIP read from UDP:10.90.90.33:5060 --->
SIP/2.0 404 Not Found
To: <sip:89686636480@10.90.90.33>;tag=a15e0582e8da21efi0
From: "asterisk" <sip:asterisk@10.90.90.3:5262>;tag=as61618a6c
Call-ID: 737587ca0beea7f82394938e2bba7e85@10.90.90.3:5262
CSeq: 102 INVITE
Via: SIP/2.0/UDP 10.90.90.3:5262;branch=z9hG4bK2099cb31
Server: Cisco/SPA122-1.4.0(001)
Content-Length: 0

<------------->
--- (8 headers 0 lines) ---
Transmitting (no NAT) to 10.90.90.33:5060:
ACK sip:89686636480@10.90.90.33 SIP/2.0
Via: SIP/2.0/UDP 10.90.90.3:5262;branch=z9hG4bK2099cb31
Max-Forwards: 70
From: "asterisk" <sip:asterisk@10.90.90.3:5262>;tag=as61618a6c
To: <sip:89686636480@10.90.90.33>;tag=a15e0582e8da21efi0
Contact: <sip:asterisk@10.90.90.3:5262>
Call-ID: 737587ca0beea7f82394938e2bba7e85@10.90.90.3:5262
CSeq: 102 ACK
User-Agent: Ruslan Konin
Content-Length: 0


---
Scheduling destruction of SIP dialog '737587ca0beea7f82394938e2bba7e85@10.90.90.3:5262' in 6400 ms (Method: INVITE)
== Everyone is busy/congested at this time (1:0/0/1)
Really destroying SIP dialog '737587ca0beea7f82394938e2bba7e85@10.90.90.3:5262' Method: INVITE
<< Hangup on console >>


диалплан
exten => 100,1,Dial(SIP/mgts/89686636480)

Re: Asterisk - SPA 122 - FXO (wrong password)

Добавлено: 02 сен 2015, 15:49
awsswa
Верхную часть пропустите - все настройки от туда для пользователя 301

http://awsswa.livejournal.com/15751.html

Re: Asterisk - SPA 122 - FXO (wrong password)

Добавлено: 02 сен 2015, 16:20
rdiamond
вообщем то мой конфиг сильно не отличался, но поменял
[mgts]
;auth = md5
deny = 0.0.0.0/0
permit = 10.90.90.0/255.255.255.0
context = mgts
type = friend
insecure = port,invite
;defaultuser = 102
;fromuser = 102
username = 102
secret = 1234
disallow = all
allow = ulaw
host = dynamic
;host = 10.90.90.33
qualify = yes
directmedia=no
call-limit = 2
;callcounter = yes
nat=no
dtmf=rfc2833


результат тот же

Re: Asterisk - SPA 122 - FXO (wrong password)

Добавлено: 02 сен 2015, 18:26
rdiamond
заработало
[102]
;auth = md5
deny = 0.0.0.0/0
permit = 10.90.90.0/255.255.255.0
context = mgts
type = friend
insecure = port,invite
username = 102
secret = cisco
disallow = all
allow = ulaw
host = dynamic
qualify = yes
directmedia=no
call-limit = 2
nat=no
canreinvite = no
dtmf=rfc2833

Re: Asterisk - SPA 122 - FXO (wrong password)

Добавлено: 02 сен 2015, 19:27
rdiamond
Теперь проблема со звонками извне и наружу.
Звонки из города не проходят - тишина и сброс.
Звонки из вне не идут.

= Using SIP RTP CoS mark 5
Audio is at 12472
Adding codec ulaw to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (no NAT) to 10.90.90.33:5060:
INVITE sip:8495342XXXX@10.90.90.33 SIP/2.0
Via: SIP/2.0/UDP 10.90.90.3:5262;branch=z9hG4bK7f251b4d
Max-Forwards: 70
From: "asterisk" <sip:asterisk@10.90.90.3:5262>;tag=as4679f08f
To: <sip:8495342XXXX@10.90.90.33>
Contact: <sip:asterisk@10.90.90.3:5262>
Call-ID: 274767bc6ceb3ad54fa3e3e966b30c4f@10.90.90.3:5262
CSeq: 102 INVITE
User-Agent: Ruslan Konin
Date: Wed, 02 Sep 2015 16:24:46 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 235

v=0
o=root 1228451849 1228451849 IN IP4 10.90.90.3
s=Asterisk PBX 13.1.0
c=IN IP4 10.90.90.3
t=0 0
m=audio 12472 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=maxptime:150
a=sendrecv

---

<--- SIP read from UDP:10.90.90.33:5060 --->
SIP/2.0 404 Not Found
To: <sip:8495342XXXX@10.90.90.33>;tag=9369016fb22f193ci0
From: "asterisk" <sip:asterisk@10.90.90.3:5262>;tag=as4679f08f
Call-ID: 274767bc6ceb3ad54fa3e3e966b30c4f@10.90.90.3:5262
CSeq: 102 INVITE
Via: SIP/2.0/UDP 10.90.90.3:5262;branch=z9hG4bK7f251b4d
Server: Cisco/SPA122-1.3.5(004p_XU001)
Content-Length: 0

<------------->
--- (8 headers 0 lines) ---
Transmitting (no NAT) to 10.90.90.33:5060:
ACK sip:8495342XXXX@10.90.90.33 SIP/2.0
Via: SIP/2.0/UDP 10.90.90.3:5262;branch=z9hG4bK7f251b4d
Max-Forwards: 70
From: "asterisk" <sip:asterisk@10.90.90.3:5262>;tag=as4679f08f
To: <sip:8495342XXXX@10.90.90.33>;tag=9369016fb22f193ci0
Contact: <sip:asterisk@10.90.90.3:5262>
Call-ID: 274767bc6ceb3ad54fa3e3e966b30c4f@10.90.90.3:5262
CSeq: 102 ACK
User-Agent: Ruslan Konin
Content-Length: 0


---
Scheduling destruction of SIP dialog '274767bc6ceb3ad54fa3e3e966b30c4f@10.90.90.3:5262' in 6400 ms (Method: INVITE)
== Everyone is busy/congested at this time (1:0/0/1)
== Spawn extension (default, 8495342XXXX, 2) exited non-zero on 'Console/dsp'
<< Hangup on console >>

extension.conf
[mgts]
exten => _[7,8]49[5,8,9]XXXXXXX,1,Dial(SIP/102/${EXTEN})
exten => _[7,8]49[5,8,9]XXXXXXX,n,Hangup()