[App_rpt-users] Example of how to setup a sip phone for reverse autopatch

Stephen - K1LNX k1lnx at k1lnx.net
Tue Feb 2 23:27:48 EST 2010


Thanks Keith for sharing that with us, it will certainly help :)

I'll also add my own experiences to this for others who may be trying to
accomplish what I have as well. I run a seperate Asterisk based PBX for my
home phone system which I have 2 Cisco IP phone's peered off of.

My ultimate goal was to be able to use my existing phone system to get to
the radio and out to the network. I use FreePBX on the PBX box, and just set
up a SIP trunk to point to the app_rpt box. In the outgoing settings area,
you can name the trunk anything you'd like (I named mine app_rpt, original
huh?) and in the peer details box I have this:

host=192.168.1.1
username=k1lnx
secret=password
type=peer

Where host is the IP of the app_rpt machine, username is the username you
will define in sip.conf stanza, secret is the password, and type=peer
defines that we are only sending calls to this machine.

You'll also need to put registration syntax in the Register String box in
the form of username:password at 192.168.1.1/context which was defined in the
previous section. The "context" portion of the string is what your context
name will be on the app_rpt box. For example, mine is k1lnx. You could also
do IP based authentication, which would eliminate the need to register.

Next, add an outbound route with whatever dial pattern you want to match (I
just used 2335, that's my node number, to keep it simple) and use the newly
created app_rpt SIP trunk. I named my route RADIO. This will now send any
calls dialed with "2335" over the app_rpt trunk!

So on the app_rpt box in /etc/asterisk/sip.conf put an entry something
similar to this:

[k1lnx]
type=friend
username=k1lnx
password=password
context=radio-control
host=dynamic
disallow=all
allow=ulaw

And in extensions.conf edit (or add if not existing) the [radio-control]
stanza:
[radio-control]
;exten => 2335,1,Answer
exten => 2335,1,Playback(rpt/node)
exten => 2335,n,Playback(digits/2)
exten => 2335,n,Playback(digits/3)
exten => 2335,n,Playback(digits/3)
exten => 2335,n,Playback(digits/5)
exten => 2335,n,Rpt,2335|P

Notice I have the first priority commented out? This was due to an issue I
was having, the console was spewing error messages about not being able to
use the Answer application. No idea why, could be due to the fact that I
compiled from scratch or screwed something else up somewhere that I haven't
found yet. YMMV ;)

I also had a hard time getting calls from my PBX to hit this context
properly, it took a lot of wrangling and reloading for it to finally work
properly. Whenever I would dial "2335" from my desk phone it would get
rejected on the basis of not being able to find the extension, I am still
largely confused as to why it didn't simply work however. On the stock
extensions.conf that comes with ACID as well as what is in the svn version
at the top of the file there are two parameters in the general section:

[general]

static=yes       ; These two lines prevent the command-line interface
writeprotect=yes ; from overwriting the config file. Leave them here.

I had to play with these via commenting/uncommenting them to get things to
work, although I don't believe this was the source of my problem originally.
Perhaps Steve or Jim can elaborate on this.

After you issue a dialplan reload you can check for the presence of your
newly created extension by issuing "dialplan show extension at context" from
the CLI, where extension is the extension number, and context is the context
you created (radio-control in my example), and it will return the routing
for that extension:

bubastis*CLI> dialplan show 2335 at radio-control
[ Context 'radio-control' created by 'pbx_config' ]
  '2335' =>         1. Playback(rpt/node)
[pbx_config]
                    2. Playback(digits/2)
[pbx_config]
                    3. Playback(digits/3)
[pbx_config]
                    4. Playback(digits/3)
[pbx_config]
                    5. Playback(digits/5)
[pbx_config]
                    6. Rpt(2335|P )
[pbx_config]

-= 1 extension (6 priorities) in 1 context. =-

There are other methods to accomplish what I have above, and of course
security concerns. This works extremely well and now that I have it working
I am going to continue to tweak things and make it as robust as I possibly
can. My next challenge is to get inbound and outbound autopatch calls from
the app_rpt box to my provider.

Love this project, I've been playing with it for just over a year now and I
am still learning stuff. So much fun...

tnx and 73
Stephen
K1LNX


On Tue, Feb 2, 2010 at 9:52 PM, Keith Williamson <hkwilliamson at gmail.com>wrote:

