SearchSearch  Log in to check your private messagesLog in to check your private messages  recent posts Recent Posts
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
tjardickOffline
Site Admin


Joined: Dec 12, 2003
Posts: 949

Status: Offline
Posted: Aug 04, 2004 - 11:40 AM Reply with quote Back to top
Hello everyone,

As there seem to be many questions on how to setup the service on the Asterisk Open Source PBX system, so here i'll show an example setup.

First of all you'll need the hostname of your Asterisk server, in my example i'll use pbx.voipuser.org.

If you haven't requested a number yet, please do so now, if not edit the number that you want to forward in the My Numbers control panel.

I got assigned: 08715046137 which i'll use thru out this example.

First we set the destination in the control panel to IAX2/voipuser:test@pbx.voipuser.org

Where:
voipuser is the username
test is the password/secret
and pbx.voipuser.org is the hostname of the Asterisk PBX


we give it a minute or so to process the changes after we have hit update, which gives us the time to setup the voipuser entry in the iax.conf of asterisk.

[voipuser]
username=voipuser
secret=test
type=user
context=inbound-voipuser

After that there is one thing left to do which is adding the inbound-voipuser extensions to your extensions.conf.

The number will come in, via the international number format so the first 0 is replaced by 44.

[inbound-voipuser]
exten => 448715046137,1,Dial(${TjPHONE}&${DeanPHONE},20)
exten => 448715046137,2,Voicemail2(u12)
exten => 448715046137,3,HangUp

As you can see the call comes in and rings both our phones for 20 seconds and in case of busy/unavailble it will go to voicemail.

I'll leave it to your own creativity to come up with something else.

Regards,

Tjardick
View user's profile Send private message
ichiltonOffline



Joined: Aug 30, 2004
Posts: 514
Location: UK
Status: Offline
Posted: Dec 03, 2004 - 08:55 PM Reply with quote Back to top
Hi,

Got this working great - Thanks!

What codec does it use though?


Thanks!

--ian
View user's profile Send private message
tjardickOffline
Site Admin


Joined: Dec 12, 2003
Posts: 949

Status: Offline
Posted: Dec 08, 2004 - 09:16 AM Reply with quote Back to top
Hi,

Sorry for the late reply but been out of service for a bit because of personal matters.

The IAX2 links support the usual A & Ulaw, GSM and Ilbc.

Regards,

Tj
View user's profile Send private message
ichiltonOffline



Joined: Aug 30, 2004
Posts: 514
Location: UK
Status: Offline
Posted: Jan 26, 2005 - 02:02 PM Reply with quote Back to top
tjardick :
IAX2/voipuser:test@pbx.voipuser.org

[voipuser]
username=voipuser
secret=test
type=user
context=inbound-voipuser


I have found something strange but I have not looked into it properly yet.

If you have IAX2/test1:password@mypbx.domain.com and this:

[test2]
username=test1
secret=password
type=user
context=inbound-voipuser

..it doesn't work - but if you have this:

[test1]
username=test2
secret=password
type=user
context=inbound-voipuser

..it does work.

So, the username doesn't seem to be used. I confirmed this by removing the username line and it still works.

But, I then tried changing the password and it still works - remove it and it still works.

So, it seems there is no authentication been used and you can just use this:

[voipuser]
type=user
context=inbound-voipuser


However, if you look at the IAX2 string syntax on voip-info.org, Tj was right...

IAX/[<user>[:<secret>]@]<peer>[:<portno>][/<exten>[@<context>][/<options>]]


Tj -> Does the IAX termination just dial exactly what you put in the box in "My Numbers"?

--ian


Last edited by ichilton on Jan 26, 2005 - 02:10 PM; edited 1 time in total
View user's profile Send private message
tjardickOffline
Site Admin


Joined: Dec 12, 2003
Posts: 949

Status: Offline
Posted: Jan 26, 2005 - 02:09 PM Reply with quote Back to top
Both entries of test2 look the same to me.

But i assume that you are suggestion that there is no password information send is this correct ?

Just saying that the dailstring is just dailed is basically not how it works, but if you have found anything not working properlt please let me know.

Tj
View user's profile Send private message
ichiltonOffline



