Hi! Im looking for a very basic example for the following simple problem. I've been searching voip-info.org and looked in the ORA book without a clue. I have a SIP account at sip.provider.com and my own asterisk server. What I want is the following: I. Register my phone to my asterisk server, not directly to provider.com II. My asterisk server should ring my phone when somebody calls me on <mynumber>@provider.com III. Asterisk forwards my outgoing calls to provider.com I found a lot of sample snippets but none of them really works. The two main problems are: A. When somebody calls me, he get's a "user unavailable" from provider.com, but my asterisk server successfully registered at provider.com: (sip.conf) register => <user>:<pwd>@sip.provider.com/<user> B. When I call a number, my asterisk server says: " Failed to authenticate on INVITE". But all login informations for provider.com are correct. (sip.conf) [<user>] type=friend secret=<pwd> username=<user> fromuser=<user> canreinvite=yes (extensions.conf) exten => 0041321112233,1,Dial(SIP/${EXT...<http://groups.google.ch/groups/unlock?msg=c9756294de75b896&hl=de&_done=/group/Asterisk-users/browse_thread/thread/de1e6e8328c2a255/c9756294de75b896%3Fhl%3Dde> @sip.provider.com,60,r) Thanks for any help! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20060601/26dd0e08/attachment.htm
trixter aka Bret McDanel
2006-Jun-01 02:39 UTC
[Asterisk-Users] Looking for very basic example
On Thu, 2006-06-01 at 11:18 +0200, Benjamin Stocker wrote: At least you know to break this down into different parts, it still amazes me how many people look at something as one big thing instead of several smaller things that interrelate :) you should have example config files that came with asterisk, if you built from source you have to do 'make samples' to get them installed, most binary packages will do this automagically.> > I. Register my phone to my asterisk server, not directly to > provider.comThis has 2 parts, one set your phone to use your asterisk server. Without any knowedge of your phone I cant say how to do this. The other part is create an account within asterisk for that. In sip.conf you can create sip users (examples at the end of the default file), in iax.conf you can create iax2 users, and so on.> II. My asterisk server should ring my phone when somebody calls me > on <mynumber>@provider.comYou normally have to do 2 things to make your asterisk box register and work with your provider. One is to add a register directive, ie register => user:pass@provider/extension the /extension is optional, if specified it will cause calls from your provider to goto that extension, if omitted generally they goto 's'. There are examples in at least sip.conf for this but probably iax.conf as well. Again it depends on the protocol that your provider uses. The other part is to create a account for your provider. This is similar to what you would have to do with your phone. The context declaration here will be used for inbound calls. As for making it dial your phone, when a call comes in from your provider. Lets say that the user account created for your provider had context=incoming and the /extension on the register line was 123, you could do in extensions.conf: [incoming] exten => 123,1,dial(SIP/25) There are examples of this in extensions.conf.> III. Asterisk forwards my outgoing calls to provider.com >The context that you set your phone into controls what it can call. If it has a entry like: exten => _1NXXNXXXXXX,1,dial(SIP/myprovider/${EXTEN},90) then anything matching that pattern (north american numbering pattern and possibly other places too) will get sent via sip to your provider. There are examples of this in the extensions.conf sample file as well.> > A. When somebody calls me, he get's a "user unavailable" from > provider.com, but my asterisk server successfully registered at > provider.com: > > > (sip.conf) > register => <user>:<pwd>@sip.provider.com/<user> >does a sip show peers show that you are registered? Does the extension at the end of the register line exist?> > B. When I call a number, my asterisk server says: " Failed to > authenticate on INVITE". But all login informations for provider.com > are correct. >Which leg is failing to auth? The leg from your phone to your asterisk box or asterisk to your provider? you only showed one entry in sip.conf, and if you think about it from your asterisk box's perspective you have 2 people sending and receiving calls. your phone and your provider. Think of them more or less as equals and the rest might make sense. -- Trixter http://www.0xdecafbad.com Bret McDanel Belfast IE +44 28 9099 6461 DE +49 801 777 555 3402 Utrecht NL +31 306 553058 US WA +1 360 207 0479 US NY +1 516 687 5200 FreeWorldDialup: 635378 http://www.sacaug.org/ Sacramento Asterisk Users Group -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20060601/dbb59ae0/attachment.pgp
On Jun 1, 2006, at 2:18 AM, Benjamin Stocker wrote:> Hi! > > Im looking for a very basic example for the following simple problem. > I've been searching voip-info.org and looked in the ORA book without a > clue. I have a SIP account at sip.provider.com and my own asterisk > server. What I want is the following: > > ? I. Register my phone to my asterisk server, not directly to > provider.com > ? II. My asterisk server should ring my phone when somebody calls me > on <mynumber>@provider.com > ? III. Asterisk forwards my outgoing calls to provider.com > > I found a lot of sample snippets but none of them really works. The two > main problems are: > > A. When somebody calls me, he get's a "user unavailable" from > provider.com, but my asterisk server successfully registered at > provider.com: > > ? (sip.conf) > ? register => <user>:<pwd>@ sip.provider.com/<user> > > B. When I call a number, my asterisk server says: " Failed to > authenticate on INVITE". But all login informations for provider.com > are correct. > > ? (sip.conf) > ? [<user>] > ? type=friend > ? secret=<pwd> > ? username=<user> > ? fromuser=<user> > ? canreinvite=yes > > ? (extensions.conf ) > ? exten => 0041321112233,1,Dial(SIP/${EXT ...@sip.provider.com,60,r)Make sure to allow the code you want to use in the general section of sip.conf or iax.conf as the case may be (sip.conf in your case). Also, your provider should help you configure this... Since they want it work so you can spend some money. Marty