Hmm…
To be honest, I dont understand how incoming SIP calls to my Asterisk server get handled (extension@myserver.com).
I understand, that incoming calls to my PSTN number get in the asterisk box by my SIPGATE trunk, but I havent got a clue how general incoming SIP calls (extension@myserver.com) get handled. Do I have to setup a trunk for direct calls to my asterisk box as well?How would this look like?
Thanks for help.
Which of those is the incoming context, you are looking for?
extensions.conf
Header
from-trunk
from-pstn
from-did-direct
macro-dial
macro-exten-vm
macro-vm
macro-get-vmcontext
macro-fixcid
macro-rg-group
macro-outisbusy
macro-hangupcall
macro-faxreceive
macro-dialout
macro-dialout-default
macro-dialout-trunk
macro-agent-add
macro-agent-del
macro-dialout-enum
macro-record-enable
macro-dumpvars
macro-user-logon
macro-user-logoff
macro-systemrecording
macro-user-callerid
macro-outbound-callerid
macro-privacy-mgr
from-sip-external
from-internal
from-zaptel
ext-fax
default
Is this the incoming context you are looking for?
[from-sip-external]
;give external sip users congestion and hangup
; Yes. This is really meant to be _. - I know asterisk whinges about it, but
; I do know what I’m doing. This is correct.
exten => _.,1,NoOp(Received incoming SIP connection from unknown peer to ${EXTEN})
exten => _.,n,Set(DID=${IF($["${EXTEN:1:2}"=""]?s:${EXTEN})})
exten => _.,n,Goto(s,1)
exten => s,1,GotoIf($["${ALLOW_SIP_ANON}"=“yes”]?from-trunk,${DID},1)
exten => s,n,Set(TIMEOUT(absolute)=15)
exten => s,n,Answer
exten => s,n,Wait(2)
exten => s,n,Playback(ss-noservice)
exten => s,n,Congestion
exten => s,n,Hangup
exten => h,1,NoOp(Hangup)
exten => i,1,NoOp(Invalid)
exten => t,1,NoOp(Timeout)
This is my sip.conf:
; Note: If your SIP devices are behind a NAT and your Asterisk
; server isn’t, try adding “nat=1” to each peer definition to
; solve translation problems.
[general]
port = 5060 ; Port to bind to (SIP is 5060)
bindaddr = 0.0.0.0 ; Address to bind to (all addresses on machine)
disallow=all
allow=ulaw
allow=alaw
videosupport=yes ; enable Asterisk video support
allow=h263
allow=h263p
; If you need to answer unauthenticated calls, you should change this
; next line to ‘from-trunk’, rather than ‘from-sip-external’.
; You’ll know this is happening if when you call in you get a message
; saying “The number you have dialed is not in service. Please check the
; number and try again.”
;context = from-sip-external ; Send unknown SIP callers to this context
context= from-trunk
callerid = Unknown
tos=0x68
; #, in this configuration file, is NOT A COMMENT. This is exactly
; how it should be.
#include sip_nat.conf
#include sip_custom.conf
#include sip_additional.conf
register=xxx:yyy@sipgate.co.uk/xxx
[1]
username=1
type=friend
secret=xxx
record_out=Adhoc
record_in=Adhoc
qualify=no
port=5060
nat=yes
mailbox=1@device
host=dynamic
dtmfmode=rfc2833
context=from-internal
canreinvite=no
callerid=Office <1>
[SipGate]
username=xxx
type=peer
secret=xxx
qualify=yes
nat=yes
insecure=very
host=sipgate.co.uk
fromuser=xxx
fromdomain=sipgate.co.uk
dtmfmode=rfc2833
[SipGate_IN]
username=xxx
type=peer
secret=xxx
nat=yes
insecure=very
host=sipgate.co.uk
dtmfmode=rfc2833
canreinvite=no