[Asterisk-Users] Looking for very basic example

trixter aka Bret McDanel trixter at 0xdecafbad.com
Thu Jun 1 02:39:49 MST 2006


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.com 
This 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.com 
You 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 at 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


More information about the asterisk-users mailing list