Oto moja konfiguracja:
Extension.conf:
[general]
static=yes
writeprotect=no
clearglobalvars=no
[globals]
CONSOLE=Console/dsp ; Console interface for demo
IAXINFO=guest ; IAXtel username/password
TRUNK=Zap/g2 ; Trunk interface
TRUNKMSD=1 ; MSD digits to strip (usually 1 or 0)
[demo]
;
; We start with what to do when a call first comes in.
;
exten => s,1,Wait(6) ; Wait a second, just for fun
exten => s,2,DIAL(SIP/651)
exten => s,3,Hangup
[default]
include => demo
[ipfon-outgoing]
exten => h,1,Hangup
exten => t,1,Hangup
exten => _X.,1,Dial(SIP/${EXTEN}@sip.ipfon.pl)
exten => _X.,2,Hangup
--------------------------------
sip.conf:
[general]
context=default ; Default context for incoming calls
allowoverlap=no ; Disable overlap dialing support. (Default is yes)
bindport=5060 ; UDP Port to bind to (SIP standard port is 5060)
bindaddr=0.0.0.0 ; IP address to bind to (0.0.0.0 binds to all)
srvlookup=yes ; Enable DNS SRV lookups on outbound calls
disallow=gsm
allow=ulaw
register => moj_user:moj_passs@sip.ipfon.pl
[651]
type=friend ; Friends place calls and receive calls
regexten=651
context=ipfon-outgoing
secret=blah
language=en ; Use German prompts for this user
host=dynamic ; This peer register with us
callerid=przykladowe id <651>
username=651 ; Username to use in INVITE until peer registers
mailbox=651@default ; Mailboxes for message waiting indicator
restrictcid=yes ; To have the callerid restriced -> sent as ANI
disallow=all
allow=ulaw ; dtmfmode=inband only works with ulaw or alaw!
allow=alaw
allow=gsm ; dfdf
canreinvite=yes ; allow RTP voice traffic to bypass Asterisk
pickupgroup=1
callgroup=1
Reszta konfigow jest defaultowa tj. powstala po wykonaniu make samples.
a oto co mi zglasza sie w konsoli:
-- Executing [moj_numer@ipfon-outgoing:1] Dial("SIP/651-081be118", "SIP/moj_numer@sip.ipfon.pl") in new stack
-- Called
moj_numer@sip.ipfon.pl[Dec 27 19:47:46] WARNING[6544]: chan_sip.c:11843 handle_response_invite: Received response: "Forbidden" from '"przykladowe id" <sip:651@moj_host>;tag=as56299b7c'
-- SIP/sip.ipfon.pl-081c4968 is circuit-busy
== Everyone is busy/congested at this time (1:0/1/0)
-- Executing [moj_numer@ipfon-outgoing:2] Hangup("SIP/651-081be118", "") in new stack
== Spawn extension (ipfon-outgoing, moj_numer, 2) exited non-zero on 'SIP/651-081be118'
-- Executing [h@ipfon-outgoing:1] Hangup("SIP/651-081be118", "") in new stack
== Spawn extension (ipfon-outgoing, h, 1) exited non-zero on 'SIP/651-081be118'
[Dec 27 19:50:03] WARNING[6544]: chan_sip.c:12035 handle_response_register: Got 200 OK on REGISTER that isn't a register
P.S. po dodatkowych testach okazało sie ze dzwoniąc z telefonu komórkowego na numer otrzymany z ipfonu, a dalej przekierowany na 651 czyli soft phone (X-talk) zgłasza ze dzwonie i wyświetla numer komórki, ale po naciśnięciu na zielona słuchawkę otrzymuje co poniżej:
-- Executing [s@default:1] Wait("SIP/213.218.117.67-081c59d8", "6") in new stack
-- Executing [s@default:2] Dial("SIP/213.218.117.67-081c59d8", "SIP/651") in new stack
-- Called 651
-- SIP/651-081c9288 is ringing
-- Call on SIP/651-081c9288 left from hold
-- SIP/651-081c9288 answered SIP/213.218.117.67-081c59d8
-- Native bridging SIP/213.218.117.67-081c59d8 and SIP/651-081c9288
[Dec 27 20:08:47] NOTICE[6544]: chan_sip.c:11831 handle_response_invite: Failed to authenticate on INVITE to '<sip:moj_numer_z_ipfonu@213.218.117.66>;tag=as1df139ba'
== Spawn extension (default, s, 2) exited non-zero on 'SIP/213.218.117.67-081c59d8'
Pozdrawiam.