Asterisk1.8: sip.conf validation

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Author Message
gatorback
DD-WRT User


Joined: 04 Feb 2007
Posts: 426
Location: Fountain of Youth

PostPosted: Wed Jun 15, 2011 21:15    Post subject: Asterisk1.8: sip.conf validation Reply with quote
Asterisk 1.8 is running on an ASUS RT-N16 (Optware) attempting to configure Google Voice. In this thread, I am interested in validating the connection between a SPA2102 ATA and *1.8


I created a SIP extension for SPA2102 ATA based on this article.

Code:
[101]
type=friend
host=dynamic
nat=yes
qualify=yes
context=mario-default
defaultuser=101
secret=XXXXXXXXX
callerid="user1" <101>
mailbox=101


Q1) Do the two tests below validate the ATA to * connection?

Test 1) SPA2102 => Voice => Info shows that the device is registered.
Test 2) On the Asterisk side:

Code:
athomehost*CLI> sip show peers
Name/username              Host                                    Dyn Forcerport ACL Port     Status
101/101                    192.168.8.110                            D   N      5060     OK (6 ms)
NokiaE71x                  (Unspecified)                            D          0        Unmonitored
2 sip peers [Monitored: 1 online, 0 offline Unmonitored: 0 online, 1 offline]


Q2) Will my ATA's Dialplan prevent me from dialing out?

(*xx.|*xxx|*75xx|[3469]11|0|00|1xxx[2-9]xxxxxxS0|xxxxxxxxxxxx.|**275*x.)

This dialplan was for a callcentric VOIP account.

Attempts to dial 18005551212 resulted a voice response 'Enum lookup failed'. Attempts to dial 1(XXX)XXX-XXXX resulted in a busy signal. I realize that these observations are not shortcomings in the ATA - Asterisk configuration and are more likely to be a problem with Asterisk dialplan (extensions.conf) or GV (jabber.conf). For now, I would like to focus on validating the ATA-Asterisk connection.

If you have experience connecting an ATA to *, I would be interested in any constructive comments \ validation criteria. Thank you.

TAG: [GV-OPT]

_________________
My Routers | RT-N16 Wiki | TMO Cellspot Wiki
Peacock Flashing | Wireless N Conf | Linking Routers |
DD-WRT Wiki | DD-WRT Builds | Broadcom FAQ| QoS| OTRW
Sponsor
okki
DD-WRT User


Joined: 20 Jul 2010
Posts: 115

PostPosted: Thu Jun 16, 2011 14:50    Post subject: Reply with quote
I may be wrong, but you may not understand the correct idea behind such a setup. The way to set up Asterisk for regular PBX use is usually:

IP-phones ==> Asterisk on router ==> Internet

meaning your IP phones (or ATA) register to Asterisk, which then processes the call based on the dialplan you provided in extensions.conf and/or extensions.ael.

In particular, understand the NAT settings. E.g. if you don't use the directmedia=yes option (the default) you also don't need the nat=yes option in the SIP entry for the SPA.

If you understand all that, I suggest you read up about Asterisk on Optware http://www.dd-wrt.com/phpBB2/viewtopic.php?t=43787. Read all those pages (only 25 Smile ); it has a lot of useful information, like which modules to load and also about Google Voice.

If you think the documentation is very bad, I concur. I intended to make a nice wiki page on Asterisk, but I have to find the time. Also, the fact that apparently I cannot register an account to the wiki site without a hassle is holding me back. (Hint to the site owners Smile .)

Success!
gatorback
DD-WRT User


Joined: 04 Feb 2007
Posts: 426
Location: Fountain of Youth

PostPosted: Thu Jun 16, 2011 17:39    Post subject: Reply with quote
The objective of this posting is to verify that connection:

IP-phones <==> Asterisk on router

is properly configured. Verification implies that I would have a test: preferable from the CLI.

For example, when I add a network device, I usually use:

Code:
>> ping routerhostname.


and I expect a response of the prototype:

Quote:
Pinging 192.168.8.1 with 32 bytes of data:

