How to call the mobile phone through asterisk?

I want the sipphone registered on the asterisk to call the mobile phone.
I have tried these 2 methods below,but something wrong.

notice:
I have an account (A)accompanying with the password § and IPPBX server IP address( I), which can call the mobile phone by X-lite

1> I configure the asterisk through asterisk-gui.
1.1, I have set up a trunk ,of which Hostname is I (above) , username is A (above) and password is P (above).

 1.2 , then based on the trunk ,I set rule , dialplan and user. After that, by clicking the System status (gui 1.2) , I find the trunk register successfully , but unfortunately, the user on the asterisk can not call the mobile phone.
    however. through the same way , I can register the local brekeke sip server and can call the user on the brekeke sip server. 

2> I directly configure the sip.conf and extensions.conf
2.1, I add a statement “register=>username:password@sip server ip address” in the session ‘general’, and modify the extension in the extencions.conf below, “exten => _XXXX,1,dial(sip/${EXTEN}@sip server ip address)”.however, when I call the mobile phone, it works beyond what I want. it can not call the mobile phone. using the same way to connect the brekeke sip server, it works fine.

now I have no idea to go ahead , and I appreciate someone can give an idea for the following step.

hello,happy a new day.

so sad that no one can give me a tip.
I hope that anyone can tell me a little how to do, because such function is an urgent thing.
thank you.

There isn’t enough information. You need to provide dialplan fragments and console traces, and may need to provide SIP traces.

Also, the reference to a mobile phone is confusing. Your problem looks like one of simply using an external SIP provider; that is something I haven’t needed to do, but if you need to do it, it would be considered a very trivial use of Asterisk.

If you are using Asterisk 1.2, you are using a version that is no longer officially supported.

thanks for your reply

here is my configuration

sip.conf

[general]
context=default
allowoverlap=no
bindport=5060
bindaddr=0.0.0.0
srvlookup=yes
register => 2003:*****@61.235.77.119
nat=yes
pedantic=yes

[serverC]
type=peer
username=2003
secret=*****
host=61.235.77.119

[110]
type=friend
secret=123456
qualify=yes
nat=yes
host=dynamic
canreinvite=no
context=outbound

extension.conf

[default]
exten => _XXX,1,playback(auth-thankyou)
exten => _XXX,2,Dial(sip/${EXTEN})

[outbound]
exten => _0XXXXXXXXXXX,1,Playback(auth-thankyou)
exten => _0XXXXXXXXXXX,2,Dial(SIP/${EXTEN:1}@serverC)

and the log is that
<------------->
— (14 headers 0 lines) —
Creating new subscription
Sending to 192.168.3.240 : 5060 (NAT)
Found peer '110’
Looking for 110 in outbound (domain 192.168.3.112)

<— Transmitting (NAT) to 192.168.3.240:5060 —>
SIP/2.0 406 Not Acceptable
Via: SIP/2.0/UDP 192.168.3.240:5060;branch=z9hG4bKa2276dcc9e;received=192.168.3.240;rport=5060
From: sip:110@192.168.3.112;tag=48789c2e
To: sip:110@192.168.3.112;tag=as03499a06
Call-ID: 6c42f27b1f3da0c40705b3e20764be08@192.168.3.240
CSeq: 819 SUBSCRIBE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Content-Length: 0

<------------->
— (14 headers 0 lines) —
Creating new subscription
Sending to 192.168.3.240 : 5060 (NAT)
Found peer ‘110’

<— Transmitting (NAT) to 192.168.3.240:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.3.240:5060;branch=z9hG4bKa2276dcc9e;received=192.168.3.240;rport=5060
From: sip:110@192.168.3.112;tag=48789c2e
To: sip:110@192.168.3.112;tag=as35b01caf
Call-ID: 6c42f27b1f3da0c40705b3e20764be08@192.168.3.240
CSeq: 820 SUBSCRIBE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
WWW-Authenticate: Digest algorithm=MD5, realm=“asterisk”, nonce="7e5bac84"
Content-Length: 0

finally,my computer is in the LAN.

if anyone know something about solution, please tell me , thank you.

today such tough problem I think has been solved.
the main barrier is the Iternet sip server,not my configuration.
my configuration is right.
:laughing: