asterisk

Please note that before dialing the number, you must enter the prefix '00' or '+'!
Connect the asterisk to t-pbx as follows:

username - <USERNAME received at registration>
password - <PASSWORD received at registration>


/etc/asterisk/sip.conf

register => username:password@t-pbx.net

[tt-tpbx]
type=peer
username=username
secret=password
fromuser=username
fromdomain=t-pbx.net
host=t-pbx.net
nat=no
;canreinvite=yes ; asterisk version 1.2+
directmedia=yes ; asterisk version 1.8+
dtmfmode=rfc2833
qualify=500
disallow=all
allow=alaw
allow=ulaw
allow=g729
context=context

> sip show registry
Host                            Username       Refresh State               
t-pbx.net:5060           username       45         Registered  

/etc/asterisk/extensions.conf

exten => QQQQQ,1,Dial(SIP/007812ZZZZZZZ@tt-tpbx,,g)
exten => QQQQQ,n,Hangup

    -- Executing Dial("SIP/XXXXX-29c2", "SIP/007812ZZZZZZZ@tt-tpbx||g") in new stack
    -- Called 007812ZZZZZZZ@tt-tpbx
    -- SIP/tt-569a is making progress passing it to SIP/XXXXX-29c2
    -- SIP/tt-569a is making progress passing it to SIP/XXXXX-29c2
    -- SIP/tt-569a is ringing
    -- SIP/tt-569a is making progress passing it to SIP/XXXXX-29c2
    -- SIP/tt-569a answered SIP/XXXXX-29c2
    -- Executing Hangup("SIP/XXXXX-29c2", "") in new stack
  == Spawn extension (default, QQQQQ, 2) exited non-zero on 'SIP/XXXXX-29c2'