> Thought I'd share this thread with the list since it might be helpful to
> someone trying to setup a local sip phone for reverse autopatch.
>
> Bob and I went off the list when we first got started on this because I was
> afraid the thread could get quite lengthy if we ran into the (almost)
> inevitable problems. However, everything worked the first time through a
> combination of luck on my part explaining things (blue moon) and Bob's
> excellent ability to read, interpret, and follow my drivel.
>
> Bob, if there were things I explained incorrectly below that you figured
> your way around, please chime in so that the next unwary ham who tries this
> will be forewarned. Also note that some of this is specific to Bob's SIP
> phone but in looking through the manual for the phone, I found it to be
> pretty typical of other SIP phones I've worked with. Finally, apologies for
> the reverse ordering of the thread versus the way we normally (try) to order
> thread (newest reply at bottom).
>
> 73's
>
> Keith
>
> KF7DRV
> Allstar Node 2541
>
> ---------- Forwarded message ----------
> From: Bob Brown - WØNQX <bbrown at byrg.net>
> Date: Sun, Jan 31, 2010 at 12:03 PM
> Subject: SIP IP pHONE config - was: Connect notifications via AGI or System
> scripts
> To: Keith Williamson <hkwilliamson at gmail.com>
>
>
> hi keith
>
> got the first part done
> ~~~~~~~~~~~~~~~~~~~~~~
> sip show peers
>
> Name/username              Host            Dyn Nat ACL Port
> Status
> 9009/9009                  10.0.0.40        D          5060
> Unmonitored
> 1 sip peers [Monitored: 0 online, 0 offline Unmonitored: 1 online, 0
> offline]
>  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> whats next?
>
> --
> Thanks in Advance
>
>   Bob Brown, WØNQX
>
>   Kansas City Metro Area
>
>   http://sm0kenet.net
>
>   http://byrg.net
>
>   http://kcdstar.byrg.net
>
> Quis custodiet ipsos custodes?
>
>
>
> On Sun, Jan 31, 2010 at 12:09, Keith Williamson <hkwilliamson at gmail.com>wrote:
>
>> OK great. Next step is to get the phone registered with the Allstar node.
>> I'm going to assume the phone is connected to the internal network the node
>> is on and for the purposes of this explanation I'll say the internal IP of
>> your Allstar node is 192.168.0.1 (and that that IP is either static or gets
>> a static lease via DHCP).  Obviously, substitute your node's actual internal
>> IP.
>>
>> In the web interface for the phone, enter the Allstar node internal IP in
>> ALL of the following fields of Line 1 settings for Profile 1:
>>
>> SIP Proxy Server
>> Outbound Proxy Server
>> Registrar Server
>> Outbound Registrar Server
>>
>> Leave the SIP Proxy Server Port and Registrar Proxy Server Port set at the
>> default of 5060.
>>
>> Also in the same Line 1 Profile 1 menu, you need to set the phone's
>> extension info. You can make this whatever you want but for the purposes of
>> this explanation we'll call it Bobs208. Set Bobs208 in the following fields:
>>
>> Phone Number
>> User Name
>> Authorized ID
>>
>> Finally, you need to set a password for authentication. We'll use
>> "secret123". Set the following field to secret123:
>>
>> Authorized Password
>>
>> This should be enough on the phone side of things so now down at the
>> bottom of the menu, do Save Settings followed by Logout.
>>
>> Now we move over to the Allstar node. Open /etc/asterisk/sip.conf with
>> your favorite editor (I'm a vi guy myself) and add a stanza for your phone
>> (below the end of the [general] stanza) that would be something like this:
>>
>> [Bobs208]
>> type=friend
>> secret=secret123
>> context=radio-control
>> host=dynamic
>> disallow=all
>> allow=ulaw
>> transfer=no
>>
>> Now save the changes to sip.conf and exit the editor. Next go into the CLI
>> (e.g. asterisk -vr) and type "sip reload" to force asterisk to reread the
>> sip.conf file. At this point, asterisk should be ready register your phone.
>>
>> Probably the most dependable way to get the phone to activate the changes
>> you made to the phone's SIP parameters and to force the phone to attempt to
>> register with Allstar/Asterisk is to just power-cycle the phone.
>>
>> I haven't read enough about this phone to know how the phone indicates
>> it's registration state after it finishes booting but you can watch the
>> Allstar CLI and you should be able to see the registration occuring. You can
>> also type the following CLI command to check if you phone is registered:
>>
>> CLI> sip show peers
>>
>> Let me know how all this goes and then we can proceed to the final step
>> once the phone is registered.
>>
>> 73's
>>
>> Keith
>>
>> KF7DRV
>>
>>
>>
>>
>>
>> On Sat, Jan 30, 2010 at 11:57 PM, Bob Brown - WØNQX <bbrown at byrg.net>wrote:
>>
>>> ya mine is a virgin fone and the default is 1234
>>>
>>> i got this from a ip phone vendor/wholsaler it was a freebie he says it
>>> was sip compatable
>>>
>>> i have managed to log into it from the web interface and from the admin
>>> menu in the front panle.
>>>
>>>
>>>
>>> --
>>> Thanks in Advance
>>>
>>>   Bob Brown, WØNQX
>>>
>>>   Kansas City Metro Area
>>>
>>>   http://sm0kenet.net
>>>
>>>   http://byrg.net
>>>
>>>   http://kcdstar.byrg.net
>>>
>>> Quis custodiet ipsos custodes?
>>>
>>>
>>>
>>>   On Sat, Jan 30, 2010 at 22:45, Keith Williamson <
>>> hkwilliamson at gmail.com> wrote:
>>>
>>>> Hi Bob,
>>>>
>>>> I found the manual for your T207/T208 phone..hopefully you have that
>>>> too. Getting the phone registered with Asterisk requires that the phone be
>>>> an "S" model (T207S or T208S) which means it has SIP firmware. The T207M and
>>>> T208M models run MGCP which isn't compatible with Asterisk. The other
>>>> requirement is that you need to know the admin password. If it's never been
>>>> changed it should be the default "1234". You can configure the phone
>>>> settings either directly on the phone or via your web browser (although you
>>>> need to at least configure the TCP/IP parameters using the phone menus
>>>> before you can switch to using the more convenient web interface).
>>>>
>>>> Perhaps you have already done this part and have the phone connected via
>>>> Ethernet to the network the node is on?
>>>>
>>>> Let me know and we can go from there.
>>>>
>>>> 73s,
>>>>
>>>> Keith
>>>>
>>>>
>>>> On Sat, Jan 30, 2010 at 10:02 AM, Bob Brown - WØNQX <bbrown at byrg.net>wrote:
>>>>
>>>>> my ipphone: TSIPP2008BG-R1
>>>>>
>>>>> sure any help would be great!
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Thanks in Advance
>>>>>
>>>>>   Bob Brown, WØNQX
>>>>>
>>>>>   Kansas City Metro Area
>>>>>
>>>>>   http://sm0kenet.net
>>>>>
>>>>>   http://byrg.net
>>>>>
>>>>>   http://kcdstar.byrg.net
>>>>>
>>>>> Quis custodiet ipsos custodes?
>>>>>
>>>>>
>>>>>
>>>>>   On Fri, Jan 29, 2010 at 23:01, Keith Williamson <
>>>>> hkwilliamson at gmail.com> wrote:
>>>>>
>>>>>> Hi Bob,
>>>>>>
>>>>>> No problem. What make/model of ipphone is it? The first thing required
>>>>>> is a stanza in sip.conf defining the extension, user, password, etc
>>>>>> for that particular phone. The required elements vary from phone to
>>>>>> phone so let me know what kind you have. After creating the entry in
>>>>>> sip.conf, you just do a "sip reload" at the CLI and check to see if
>>>>>> the phone gets registered OK. Once you have that, you just need to add
>>>>>> a stanza to extensions.conf to enable the reverse autopatch.
>>>>>>
>>>>>> There's a pretty complete description of what's required in the ACID
>>>>>> Admin Manual.
>>>>>>
>>>>>> Cheers,
>>>>>>
>>>>>> Keith
>>>>>>
>>>>>>
>>>>>> On 1/29/10, Bob Brown - WØNQX <bbrown at byrg.net> wrote:
>>>>>> > hi keith
>>>>>> >
>>>>>> > i would be interrested in your config files to set up the ipphone
>>>>>> > on your node
>>>>>> >
>>>>>> > i have a 4 line ip desk phone i would like to set up to do what you
>>>>>> describe
>>>>>> >
>>>>>> > i am not very fluent in asterisk set up for ip fones.
>>>>>> >
>>>>>> > would you be willing to share?
>>>>>> >
>>>>>> >
>>>>>> > --
>>>>>> > Thanks in Advance
>>>>>> >
>>>>>> >   Bob Brown, WØNQX
>>>>>> >
>>>>>> >   Kansas City Metro Area
>>>>>> >
>>>>>> >   http://sm0kenet.net
>>>>>> >
>>>>>> >   http://byrg.net
>>>>>> >
>>>>>> >   http://kcdstar.byrg.net
>>>>>> >
>>>>>> > Quis custodiet ipsos custodes?
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > On Fri, Jan 29, 2010 at 22:04, Keith Williamson
>>>>>> > <hkwilliamson at gmail.com>wrote:
>>>>>> >
>>>>>> >> Hi,
>>>>>> >>
>>>>>> >> Recently, I got reverse autopatch configured on my simplex node
>>>>>> (2541) and
>>>>>> >> everything works great. In the shack, I have a Polycom IP501
>>>>>> speaker phone
>>>>>> >> that I use to monitor or connect into QSO's on the node. Out of the
>>>>>> shack,
>>>>>> >> I
>>>>>> >> can call into the node using my Blackberry and do the same. So the
>>>>>> next
>>>>>> >> challenge is to get quick notifications of users connecting into
>>>>>> the node
>>>>>> >> either via radio or Internet (Echolink and Allstar..no IRLP yet). I
>>>>>> >> created
>>>>>> >> a pair of Twitter accounts; one for the node and another for me
>>>>>> >> personally.
>>>>>> >> I added my node's Twitter account to the ones I follow with my
>>>>>> personal
>>>>>> >> account and created an AGI scripts that formats a curl command
>>>>>> which posts
>>>>>> >> some of the context variables passed in when Asterisk invokes the
>>>>>> script
>>>>>> >> (context name, extension, callerid, etc). I then added the AGI call
>>>>>> into
>>>>>> >> various extension stanzas in extensions.conf to test. If, for
>>>>>> instance, I
>>>>>> >> do
>>>>>> >> a reverse autopatch and connect to the reverse autopatch
>>>>>> "extension", I
>>>>>> >> almost immediately get an SMS tweet on the Blackberry.  Great.
>>>>>> However, it
>>>>>> >> seems that connections via the radio are not processed in any way
>>>>>> in
>>>>>> >> extensions.conf (thought [default] stanza would apply but
>>>>>> apparently only
>>>>>> >> applies to autopatch), and inbound connections from either Allstar
>>>>>> or
>>>>>> >> Echolink, while processed through [radio-secure], hang on the AGI
>>>>>> call and
>>>>>> >> don't proceed to the following call to rpt. I'm assuming this is
>>>>>> because
>>>>>> >> AGI
>>>>>> >> calls generally follow an "Answer" and are only valid in the
>>>>>> connected
>>>>>> >> state. I tried "deadAGI" since it doesn't seems to be dependent on
>>>>>> being
>>>>>> >> in
>>>>>> >> the answered state but it hung the same way. It's possible I've got
>>>>>> a
>>>>>> >> problem in the AGI script which is causing the hang but it
>>>>>> certainly
>>>>>> >> doesn't
>>>>>> >> occur when the AGI call follows "Answer".
>>>>>> >>
>>>>>> >> So I'm looking for help to understand other possible ways to invoke
>>>>>> a
>>>>>> >> script that calls curl to post the tweet when a radio user makes an
>>>>>> >> outbound
>>>>>> >> connection to Allstar or Echolink and when an Echolink or Allstar
>>>>>> user
>>>>>> >> connects in to the radio.
>>>>>> >>
>>>>>> >> Ideas?
>>>>>> >>
>>>>>> >> Thanks and 73's
>>>>>> >>
>>>>>> >> Keith
>>>>>> >>
>>>>>> >> KF7DRV
>>>>>> >>
>>>>>> >> _______________________________________________
>>>>>> >> App_rpt-users mailing list
>>>>>> >> App_rpt-users at qrvc.com
>>>>>> >> http://qrvc.com/mailman/listinfo/app_rpt-users
>>>>>> >>
>>>>>> >>
>>>>>> >
>>>>>>
>>>>>> --
>>>>>> Sent from my mobile device
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>
>
> _______________________________________________
> App_rpt-users mailing list
> App_rpt-users at qrvc.com
> http://qrvc.com/mailman/listinfo/app_rpt-users
>
>


-- 
**********************************
Stephen Brown - ARS K1LNX
Johnson City, TN EM86
http://www.k1lnx.net
google voice: 423-665-9367
**********************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.allstarlink.org/pipermail/app_rpt-users/attachments/20100202/86127001/attachment.html>


More information about the App_rpt-users mailing list