Skip to content

Instantly share code, notes, and snippets.

@elcontrastador
Created November 7, 2010 21:14
Show Gist options
  • Save elcontrastador/666849 to your computer and use it in GitHub Desktop.
Save elcontrastador/666849 to your computer and use it in GitHub Desktop.
;;; extensions.conf
[default]
exten => 1001,1,Answer()
exten => 1001,2,Playback(hello-world)
exten => 1001,3,Hangup()
exten => 2000,1,Dial(SIP/2000,5)
exten => 2000,2,VoiceMail(2000,u)
exten => 2001,1,Dial(SIP/2001)
exten => 2999,1,VoiceMailMain(${CALLERID(num)},s)
exten => _X.,1,Dial(SIP/${EXTEN}@ext-sip-account)
[from-voip-provider]
exten => <mynum>,1,Dial(SIP/2000)
;;; sip.conf
[general]
port=5060
bindaddr=0.0.0.0
register => <omitted>:<omitted>@trunk1.freepbx.com/<omitted>
[2000]
type=friend
secret=1234
host=dynamic
[2001]
type=friend
secret=1234
host=dynamic
[ext-sip-account]
type=friend
insecure=port,invite
host=trunk1.freepbx.com
qualify=yes
sendrpid=yes
username=<omitted>
fromuser=<omitted>
secret=<omitted>
context=from-voip-provider
disallow=all
allow=ulaw
nat=yes
externip=<omitted>
externrefresh=120
localnet=192.168.1.0/255.255.255.0
context=default ; Default context for incoming calls
;;; tcpdump for incoming udp
12:58:22.429445 IP trunk.snv.freepbx.com.sip > mbp-linux.sip: SIP, length: 1156
12:58:22.429913 IP mbp-linux.sip > trunk.snv.freepbx.com.sip: SIP, length: 549
12:58:22.430274 IP mbp-linux.sip > trunk.snv.freepbx.com.sip: SIP, length: 944
12:58:22.430491 IP mbp-linux.58708 > home.domain: 23546+ PTR? 24.225.82.216.in-addr.arpa. (44)
12:58:22.464913 IP trunk.snv.freepbx.com.sip > mbp-linux.sip: SIP, length: 327
12:58:22.469293 IP home.domain > mbp-linux.58708: 23546 1/0/0 PTR trunk.snv.freepbx.com. (79)
12:58:22.512700 IP trunk.snv.freepbx.com.sip > mbp-linux.sip: SIP, length: 809
12:58:22.512865 IP mbp-linux.sip > trunk.snv.freepbx.com.sip: SIP, length: 512
12:58:22.513085 IP mbp-linux.sip > trunk.snv.freepbx.com.sip: SIP, length: 1210
12:58:22.547929 IP trunk.snv.freepbx.com.sip > mbp-linux.sip: SIP, length: 327
12:58:22.584450 IP trunk.snv.freepbx.com.sip > mbp-linux.sip: SIP, length: 1162
12:58:22.584945 IP mbp-linux.sip > trunk.snv.freepbx.com.sip: SIP, length: 549
12:58:22.585627 IP mbp-linux.sip > trunk.snv.freepbx.com.sip: SIP, length: 944
12:58:22.619178 IP trunk.snv.freepbx.com.sip > mbp-linux.sip: SIP, length: 327
12:58:22.624560 IP trunk.snv.freepbx.com.sip > mbp-linux.sip: SIP, length: 809
12:58:22.624652 IP mbp-linux.sip > trunk.snv.freepbx.com.sip: SIP, length: 512
12:58:22.624781 IP mbp-linux.sip > trunk.snv.freepbx.com.sip: SIP, length: 1210
12:58:22.660269 IP trunk.snv.freepbx.com.sip > mbp-linux.sip: SIP, length: 327
12:58:22.714756 IP trunk.snv.freepbx.com.sip > mbp-linux.sip: SIP, length: 722
12:58:22.714948 IP mbp-linux.sip > trunk.snv.freepbx.com.sip: SIP, length: 512
12:58:22.715217 IP mbp-linux.sip > trunk.snv.freepbx.com.sip: SIP, length: 619
12:58:22.748563 IP trunk.snv.freepbx.com.sip > mbp-linux.sip: SIP, length: 385
12:58:22.753849 IP trunk.snv.freepbx.com.sip > mbp-linux.sip: SIP, length: 720
12:58:22.754009 IP mbp-linux.sip > trunk.snv.freepbx.com.sip: SIP, length: 512
12:58:22.754231 IP mbp-linux.sip > trunk.snv.freepbx.com.sip: SIP, length: 594
12:58:22.787474 IP trunk.snv.freepbx.com.sip > mbp-linux.sip: SIP, length: 385
12:58:23.549197 IP redii-mbpro.17500 > 255.255.255.255.17500: UDP, length 112
;; * console shows nothing
;; portscan from external host to test fw/nat
Not shown: 999 closed ports
PORT STATE SERVICE
5060/udp open|filtered sip
5070/udp open|filtered unknown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment