You are here

Setting asterisk to do direct IP phone calls

5 posts / 0 new
Last post
KF6RTA
KF6RTA's picture
Setting asterisk to do direct IP phone calls

I'm working with a few guys here in Pasadena (10 miles east of Los Angeles) with some help from the OC Mesh folks.  I have asterisk running on a Raspberry Pi 3 and can dial my own VOIP/IP phones, so it seems to be working right.  Although our group would share an asterisk server, I'd like to define some "extensions" that would dial an IP number directly (so the receiving end would not have to register with our asterisk server, and the calling end can avoid keying in a long IP number).   Can anyone point me to an example of how to set up sip.conf and extensions.conf to achieve this?   It seems like it should be straight-forward, but I have not figured it out yet.

Also, pointers to example Asterisk configuration files for mesh networking would be very helpful!

Thanks!

 -Jonathan

P.S. Thanks to Joe AE6XE and Don KE6BXT for their help getting us started with mesh networking!

 

KG6JEI
This is pretty well
This is pretty well documented in some of the common Asterisk resources.

DIAL(SIP/[exten@]peer[:portno])

See:
http://www.voip-info.org/wiki/view/Asterisk+SIP+channels
N2MH
N2MH's picture
A little more detail
To elaborate on Conrad's advice, what you want to do is pretty simple and only involves editing the extensions.conf file. No changes have to be made to sip.conf. Let's make a couple of assumptions about what you want to do..

1. The sip phone is at 10.1.2.3
2. You want to give this phone the extension of 5678
3. Your existing extensions are in the [my-extensions] context

Here's what the configuration would look like:

extensions.conf file
[my-extensions]
... existing extensions
exten => 5678,1,Dial(SIP/10.1.2.3,30)

The 30 parameter is pretty important. If you leave it out, asterisk will barf. If you set it too short, the phone will ring only for the amount of seconds that you specify. You need to give people time enough to answer the phone. In this case, it will be 30 seconds.

Now, for some assumptions on the part of the phone.

1. The phone must be configured to allow incoming unauthenticated calls.
2. The phone can only receive calls from asterisk. It can not originate calls into asterisk.

With a little imagination, one can make this into a "Dial by Callsign" feature. Your callsign is KF6RTA. This corresponds to the number sequence 536782 on a telephone dial. If you substituted 536782 for 5678 in the example above, people could call you by dialling KF6RTA. They would not have to remember your exact extension number. Of course, when doing this, one must keep track of all extensions that are used on the pbx to make sure there is no overlap or duplication.

Taking this one step further, this trick can also be use to make a rudimentary directory for use at an event. For example, PD (police department) becomes extension 73, FD (fire department) becomes 33, ARC (American Red Cross) becomes extension 272, EMS becomes extension 367, etc. What's nice about this approach is that it doesn't need to be published anywhere or uploaded to any phones. And, it is usable by any phone on that pbx, not just those who had the list uploaded.

Note for FreePBX users

These same techniques will work for FreePBX except that you must edit the extensions_custom.conf file. This is because the FreePBX gui overwrites extension.conf. extensions_custom.conf does not get overwritten by the gui. Of course, extensions_custom.conf will have to be edited by hand at a linux shell prompt using your favorite text editor.

Regarding your question about networking asterisk pbx's, that is a little more involved and is more than configuring one or two lines in a config file. If you are interested in doing that kind of thing, contact me off-line @ arrl dot net and I'll be happy to help you.

Mark, N2MH


 
KF6RTA
KF6RTA's picture
Thanks Mark and Conrad,

Thanks Mark and Conrad,

I looked through the docs and missed that.  Thanks for the pointers.

I just tried setting this up.  I have two IP phones on my mesh net.  A Grandstream GXP2200 and a Nortel 1535.   With the extensions defined per your suggestions, I was able to get the direct dialing from the GS to the Nortel working.  However, calling from the Nortel to the GS times out.

Looking at asterisk verbose outputs, I see both getting to the point where I see the message "Called SIP/10.xx.yy.zz".   Calling from the GS to the Nortel continues and the completes the call.  Going the other way stalls after this line (until I hang up the Nortel).

As far as I can tell, the Nortel cannot dial IP numbers directly (from the keypad), but that should not matter since asterisk is doing the dialing.  Calling from the Nortel to the GS (or vice-versa) works fine via regular sip setup and extensions.

Suggestions on what to try next to figure out this issue?

Thanks for your help!

-Jonathan

P.S. Mark, I have not decided what to do about connecting asterisk servers, etc.  I'll get back to you on that once I figure out this basic stuff.  Thanks for the offer.

 

K1baa
I am interested in connecting
I am interested in connecting my asterisk (FreePBX) server with others so I am interested in coordinating this activity with like minded hams in the LA Pasadena area.

73

Bret
K1BAA 

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer