OUTGOING SETTINGS
Trunk Name: viatalk
PEER Details:
disallow=all
allow=ulaw
authuser=xxxxxxxxxxx (your 11 digit viatalk number)
context=from-trunk
dtmf=auto
dtmfmode=inband
fromdomain=chicago-1.vtnoc.net
fromuser=xxxxxxxxxxx (your 11 digit viatalk number)
host=chicago-1.vtnoc.net
insecure=port,invite (or insecure=very only in Asterisk 1.2 & earlier)
qualify=yes
secret=xxxxxxxxxx
type=peer
username=xxxxxxxxxxx (your 11 digit viatalk number)
NOTE: Use your nearest ViaTalk server as selected in the ViaTalk control panel for fromdomain and host settings (Chicago is shown in this example).
NOTE: If you have problems with touch tones not being able to control your IVR on incoming ViaTalk calls, or you find you can't create an inbound route that works, or ViaTalk is sending Caller ID with a + prefix and you'd like to get rid of that, try this: instead of setting the context= to from-trunk, set it to custom-from-viatalk and then add the following lines to the end of /etc/asterisk/extensions_custom.conf (do NOT include the parenthetical line numbers at the start of each line, they are there solely for reference in this documentation):
(1) [custom-from-viatalk]
(2) exten => _X!,1,Noop(Incoming ViaTalk call)
(3) exten => _X!,n,SIPDtmfMode(inband)
(4) exten => _X!,n,GotoIf($["${CALLERID(num):0:2}" != "+1"]?noplusatstart)
(5) exten => _X!,n,NoOp(Changing Caller ID number from ${CALLERID(num)} to ${CALLERID(num):1})
(6) exten => _X!,n,Set(CALLERID(num)=${CALLERID(num):1})
(7a) exten => _X!,n(noplusatstart),Goto(from-trunk,${EXTEN},1)
(7b) exten => _X!,n(noplusatstart),Goto(from-trunk,your-viatalk-number,1)
Always include lines (1) and (2). Use line (3) if you find that callers can't use touch tones to control your IVR, or otherwise get around in your system (if in doubt, we recommend including it). Lines (4) through (6) can be used if ViaTalk is sending the Caller ID number with a + prefix and it is causing problems (with callbacks, etc.) As shown, the code will only strip the + if the number starts with +1, so the + would (hopefully) still be present on any international calls. If you want to remove the + unconditionally (even on international calls) then change Line (4) in two places, so that the :0:2 becomes :0:1 and the "+1" becomes "+". Finally, if your inbound route is working without any issues (as usually seems to be the case now) then use line (7a) rather than line (7b). But if, for some reason, you are still having problems with ViaTalk calls not coming into your inbound route, then try using line (7b) instead of (7a) and where you see your-viatalk-number, replace that with your 11 digit ViaTalk number (you might also have to replace all instances of _X! with s in all lines of the context). Note that using line (7b) should no longer be necessary if you construct the registration string properly (see below), so please try line (7a) first. Whichever variation of line (7) you use, if (and only if) you did not use lines (4) through (6) then remove the (noplusatstart) label on line (7).
INCOMING SETTINGS NOT USED
Registration String: YOUR 11 DIGIT NUMBER:YOUR SIP PASSWORD@YOUR VT PROXY/YOUR 11 DIGIT NUMBER
Source: http://aussievoip.com.au/wiki/Tested+and+working+SIP+provider+configurat...