Joined: Aug 30, 2004
Posts: 514
Location: UK
Status: Offline
Posted: Jan 26, 2005 - 02:12 PM Reply with quote Back to top
Hi Tj,

Quote:
Both entries of test2 look the same to me.

Oops - sorry, I typo'd.

I've edited my post above so if you re-read it, it should now make sense.

Basically, i'm saying that the username & password stuff doesn't seem to be working but I dont know whether it's your end or ours....

This testing is a result of the help I gave the guys here: http://www.voipuser.org/forum_topic_394.html

Thanks

--ian
View user's profile Send private message
ichiltonOffline



Joined: Aug 30, 2004
Posts: 514
Location: UK
Status: Offline
Posted: Jan 28, 2005 - 08:44 AM Reply with quote Back to top
Hi Tj,

Did you get a chance to look into this?

Thanks

--ian
View user's profile Send private message
andypOffline



Joined: May 31, 2004
Posts: 28
Location: Luton UK
Status: Offline
Posted: Jan 28, 2005 - 01:28 PM Reply with quote Back to top
Ian, TJ,

I've been looking at this too, and it would appear that it does work, but perhaps not as expected.

If the 'secret' line is not present or null, then * accepts the call with a '-- Accepting unauthenticated call from 213.166.5.129, requested format = 8, actual format = 8' message.

If the 'secret' line is set to a password, then it accepts it only if it matches. I've been using 'iax2 show users' before testing just to make sure I have reloaded the config files and am in fact testing against the correct password. This command also answers another point - the username is the name in square brackets, what would be the context name in extensions.conf. I believe 'username' in the iax.conf contexts is for outgoing connections only.

This is just what I've found, I'm using * v1.0.4 on Fedora Core 3, hopefully this will help you a bit.

Regards

Andy
View user's profile Send private message
ichiltonOffline



Joined: Aug 30, 2004
Posts: 514
Location: UK
Status: Offline
Posted: Jan 28, 2005 - 01:33 PM Reply with quote Back to top
Hi,
andyp :
If the 'secret' line is not present or null, then * accepts the call with a '-- Accepting unauthenticated call from 213.166.5.129, requested format = 8, actual format = 8' message.

I wonder if there is a way of disabling unauthenticated call's then..

Quote:
If the 'secret' line is set to a password, then it accepts it only if it matches.

Strange - I didn't find that - the reason I found that removing the secret line still worked was because I changed the password in asterisk and not in the control panel and the call still worked - it was then that I removed it and found it still worked..

What did you get on the console if you change the password and try to call in? - i.e how did it fail?

--ian
View user's profile Send private message
andypOffline



Joined: May 31, 2004
Posts: 28
Location: Luton UK
Status: Offline
Posted: Jan 28, 2005 - 03:15 PM Reply with quote Back to top
Ian,

I should have said in my last post that I had the 'authdebug=yes' line in the [general] section of iax.conf.

With this set, when a call comes in which has the wrong password I get

Code:
Jan 28 15:09:02 NOTICE[6531]: chan_iax2.c:5742 socket_read: Host 213.166.5.129 failed to authenticate as 'username'


where 'username' is the username sent by the VoipUser server.

I assume you double checked your passwords using 'iax2 show users' ?

Andy
View user's profile Send private message
ichiltonOffline



Joined: Aug 30, 2004
Posts: 514
Location: UK
Status: Offline
Posted: Jan 29, 2005 - 04:40 PM Reply with quote Back to top
Hi,

I just tested it all again and I now seem to see the same results as you so I dont know what was going on before.

Without secret:
Code:
-- Accepting unauthenticated call from 213.166.5.129, requested format = 8, actual format = 2


With secret:
Code:
-- Accepting AUTHENTICATED call from 213.166.5.129, requested format = 8, actual format = 2


With secret but wrong password:
Code:
Jan 29 16:25:22 NOTICE[1091972016]: chan_iax2.c:5701 socket_read: Host 213.166.5.129 failed to authenticate as voipuser_inbound


It's still worth noting though that username= is not required (and the tests above are without username).

