Configuring extensions.conf and sip.conf

Hi to everyone!
I’m trying to set up asterisk to make inbound and outbound calls, without good results…
Here’s my sip.conf

[code][40]
type = friend
host = dynamic
port = 5060
context = out
secret = password
nat = yes
canreinvite = no
dtmfmode = rfc2833
mailbox = 40
deny = 0.0.0.0/0.0.0.0
permit = 192.168.1.0/255.255.255.0

[41]
type = friend
host = dynamic
port = 5060
context = out
secret = password
nat = yes
canreinvite = no
dtmfmode = rfc2833
mailbox = 41
deny = 0.0.0.0/0.0.0.0
permit = 192.168.1.0/255.255.255.0[/code]
and here my extensions.conf

[code]
[general]
static = yes
writeprotect = no
autofallthrough = no

[default]
; Segreteria Telefonica
exten => 777,1,VoiceMailMain(${EXTEN@default})
exten => 777,2,Hangup()

; Definizione interni
exten => 40,1,Macro(intcall,40);
exten => 41,1,Macro(intcall,41);

[from-pstn]

exten=> s,1,Answer()
exten=> s,2,Dial(SIP/${ARG1})

[macro-intcall]
exten => s,1,Dial(SIP/${ARG1},30)
exten => s,2,VoiceMail(${ARG1})
exten => s,3,Hangup() [/code]

*Note that there isn’t an outbound rule, because i’m setting up the inbound rules; if you now how to setu up it help me :wink: *

Can you help me with this issues?
I’m new with asterisk!
Can you post the right code? I would like only to make and receive calls…

Thank you so much!
Ale

You have no devices in a context for which extensions are defined in extensions.conf.

autofallthrough=no has been a very unusual setting since autofallthrough was introduced.

In addition:

type=friend is usually a bad idea.

Are the phones really inside NAT and the PABX outside?

No phones and server are in the same network…
I corrected those errors but it doesn’t work!
Can you post me an example of a sip.conf file and an extensions.conf file?
I think that the error is in the extensions…

Thank you

Ale

Samples come with the source distribution.

it seems default is the context used for internal calls, so change the context in your sip peers from out to default

I tried to change it, but it didn’t work!

i also looked on the web and also on the example in extensions.conf but i can’t do it…
Is there something like a log to see if the fxo module is properly configurated and it receive calls?

Thanks

Asterisk has extensive logging capabilities. Look at the result of

help core set debug
and
help core set verbose

Also look at the file logger.conf

Individual channel technologies also have CLI commands to enable protocol logging.

wiki.asterisk.org/wiki/display/ … nformation