rapid7 / warvox

http://www.warvox.org/
205 stars 56 forks source link

IAX2 registration refused w/Asterisk 13 #49

Open ersilver345 opened 8 years ago

ersilver345 commented 8 years ago

I've recently been trying to get WarVOX (built from source a month ago) working with Asterisk (the latest version 13). Asterisk calling worked from the CLI, so I decided to make an IAX2 account for WarVOX so I could use it:

; WarVOX user [warvox] type=user context=default auth=md5 secret=voippass accountcode=warvox language=en

However, when I tried to wardial, Asterisk complained that the client didn't support call tokens. I tried adding "requirecalltoken=no" under the user, but Asterisk still gave the same error. Finally, I resolved it by adding "calltokenoptional=0.0.0.0/0.0.0.0" to the global IAX2 configuration.

After that, Asterisk no longer gave any errors, but WarVOX still failed to complete the call. By enabling IAX2 debugging, I was able to see what was going on:

Rx-Frame Retry[ No] -- OSeqno: 000 ISeqno: 000 Type: IAX Subclass: REGREQ Timestamp: 00000ms SCall: 00001 DCall: 00000 127.0.0.1:44117 USERNAME : warvox REFRESH : 60

Tx-Frame Retry[000] -- OSeqno: 000 ISeqno: 001 Type: IAX Subclass: REGAUTH Timestamp: 00017ms SCall: 07805 DCall: 00001 127.0.0.1:44117 AUTHMETHODS : 3 CHALLENGE : \x31\x30\x37\x36\x32\x37\x30\x34\x30 USERNAME : warvox

Rx-Frame Retry[ No] -- OSeqno: 001 ISeqno: 001 Type: IAX Subclass: REGREQ Timestamp: 00001ms SCall: 00001 DCall: 07805 127.0.0.1:44117 USERNAME : warvox MD5 RESULT : 97f31f2993eb28485756569c4f6d25c5 REFRESH : 60

Tx-Frame Retry[-01] -- OSeqno: 001 ISeqno: 002 Type: IAX Subclass: ACK Timestamp: 00001ms SCall: 07805 DCall: 00001 127.0.0.1:44117 Tx-Frame Retry[000] -- OSeqno: 001 ISeqno: 002 Type: IAX Subclass: REGREJ Timestamp: 00019ms SCall: 07805 DCall: 00001 127.0.0.1:44117 CAUSE : Registration Refused CAUSE CODE : 29

WarVOX requests a registration, Asterisk gives it a challenge, WarVOX responds, and Asterisk rejects the registration. The MD5 sent is the hash of the password appended to the challenge, which I believe is correct. Since WarVOX appears to be doing IAX2 properly, it's quite possible that there's an issue on Asterisk's end, not WarVOX's. But I'm still reporting the issue here in case it is something with WarVOX.

hdm commented 8 years ago

Thanks for the issue! I'll try to repro the next time I have cycles for it.

ersilver345 commented 8 years ago

I also wanted to add something else that might be helpful. Back when I first experienced the "registration refused" error, I searched around and found issue #36, the lack of CallToken support. You fixed this by modifying the dial() function, and that apparently worked when you tested it. But for me, WarVOX is failing in register(), before it even connects to the IAX2 server to dial anything. So maybe the most recent Asterisk version changed the protocol more, and there's a different way to do the initial registration?

tit0n commented 5 years ago

Running into the same issue. What this ever resolved ?

tit0n commented 5 years ago

Ok, figured it out... it should be type=friend and not type=user. iax.conf should look like this :

; WarVOX user
[warvox]
type=friend
context=default
auth=md5
secret=voippass
hdm commented 5 years ago

This project is no longer maintained, feel free to fork it though!