In the voipuser.org control panel, the IAX2 string actually seems to work as: IAX2/context:password@pbx.domain.com rather than: IAX/user:password@pbx.domain.com

Does your testing agree with mine there??

Thanks

--ian
View user's profile Send private message
andypOffline



Joined: May 31, 2004
Posts: 28
Location: Luton UK
Status: Offline
Posted: Jan 30, 2005 - 04:56 PM Reply with quote Back to top
Ian,

Yes, my results match yours. I've been looking into the documentation and it seems that what we refer to as a context in extensions.conf is in fact the username in iax.conf. It seems that iax.conf contains user sections whereas extensions.conf contains context sections. Have a look at http://www.voip-info.org/wiki-Asterisk+ ... ntication. And it definately doesn't use the 'username=' variable *at all* in the incoming connection from VoipUser to your server.

The only time that the 'username=' variable is used is if the 'type=peer' or 'type=friend' is used, as username is then the username used in authenticating with the remote server for outbound connections - at least that's how understand it !

I think we should be suggesting users setup their machines with something like...
Code:
[voipuser]
type=user
secret=yourpassword
context=voipuser-incoming

and then using an IAX2 string in the control panel of
Code:
IAX2/voipuser:password@pbx.domain.com

this string being pretty much what you said in your last post.

What do you think ?

Andy
View user's profile Send private message
ichiltonOffline



Joined: Aug 30, 2004
Posts: 514
Location: UK
Status: Offline
Posted: Jan 31, 2005 - 09:26 AM Reply with quote Back to top
Hi,

Strange, I didn't get a notification of your post!

What you said sounds good - i'll have a read of the docs and update my guide.

--ian
View user's profile Send private message
zebadee2kOffline



Joined: Sep 11, 2008
Posts: 1

Status: Offline
Posted: Sep 11, 2008 - 02:51 AM Reply with quote Back to top
tjardick :
Hello everyone,

As there seem to be many questions on how to setup the service on the Asterisk Open Source PBX system, so here i'll show an example setup.

First of all you'll need the hostname of your Asterisk server, in my example i'll use pbx.voipuser.org.

If you haven't requested a number yet, please do so now, if not edit the number that you want to forward in the My Numbers control panel.

I got assigned: 08715046137 which i'll use thru out this example.

First we set the destination in the control panel to IAX2/voipuser:test@pbx.voipuser.org

Where:
voipuser is the username
test is the password/secret
and pbx.voipuser.org is the hostname of the Asterisk PBX


we give it a minute or so to process the changes after we have hit update, which gives us the time to setup the voipuser entry in the iax.conf of asterisk.

[voipuser]
username=voipuser
secret=test
type=user
context=inbound-voipuser

After that there is one thing left to do which is adding the inbound-voipuser extensions to your extensions.conf.

The number will come in, via the international number format so the first 0 is replaced by 44.

[inbound-voipuser]
exten => 448715046137,1,Dial(${TjPHONE}&${DeanPHONE},20)
exten => 448715046137,2,Voicemail2(u12)
exten => 448715046137,3,HangUp

As you can see the call comes in and rings both our phones for 20 seconds and in case of busy/unavailble it will go to voicemail.

I'll leave it to your own creativity to come up with something else.

Regards,

Tjardick


CAN ANYONE TELL ME HOW TO SETUP THIS USING THE TRIXBOX INTERFACE? RATHER THAM EDITING CONFIG FILES? Thanks.
View user's profile Send private message
rgowerOffline
Site Admin


Joined: Jan 21, 2005
Posts: 1350
Location: Wales
Status: Offline
Posted: Sep 11, 2008 - 09:16 AM Reply with quote Back to top
Hi
You should find this thread http://www.voipuser.org/forum_topic_4052.html will cover most, if not all your questions
View user's profile Send private message


View previous topic Printable version Log in to check your private messages View next topic

Post new topic   Reply to topic
Forum Rules and Guidelines | About VoIP User | Privacy Policy


All logos and trademarks in this site are property of their respective owner.
Comments and posts are property of the poster, all the rest (c) 2003-2008 VoIP User Limited.

VoIP User Limited is incorporated in England and Wales under Company Number 6694577.

No part of this site may be reproduced without our prior consent.