Reply from 192.168.8.1: bytes=32 time<1ms TTL=64
Reply from 192.168.8.1: bytes=32 time<1ms TTL=64
Reply from 192.168.8.1: bytes=32 time<1ms TTL=64
Reply from 192.168.8.1: bytes=32 time<1ms TTL=64

Ping statistics for 192.168.8.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms


In similar fashion, I believe that an asterisk test from CLI provides connection validation:

Quote:
athomehost*CLI> sip show peers
Name/username Host Dyn Forcerport ACL Port Status
101/101 192.168.8.110 D N 5060 OK (6 ms)
NokiaE71x (Unspecified) D 0 Unmonitored
2 sip peers [Monitored: 1 online, 0 offline Unmonitored: 0 online, 1 offline]


I am hoping that someone has used this command and knows if the result above is sufficient to verify that the ATA is completely \ correctly connected Asterisk.

_________________
My Routers | RT-N16 Wiki | TMO Cellspot Wiki
Peacock Flashing | Wireless N Conf | Linking Routers |
DD-WRT Wiki | DD-WRT Builds | Broadcom FAQ| QoS| OTRW
okki
DD-WRT User


Joined: 20 Jul 2010
Posts: 115

PostPosted: Thu Jun 16, 2011 18:13    Post subject: Reply with quote
If that's the only thing you want to know, well, yes - your SPA does communicate Asterisk, otherwise it wouldn't recognise it at the 192.168.8.110 address. Very Happy

