Beginner question - dialplan for only two SIP phones


#1

I’m very new to Asterisk…

I got two SIP phones connected.
Both work fine and get the 1000 demo.
Also 500 demo using IAX call to Digium works.

I can’t find the way to setup my extentions.conf to allow one SIP phone to call the other…

I need a break here guys… help please…

Thanks,


#2

Most extensions.conf files I have seen, include a macro called stdextn.
This macro basically tells asterisk what to do when a call comes on a particular line.
Then you reuse that macro for every extension you’ve got.
For example, this is what my stdextn marco looks like (they all look pretty much the same…so its ok to copy from someone)
[b]
[macro-stdexten]

; Standard extension macro

; ${ARG1} - Voicemail box
; ${ARG2} - Device extension(s) to ring

; Usage
; in main context do exten => 1000,1,Macro(stdexten,1000,1000)

exten => s,1,Dial(${ARG2},20) ; Ring the interface, 20 seconds maximum
exten => s,2,Goto(s-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)

exten => s-BUSY,1,Voicemail(b${ARG1}) ; If busy, send to voicemail w/ busy announce
exten => s-BUSY,2,Goto(default,s,1) ; If they press #, return to start

exten => s-NOANSWER,1,Voicemail(u${ARG1}) ; If unavailable, send to voicemail w/ unavail announce
exten => s-NOANSWER,2,Goto(default,s,1) ; If they press #, return to start

exten => _s-.,1,Goto(s-NOANSWER,1) ; Treat anything else as no answer[/b]

This macro doesn’t do anything by itself, it just defines a set of instructions to be applied, when the macro is used in a context.

In my case, I called the context [standard]
It states, that if a call comes in on extension 111, then call the macro stdexten with 2 parameters. 1) 111 2) SIP/111.
The macro will then execute with the parameters you supply it with

Here it is:

[b][standard]

exten => 111,1,Macro(stdexten,111,SIP/111)
exten => 113,1,Macro(stdexten,113,SIP/113)
exten => 114,1,Macro(stdexten,114,SIP/114) [/b]

Some people I have seen create a separate context for each extension…so a call to each extension follows a different set of steps.
For example if there are 2 roommates etc…I don’t think it would be too practical for a company with 50 users to do it this way. What it the company grows to 150 employees?

Good luck,
Vlad


#3

Thanks Vlad for taking the time !

It works fine now…
I’m starting to learn the magic !

Next is the ISDN card - and into the PSTN network we go…

Thanks…