Monday, May 10, 2010

Asterisk Configuration for SPA3102- Outgoing Calls

In sip.conf I added the "line1" user. Note that this could be whatever you want, but you'd have to change the Linksys configuration.
[line1]
type=friend
host=[IP addr of Linksys]
username=line1
secret=[password]
dtmfmode=rfc2833
context=outbound-local
insecure=port,invite
disallow=all
allow=ulaw
nat=yes
qualify=yes
port=5061
I mentioned a bit earlier that I was getting warnings and errors in the console about registering. The error message was pretty straightforward:
[May 10 19:36:08] NOTICE[23761]: chan_sip.c:21538 handle_request_register: Registration from 'line1 ' failed for '[Linksys IP]' - Peer is not supposed to register
[May 10 19:36:12] ERROR[23761]: chan_sip.c:13010 register_verify: Peer 'line1' is trying to register, but not configured as host=dynamic
Obviously the error was due to the "host" attribute not being dynamic. For some reason calling out didn't work if the host was dynamic and I'm not exactly sure why. To clean up the console I just turned off registration for this particular peer.

In extensions.conf I created a new context:
[outbound-local]
exten => _9XXXXXXX,1,Dial(SIP/${EXTEN:1}@line1,25)
This matches any 8-digit pattern in which the first digit is 9 (patterns are prefaced with an underscore). The ${EXTEN:1} variable passes the number dialed to the trunk, and the ":1" strips off the 9. Sadly this is what took me so long to figure out, and I'm still confused about the syntax of the above "Dial" application, which seems different from what's in the book. Maybe it's a version issue?

No comments:

Post a Comment