So the next step is configuring Asterisk, for which I advise the above in my previous post. (And other people's advice in your other thread.)
gatorback
DD-WRT User


Joined: 04 Feb 2007
Posts: 426
Location: Fountain of Youth

PostPosted: Thu Jun 16, 2011 19:23    Post subject: Reply with quote
@okki: Thanks for the feedback. Before I move on to configuring jabber.conf and extensions. conf, Is there a test that can be performed that would involved dialing the ATA's phone and receiving some audible response from Asterisk?

I would feel better that a validation test was performed. Verification (above) is good, but validation would be stronger and provide higher confidence.

My goal is to confirm that the configuration between the ATA & Asterisk is complete and correct.

_________________
My Routers | RT-N16 Wiki | TMO Cellspot Wiki
Peacock Flashing | Wireless N Conf | Linking Routers |
DD-WRT Wiki | DD-WRT Builds | Broadcom FAQ| QoS| OTRW
okki
DD-WRT User


Joined: 20 Jul 2010
Posts: 115

PostPosted: Fri Jun 17, 2011 10:42    Post subject: Reply with quote
Sure, but Asterisk is so flexible, there's no standard test or something. And understand there are different configurations for different purposes, which are all correct.

Still, getting an audio response is a good test to see if it works. Though it would involve entering something in your dialplan. Asterisk has some nice audio files (be sure to download them via opt-ipkg). You can call them for example with

exten => 1234,1,Playback(tt-monkeys);

I understand it's confusing at first, and your wish to take everything one step at a time. But whatever you expect to validate or verify, it's not such of a big deal. Just try if calling an extension works, that's validation enough. Or why not just call from one phone to the other over the LAN? A second test is to see if your NAT works: call a SIP address from outside the LAN. (Call some SIP test numbers, for instance.)
gatorback
DD-WRT User


Joined: 04 Feb 2007
Posts: 426
Location: Fountain of Youth

PostPosted: Sun Jun 19, 2011 11:20    Post subject: Reply with quote
Thanks Okki, I used the SIP configuration above with the dialplan:

Quote:
; --
; Inbound Calls
; --
; * This extension is where any external SIP calls should route to
[default]
exten => s,1,Set(CALLERID(name)=${DB(cidname/${CALLERID(num)})})
exten => s,n,Dial(SIP/101,10)
exten => s,n, Hangup
exten => 101, 1, Dial(SIP/101, 10)
;
;
; * From Google (superm1)
[google-in]
exten => superm1@gmail.com, 1, Dial(SIP/101, 180, D(:1))
;
;
; --
; Outbound Calls
; --
;
;
; * Default starting context for internal SIP devices
[mario-default]
include => local-devices
include => tollfree
include => gv-outbound
include => dial-uri
;include => testomatic
;include => flubber
;
;
; * These are for any local extensions we should be supporting
[local-devices]
exten => _1, 1, Dial(SIP/101,10)
;
;
; * Toll free numbers (don't use GV for these)
[tollfree]
exten => _411, 1, Dial(SIP/18004664411@proxy.ideasip.com,60)
exten => _1800NXXXXXX,1,Dial(SIP/${EXTEN}@proxy.ideasip.com,60)
exten => _1888NXXXXXX,1,Dial(SIP/${EXTEN}@proxy.ideasip.com,60)
exten => _1877NXXXXXX,1,Dial(SIP/${EXTEN}@proxy.ideasip.com,60)
exten => _1866NXXXXXX,1,Dial(SIP/${EXTEN}@proxy.ideasip.com,60)
;
;
; * Route the call using the google voice bridge
[gv-outbound]
;append an area code if necessary
exten => _NXXXXXX,1,Set(CALLERID(dnid)=1904${CALLERID(dnid)})
exten => _NXXXXXX,n,Goto(1904${EXTEN},1)
;append a 1 if necessary
exten => _NXXNXXXXXX,1,Set(CALLERID(dnid)=1${CALLERID(dnid)})
exten => _NXXNXXXXXX,n,Goto(1${EXTEN},1)
;do our real dialing
exten => _1NXXNXXXXXX,1,Dial(Gtalk/superm1/${EXTEN}@voice.google.com)
exten => _+1NXXNXXXXXX,1,Dial(Gtalk/superm1/${EXTEN}@voice.google.com)
;
;
; * Dialing by SIP URL eg foo@domain.com
[dial-uri]
exten => _[a-z].,1,Dial(SIP/${EXTEN}@${SIPDOMAIN},120,tr)
exten => _[A-Z].,1,Dial(SIP/${EXTEN}@${SIPDOMAIN},120,tr)
exten => _X.,1,Dial(SIP/${EXTEN}@${SIPDOMAIN},120,tr)
;
; http://phplinuxandthelike.wordpress.com/2007/09/04/basic-asterisk-configuration/
[testomatic]
exten => 200,1,Answer()
;same => n,Playback(hello-world)
;same => n,Playback(/opt/etc/asterisk/notify.wav)
same => n,Dial(SIP/17771234567@callcentric.com,60)
same => n,Hangup()
;
[flubber]
exten => 55,1,Playback(demo-echotest) ; Let them know what's going on
exten => 55,2,Echo ; Do the echo test
exten => 55,3,Playback(demo-echodone) ; Let them know it's over
;


Outgoing calls were successful, however, incoming calls did not ring the ATA. I am not sure that if I can declare ATA to Asterisk successful, because I have not proven that Asterisk can call the ATA.

I thought that I would add a softphone (X-lite-4)to the system:

Quote:
[NokiaE71x]
type=friend
host=dynamic
nat=yes
qualify=yes
context=mario-default
defaultuser=NokiaE71x
secret=mypassword
callerid="Nokia Callerid" <NokiaE71x>
mailbox=NokiaE71x

It does not seem to register:

Code:
root@athomehost:~# asterisk -rx "sip show peers"

Quote:
Name/username Host Dyn Forcerport ACL Port Status
101/101 192.168.8.110 D N 5060 OK (14 ms)
NokiaE71x (Unspecified) D 0 Unmonitored
2 sip peers [Monitored: 1 online, 0 offline Unmonitored: 0 online, 1 offline]


The original theme of this thread was to configure and test the ATA. To do this, it makes sense to setup a softphone and call the ATA. I am unable to get the softphone (X-lite4) to register with Asterisk. Actionable suggestions to isolate the problem are appreciated. I would think that the softphone registration problem is either in sip.conf and/or the softphone configuration setup: have I fogotten anything?

_________________
My Routers | RT-N16 Wiki | TMO Cellspot Wiki
Peacock Flashing | Wireless N Conf | Linking Routers |
DD-WRT Wiki | DD-WRT Builds | Broadcom FAQ| QoS| OTRW
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum