Trouble receiving calls

Hi,

I’m having some issues receiving calls to my new asterisk box, and was hoping that someone would be able to help me out. I am using the localphone.com service, and have set up the correct account to receive calls. When I dial my number, I receive calls into my asterisk box, however all I get is a beep tone instead of what I am expecting. Here is sip.conf:

[1234]
type=friend
callerid=1234
host=dynamic
canreinvite=no
secret=secret
dtmfmode=rfc2833
context=localphone-in
context=localphone-out
qualify=yes

[localphone]
type = friend
nat = no
canreinvite = no
authuser = {SIP ID}
username = {SIP ID}
fromuser = {SIP ID}
fromdomain = localphone.com
secret = {SIP SECRET}
host = localphone.com
dtmfmode = rfc2833
context = localphone-in ;extensions.conf context for inbound calls
;context = localphone-out
disallow = all
allow = ulaw
allow = alaw
allow = gsm

And here is my extensions.conf:

; default if one hasn’t been set.
exten => _X.,n,SayUnixTime(${FUTURETIME},${timezone},HNS)
exten => _X.,n,Playback(spy-local)
exten => _X.,n,WaitUntil(${FUTURETIME})
exten => _X.,n,Playback(beep)
exten => _X.,n,Return()

;
; ANI context: use in the same way as “time” above
;

[ani]
exten => _X.,40000(ani),NoOp(ANI: ${EXTEN})
exten => _X.,n,Wait(0.25)
exten => _X.,n,Answer()
exten => _X.,n,Playback(vm-from)
exten => _X.,n,SayDigits(${CALLERID(ani)})
exten => _X.,n,Wait(1.25)
exten => _X.,n,SayDigits(${CALLERID(ani)}) ; playback again in case of missed digit
exten => _X.,n,Return()

; For more information on applications, just type “core show applications” at your
; friendly Asterisk CLI prompt.
;
; "core show application " will show details of how you
; use that particular application in this file, the dial plan.
; “core show functions” will list all dialplan functions
; "core show function " will show you more information about
; one function. Remember that function names are UPPER CASE.
;[default]
;exten => *98,1,VoiceMailMain
;exten => *98,2,Hangup

[localphone-in]
;exten => 2002286,1,VoiceMailMain ; phone must be registered
;exten => 2002286,2,Hangup
;exten => 442895060760,1,VoiceMailMain
;exten => 442895060760,2,Hangup
;exten => 00158270289506076,1,VoiceMailMain
;exten => 00158270289506076,2,Hangup
;exten => 001582702895060760,1,VoiceMailMain
;exten => 001582702895060760,2,Hangup
;exten => 001582702895060760@213.166.9.4,1,VoiceMailMain
;exten => 001582702895060760@213.166.9.4,2,Hangup
exten => _X.,n.NoOp()
exten => _X.,1,VoiceMailMain
exten => 02895060760,1,VoiceMailMain
exten => 02895060760,2,Hangup

[localphone-out]
exten => _9.,1,Dial(SIP/${EXTEN:1}@localphone,30,tr)
exten => _9.,2,Playback(invalid)
exten => _9.,3,Hangup

I assume it should be getting into the localphone-in context, and have tried all kinds of numbers in there to try and make it work. Here is some output that I think might be related to the issue from setting debug on in the cli:

v=0
o=bandx-msw3 48736 245341 IN IP4 95.211.119.239
s=sip call
c=IN IP4 95.211.119.239
t=0 0
m=audio 42838 RTP/AVP 0 8 18 101
a=rtpmap:0 pcmu/8000/1
a=ptime:20
a=rtpmap:8 pcma/8000/1
a=rtpmap:18 g729/8000/1
a=rtpmap:101 telephone-event/8000/1
a=sendrecv
a=nortpproxy:yes
<------------->
— (18 headers 13 lines) —
Sending to 94.75.247.45:5060 (no NAT)
Using INVITE request as basis request - 15796774-3523039559-477384@bandx-msw3.band-x.com
Found peer ‘localphone’ for ‘’ from 94.75.247.45:5060

<— Reliably Transmitting (no NAT) to 94.75.247.45:5060 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 94.75.247.45;branch=z9hG4bK9e8f.987730c1.0;received=94.75.247.45
Via: SIP/2.0/UDP 213.166.9.4:5060;rport=5060;branch=z9hG4bK89731826fb04a6dfe9a62c61331ef65f
From: <sip:@213.166.9.4>;tag=3523039559-477389
To: sip:001582702895060760@213.166.9.4;tag=as34622d1e
Call-ID: 15796774-3523039559-477384@bandx-msw3.band-x.com
CSeq: 2 INVITE
Server: Asterisk PBX 1.8.5.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm=“asterisk”, nonce="47ba442d"
Content-Length: 0

<------------>
Scheduling destruction of SIP dialog '15796774-3523039559-477384@bandx-msw3.band-x.com’ in 32000 ms (Method: INVITE)

<— SIP read from UDP:94.75.247.45:5060 —>
ACK sip:@10.56.69.201:5060 SIP/2.0
Via: SIP/2.0/UDP 94.75.247.45;branch=z9hG4bK9e8f.987730c1.0
From: <sip:@213.166.9.4>;tag=3523039559-477389
Call-ID: 15796774-3523039559-477384@bandx-msw3.band-x.com
To: sip:001582702895060760@213.166.9.4;tag=as34622d1e
CSeq: 2 ACK
User-Agent: OpenSER (1.2.2-notls (i386/linux))
Content-Length: 0

Does anyone have any thoughts on what is going wrong here?

Two remarks for the definition of localphone (not related to Your problem, just for info):

canreinvite = no

should be

directmedia=no

instead.
And probably You should add a

insecure=port,invite

for testing.
Your problem: The sip-dialog looks not so bad, but to dig deeper into the problem You should provide the output of the dialplanlogic executed when receiving a call by setting verbosity to a minimum of 3 (core set verbose 3).
From the configuration side the call should end up in localphone-in with starting VoiceMailMain (for a undefined extension/target, thats bad) after issuing the NoOp. I don’t know if this is Your intention, but it’s the active configuration which should be issued according to Your dial plan.

SIP service providers don’t normally register with their users. They normally need to be set up with static addresses.

Your trace shows that they do not know how to authenticate to you. You need a sip.conf entry headed:

[]

for a start, if you are not matching by IP address.

Assuming their service is intended for PABX use, ask them what their suggested configuration for Asterisk should be.

You have two contexts for 1234 and you have a n line before a 1 line in the dialplan.

NB. Whilst you may end up needing insecure=invite, you should not use insecure=port, invite unless you really know why you are doing it, and you should not use insecure at all, unless you are sure you need it. insecure=port,invite is used as a magic incantation, but it is called insecure because it reduces the security of your system against toll fraud.

Hi, i think you first need to change the lines

exten => _X.,n.NoOp()
exten => _X.,1,VoiceMailMain

By

exten => _X.,1,NoOp()
exten => _X.,n,VoiceMailMain

And too in the sip.con file allow g729 codec because i see in the trace the carrier accept this and not gsm that you are allowing in your configuration.

add the line:

allow = g729

Try again and post your cli and debug results.

I think the first error is harmless. G.729 requires G.729 licences, except in limited circumstance. Codec mismatches are not causing his problems, and understanding the limitations of G.729 pass through mode will be an unnecessary complication to the learning process.

Thanks for all the help guys, I dont have a chance to test this right now, however I’ll be testing it later today.

Just a couple of things I want to clarify

should there be anything else after this entry? Do I need to move the stuff from [localphone] to this entry?

This is the guide I got from my provider to setup the service:

help.localphone.com/voip/devices … e/asterisk

I thought I had followed that correctly, is there a mistake in the guide maybe?

They have a static IP address (you have “dynamic”).

They have insecure=port,invite (in its old form) - although, as noted above, the port is almost certainly redundant, and, as this is security sensitive, should be removed. You don’t have this option at all.

They should have used peer, not friend (anyone can masquerade as them with their configuration).

I think they had the canreinvite = no, which should be directmedia = no, for current Asterisk versions.

It is just possible that insecures = port is needed, but much more likely that they are being lazy.

Thanks so much for the help guys, that has gotten me sorted, it is now making the call correctly. Just so I can learn, where was the error? I removed the 1234 user, was it something to do with that? Here is what my sip.conf looks like now:

[localphone]
type = peer
nat = no
directmedia = no
insecure = invite
authuser = sipid
username = sipid
fromuser = sipid
fromdomain = localphone.com
secret = secret
host = localphone.com
dtmfmode = rfc2833
context = localphone-in ;extensions.conf context for inbound calls
;context = localphone-out
disallow = all
allow = ulaw
allow = alaw
allow = gsm

and extensions.conf:

[localphone-in]
exten => _X.,1,NoOp()
exten => _X.,n,Dial(SIP/homenumber@localphone,30,tr)

[localphone-out]
exten => _9.,1,Dial(SIP/${EXTEN:1}@localphone,30,tr)
exten => _9.,2,Playback(invalid)
exten => _9.,3,Hangup

The only issue I have now is that when I make a call, it directs to my home phone ok, and the call seems to be connected, however there is no sound from either end. Should I open a new topic about this?

Thanks again for all the help, amazing forum you have going on here, so fast!

Follow up with some debug info, gleaned the commands from a different topic:

CLI> rtp set debug on
RTP Debugging Enabled
== Using SIP RTP CoS mark 5
– Executing [sipid@localphone-in:1] NoOp(“SIP/localphone-00000009”, “”) in new stack
– Executing [sipid@localphone-in:2] Dial(“SIP/localphone-00000009”, “SIP/homenumber@localphone,30,tr”) in new stack
== Using SIP RTP CoS mark 5
– Called SIP/homenumber@localphone
– SIP/localphone-0000000a is ringing
– SIP/localphone-0000000a is making progress passing it to SIP/localphone-00000009
– SIP/localphone-0000000a answered SIP/localphone-00000009
CLI> rtp set debug off

This was when I was speaking and the call was connected, should there be more information here?

Here is the output when I sip set debug on and place the call:

SIP Debugging enabled

<--- SIP read from UDP:94.75.247.45:5060 --->
INVITE sip:<sipid>@10.56.69.201:5060 SIP/2.0
Record-Route: <sip:94.75.247.45;lr=on;ftag=3523118346-597104>
Max-Forwards: 12
Session-Expires: 3600;refresher=uac
Min-SE: 600
Supported: timer
To: <sip:<diallednumber>@213.166.9.4>
From: <sip:<mobile>@213.166.9.4>;tag=3523118346-597104
Remote-Party-Id: <sip:<mobile>@213.166.9.4>;privacy=off;screen=yes
Call-ID: 16069301-3523118346-597098@bandx-msw3.band-x.com
CSeq: 1 INVITE
Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER, SUBSCRIBE, PRACK, UPDATE, MESSAGE, PUBLISH
Via: SIP/2.0/UDP 94.75.247.45;branch=z9hG4bK363e.75840192.0
Via: SIP/2.0/UDP 213.166.9.4:5060;rport=5060;branch=z9hG4bK072557993cfef7d812e3fcb6c12c14b7
Contact: <sip:<mobile>@213.166.9.4:5060>
Call-Info: <sip:213.166.9.4>;method="NOTIFY;Event=telephone-event;Duration=1000"
Content-Type: application/sdp
Content-Length: 283

v=0
o=bandx-msw3 63774 63774 IN IP4 95.211.119.239
s=sip call
c=IN IP4 95.211.119.239
t=0 0
m=audio 35710 RTP/AVP 0 8 18 101
a=rtpmap:0 pcmu/8000/1
a=ptime:20
a=rtpmap:8 pcma/8000/1
a=rtpmap:18 g729/8000/1
a=rtpmap:101 telephone-event/8000/1
a=sendrecv
a=nortpproxy:yes
<------------->
--- (18 headers 13 lines) ---
Sending to 94.75.247.45:5060 (no NAT)
Using INVITE request as basis request - 16069301-3523118346-597098@bandx-msw3.band-x.com
Found peer 'localphone' for '<mobile>' from 94.75.247.45:5060
  == Using SIP RTP CoS mark 5
Found RTP audio format 0
Found RTP audio format 8
Found RTP audio format 18
Found RTP audio format 101
Found audio description format pcmu for ID 0
Found audio description format pcma for ID 8
Found audio description format g729 for ID 18
Found audio description format telephone-event for ID 101
Capabilities: us - 0x10e (gsm|ulaw|alaw|g729), peer - audio=0x10c (ulaw|alaw|g729)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0x10c (ulaw|alaw|g729)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 95.211.119.239:35710
Looking for <sipid> in localphone-in (domain 10.56.69.201:5060)
list_route: hop: <sip:94.75.247.45;lr=on;ftag=3523118346-597104>

<--- Transmitting (no NAT) to 94.75.247.45:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 94.75.247.45;branch=z9hG4bK363e.75840192.0;received=94.75.247.45
Via: SIP/2.0/UDP 213.166.9.4:5060;rport=5060;branch=z9hG4bK072557993cfef7d812e3fcb6c12c14b7
Record-Route: <sip:94.75.247.45;lr=on;ftag=3523118346-597104>
From: <sip:<mobile>@213.166.9.4>;tag=3523118346-597104
To: <sip:<diallednumber>@213.166.9.4>
Call-ID: 16069301-3523118346-597098@bandx-msw3.band-x.com
CSeq: 1 INVITE
Server: Asterisk PBX 1.8.5.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Session-Expires: 1800;refresher=uac
Contact: <sip:<sipid>@10.56.69.201:5060>
Content-Length: 0


<------------>
    -- Executing [<sipid>@localphone-in:1] NoOp("SIP/localphone-0000000b", "") in new stack
    -- Executing [<sipid>@localphone-in:2] Dial("SIP/localphone-0000000b", "SIP/<homenumber>@localphone,30,tr") in new stack
  == Using SIP RTP CoS mark 5
Audio is at 5060
Adding codec 0x4 (ulaw) to SDP
Adding codec 0x8 (alaw) to SDP
Adding codec 0x2 (gsm) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (no NAT) to 94.75.247.45:5060:
INVITE sip:<homenumber>@localphone.com SIP/2.0
Via: SIP/2.0/UDP 10.56.69.201:5060;branch=z9hG4bK199f1469
Max-Forwards: 70
From: "<mobile>" <sip:<sipid>@localphone.com>;tag=as3c39942f
To: <sip:<homenumber>@localphone.com>
Contact: <sip:<sipid>@10.56.69.201:5060>
Call-ID: 43e5579521151f1672ce2eb96f8af9f4@localphone.com
CSeq: 102 INVITE
User-Agent: Asterisk PBX 1.8.5.0
Date: Tue, 23 Aug 2011 19:59:06 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 310

v=0
o=root 1147797026 1147797026 IN IP4 10.56.69.201
s=Asterisk PBX 1.8.5.0
c=IN IP4 10.56.69.201
t=0 0
m=audio 15028 RTP/AVP 0 8 3 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

---
    -- Called SIP/<homenumber>@localphone

<--- Transmitting (no NAT) to 94.75.247.45:5060 --->
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 94.75.247.45;branch=z9hG4bK363e.75840192.0;received=94.75.247.45
Via: SIP/2.0/UDP 213.166.9.4:5060;rport=5060;branch=z9hG4bK072557993cfef7d812e3fcb6c12c14b7
Record-Route: <sip:94.75.247.45;lr=on;ftag=3523118346-597104>
From: <sip:<mobile>@213.166.9.4>;tag=3523118346-597104
To: <sip:<diallednumber>@213.166.9.4>;tag=as5f63ed80
Call-ID: 16069301-3523118346-597098@bandx-msw3.band-x.com
CSeq: 1 INVITE
Server: Asterisk PBX 1.8.5.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Session-Expires: 1800;refresher=uac
Contact: <sip:<sipid>@10.56.69.201:5060>
Content-Length: 0


<------------>

<--- SIP read from UDP:94.75.247.45:5060 --->
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/UDP 10.56.69.201:5060;branch=z9hG4bK199f1469;rport=5060;received=<publicip>
From: "<mobile>" <sip:<sipid>@localphone.com>;tag=as3c39942f
To: <sip:<homenumber>@localphone.com>;tag=9399de1ef8c379d4c914a855a096e8ba.d8d4
Call-ID: 43e5579521151f1672ce2eb96f8af9f4@localphone.com
CSeq: 102 INVITE
Proxy-Authenticate: Digest realm="localphone.com", nonce="4e5407b6bf0c67d13e30f8f492d8c9bdea6706d5"
Server: OpenSER (1.2.2-notls (i386/linux))
Content-Length: 0

<------------->
--- (9 headers 0 lines) ---
Transmitting (no NAT) to 94.75.247.45:5060:
ACK sip:<homenumber>@localphone.com SIP/2.0
Via: SIP/2.0/UDP 10.56.69.201:5060;branch=z9hG4bK199f1469
Max-Forwards: 70
From: "<mobile>" <sip:<sipid>@localphone.com>;tag=as3c39942f
To: <sip:<homenumber>@localphone.com>;tag=9399de1ef8c379d4c914a855a096e8ba.d8d4
Contact: <sip:<sipid>@10.56.69.201:5060>
Call-ID: 43e5579521151f1672ce2eb96f8af9f4@localphone.com
CSeq: 102 ACK
User-Agent: Asterisk PBX 1.8.5.0
Content-Length: 0


---
Audio is at 5060
Adding codec 0x4 (ulaw) to SDP
Adding codec 0x8 (alaw) to SDP
Adding codec 0x2 (gsm) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (no NAT) to 94.75.247.45:5060:
INVITE sip:<homenumber>@localphone.com SIP/2.0
Via: SIP/2.0/UDP 10.56.69.201:5060;branch=z9hG4bK3f9f6eaf
Max-Forwards: 70
From: "<mobile>" <sip:<sipid>@localphone.com>;tag=as3c39942f
To: <sip:<homenumber>@localphone.com>
Contact: <sip:<sipid>@10.56.69.201:5060>
Call-ID: 43e5579521151f1672ce2eb96f8af9f4@localphone.com
CSeq: 103 INVITE
User-Agent: Asterisk PBX 1.8.5.0
Proxy-Authorization: Digest username="<sipid>", realm="localphone.com", algorithm=MD5, uri="sip:<homenumber>@localphone.com", nonce="4e5407b6bf0c67d13e30f8f492d8c9bdea6706d5", response="e945bb9049aab85e03e2994b12e384f1"
Date: Tue, 23 Aug 2011 19:59:06 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 310

v=0
o=root 1147797026 1147797027 IN IP4 10.56.69.201
s=Asterisk PBX 1.8.5.0
c=IN IP4 10.56.69.201
t=0 0
m=audio 15028 RTP/AVP 0 8 3 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

---

<--- SIP read from UDP:94.75.247.45:5060 --->
SIP/2.0 100 Giving a try...
Via: SIP/2.0/UDP 10.56.69.201:5060;branch=z9hG4bK3f9f6eaf;rport=5060;received=<publicip>
From: "<mobile>" <sip:<sipid>@localphone.com>;tag=as3c39942f
To: <sip:<homenumber>@localphone.com>
Call-ID: 43e5579521151f1672ce2eb96f8af9f4@localphone.com
CSeq: 103 INVITE
Server: OpenSER (1.2.2-notls (i386/linux))
Content-Length: 0

<------------->
--- (8 headers 0 lines) ---

<--- SIP read from UDP:94.75.247.45:5060 --->
OPTIONS sip:<publicip>:5060 SIP/2.0
Via: SIP/2.0/UDP 94.75.247.45:5060;branch=0
From: sip:pinger@localphone.com;tag=2b9a0396
To: sip:<publicip>:5060
Call-ID: 95ad5523-f09b7652-2e7f52@94.75.247.45
CSeq: 1 OPTIONS
Content-Length: 0

<------------->
--- (7 headers 0 lines) ---
Looking for s in default (domain <publicip>:5060)

<--- Transmitting (no NAT) to 94.75.247.45:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 94.75.247.45:5060;branch=0;received=94.75.247.45
From: sip:pinger@localphone.com;tag=2b9a0396
To: sip:<publicip>:5060;tag=as03bf5acc
Call-ID: 95ad5523-f09b7652-2e7f52@94.75.247.45
CSeq: 1 OPTIONS
Server: Asterisk PBX 1.8.5.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Contact: <sip:10.56.69.201:5060>
Accept: application/sdp
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '95ad5523-f09b7652-2e7f52@94.75.247.45' in 32000 ms (Method: OPTIONS)
Really destroying SIP dialog '95ad5523-a12b7652-4c7f52@94.75.247.45' Method: OPTIONS

<--- SIP read from UDP:94.75.247.45:5060 --->
SIP/2.0 180 Ringing
Record-Route: <sip:94.75.247.53;lr=on;ftag=lp-2k9-4e52df77-00004c67-00002ae7R34581ee6.a;did=597.f0954465>
Record-Route: <sip:94.75.247.44;lr=on>
Record-Route: <sip:95.211.119.245;lr=on;ftag=as3c39942f>
Record-Route: <sip:94.75.247.45;lr=on;ftag=as3c39942f;an=YWJjRENCMzg4KSMoPTo2FWlaNj48LXtVYWEGaiYpXA-->
Via: SIP/2.0/UDP 10.56.69.201:5060;rport=5060;received=<publicip>;branch=z9hG4bK3f9f6eaf
From: "<mobile>" <sip:<sipid>@localphone.com>;tag=as3c39942f
To: <sip:<homenumber>@localphone.com>;tag=lp-2k9-4e52df77-00004c67-00002ae7R34581ee6.b
Call-ID: 43e5579521151f1672ce2eb96f8af9f4@localphone.com
CSeq: 103 INVITE
Content-Type: application/sdp
Allow: INVITE,ACK,CANCEL,BYE,REGISTER,REFER,INFO,SUBSCRIBE,NOTIFY,PRACK,UPDATE,OPTIONS
Contact: <sip:94.75.247.29:5060;transport=udp>
Server: OpenSIPS (1.6.4-2-notls (x86_64/linux))
Content-Length: 257

v=0
o=Sonus_UAC 8851 26673 IN IP4 95.211.119.239
s=SIP Media Capabilities
c=IN IP4 95.211.119.239
t=0 0
m=audio 51480 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
a=maxptime:10
a=nortpproxy:yes
<------------->
--- (15 headers 12 lines) ---
Found RTP audio format 0
Found RTP audio format 101
Found audio description format PCMU for ID 0
Found audio description format telephone-event for ID 101
Capabilities: us - 0x10e (gsm|ulaw|alaw|g729), peer - audio=0x4 (ulaw)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0x4 (ulaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 95.211.119.239:51480
    -- SIP/localphone-0000000c is ringing

<--- Transmitting (no NAT) to 94.75.247.45:5060 --->
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 94.75.247.45;branch=z9hG4bK363e.75840192.0;received=94.75.247.45
Via: SIP/2.0/UDP 213.166.9.4:5060;rport=5060;branch=z9hG4bK072557993cfef7d812e3fcb6c12c14b7
Record-Route: <sip:94.75.247.45;lr=on;ftag=3523118346-597104>
From: <sip:<mobile>@213.166.9.4>;tag=3523118346-597104
To: <sip:<diallednumber>@213.166.9.4>;tag=as5f63ed80
Call-ID: 16069301-3523118346-597098@bandx-msw3.band-x.com
CSeq: 1 INVITE
Server: Asterisk PBX 1.8.5.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Session-Expires: 1800;refresher=uac
Contact: <sip:<sipid>@10.56.69.201:5060>
Content-Length: 0


<------------>
    -- SIP/localphone-0000000c is making progress passing it to SIP/localphone-0000000b

<--- SIP read from UDP:94.75.247.45:5060 --->
SIP/2.0 200 OK
Record-Route: <sip:94.75.247.53;lr=on;ftag=lp-2k9-4e52df77-00004c67-00002ae7R34581ee6.a;did=597.f0954465>
Record-Route: <sip:94.75.247.44;lr=on>
Record-Route: <sip:95.211.119.245;lr=on;ftag=as3c39942f>
Record-Route: <sip:94.75.247.45;lr=on;ftag=as3c39942f;an=YWJjRENCMzg4KSMoPTo2FWlaNj48LXtVYWEGaiYpXA-->
Via: SIP/2.0/UDP 10.56.69.201:5060;rport=5060;received=<publicip>;branch=z9hG4bK3f9f6eaf
From: "<mobile>" <sip:<sipid>@localphone.com>;tag=as3c39942f
To: <sip:<homenumber>@localphone.com>;tag=lp-2k9-4e52df77-00004c67-00002ae7R34581ee6.b
Call-ID: 43e5579521151f1672ce2eb96f8af9f4@localphone.com
CSeq: 103 INVITE
Content-Type: application/sdp
Supported: timer,replaces
Allow: INVITE,ACK,CANCEL,BYE,REGISTER,REFER,INFO,SUBSCRIBE,NOTIFY,PRACK,UPDATE,OPTIONS
Session-Expires: 1800;refresher=uas
Contact: <sip:94.75.247.29:5060;transport=udp>
Server: OpenSIPS (1.6.4-2-notls (x86_64/linux))
Content-Length: 257

v=0
o=Sonus_UAC 8851 26673 IN IP4 95.211.119.239
s=SIP Media Capabilities
c=IN IP4 95.211.119.239
t=0 0
m=audio 51480 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
a=maxptime:10
a=nortpproxy:yes
<------------->
--- (17 headers 12 lines) ---
list_route: hop: <sip:94.75.247.45;lr=on;ftag=as3c39942f;an=YWJjRENCMzg4KSMoPTo2FWlaNj48LXtVYWEGaiYpXA-->
list_route: hop: <sip:95.211.119.245;lr=on;ftag=as3c39942f>
list_route: hop: <sip:94.75.247.44;lr=on>
list_route: hop: <sip:94.75.247.53;lr=on;ftag=lp-2k9-4e52df77-00004c67-00002ae7R34581ee6.a;did=597.f0954465>
set_destination: Parsing <sip:94.75.247.45;lr=on;ftag=as3c39942f;an=YWJjRENCMzg4KSMoPTo2FWlaNj48LXtVYWEGaiYpXA--> for address/port to send to
set_destination: set destination to 94.75.247.45:5060
Transmitting (no NAT) to 94.75.247.45:5060:
ACK sip:94.75.247.29:5060;transport=udp SIP/2.0
Via: SIP/2.0/UDP 10.56.69.201:5060;branch=z9hG4bK4c3fa5d2
Route: <sip:94.75.247.45;lr=on;ftag=as3c39942f;an=YWJjRENCMzg4KSMoPTo2FWlaNj48LXtVYWEGaiYpXA-->,<sip:95.211.119.245;lr=on;ftag=as3c39942f>,<sip:94.75.247.44;lr=on>,<sip:94.75.247.53;lr=on;ftag=lp-2k9-4e52df77-00004c67-00002ae7R34581ee6.a;did=597.f0954465>
Max-Forwards: 70
From: "<mobile>" <sip:<sipid>@localphone.com>;tag=as3c39942f
To: <sip:<homenumber>@localphone.com>;tag=lp-2k9-4e52df77-00004c67-00002ae7R34581ee6.b
Contact: <sip:<sipid>@10.56.69.201:5060>
Call-ID: 43e5579521151f1672ce2eb96f8af9f4@localphone.com
CSeq: 103 ACK
User-Agent: Asterisk PBX 1.8.5.0
Content-Length: 0


---
    -- SIP/localphone-0000000c answered SIP/localphone-0000000b
Audio is at 5060
Adding codec 0x4 (ulaw) to SDP
Adding codec 0x8 (alaw) to SDP
Adding codec 0x100 (g729) to SDP
Adding non-codec 0x1 (telephone-event) to SDP

<--- Reliably Transmitting (no NAT) to 94.75.247.45:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 94.75.247.45;branch=z9hG4bK363e.75840192.0;received=94.75.247.45
Via: SIP/2.0/UDP 213.166.9.4:5060;rport=5060;branch=z9hG4bK072557993cfef7d812e3fcb6c12c14b7
Record-Route: <sip:94.75.247.45;lr=on;ftag=3523118346-597104>
From: <sip:<mobile>@213.166.9.4>;tag=3523118346-597104
To: <sip:<diallednumber>@213.166.9.4>;tag=as5f63ed80
Call-ID: 16069301-3523118346-597098@bandx-msw3.band-x.com
CSeq: 1 INVITE
Server: Asterisk PBX 1.8.5.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Session-Expires: 1800;refresher=uac
Contact: <sip:<sipid>@10.56.69.201:5060>
Content-Type: application/sdp
Content-Length: 330

v=0
o=root 28865690 28865690 IN IP4 10.56.69.201
s=Asterisk PBX 1.8.5.0
c=IN IP4 10.56.69.201
t=0 0
m=audio 16140 RTP/AVP 0 8 18 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

<------------>

<--- SIP read from UDP:94.75.247.45:5060 --->
ACK sip:<sipid>@<publicip>:5060 SIP/2.0
Max-Forwards: 12
To: <sip:<diallednumber>@213.166.9.4>;tag=as5f63ed80
From: <sip:<mobile>@213.166.9.4>;tag=3523118346-597104
Call-ID: 16069301-3523118346-597098@bandx-msw3.band-x.com
CSeq: 1 ACK
Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER, SUBSCRIBE, PRACK, UPDATE, MESSAGE, PUBLISH
Via: SIP/2.0/UDP 94.75.247.45;branch=z9hG4bK363e.75840192.2
Via: SIP/2.0/UDP 213.166.9.4:5060;rport=5060;branch=z9hG4bK7ee3ac5527fc1ad889100c8783d3036f
Contact: <sip:<mobile>@213.166.9.4:5060>
Content-Length: 0

<------------->
--- (11 headers 0 lines) ---

<--- SIP read from UDP:<homeip>:6676 --->


<------------->

<--- SIP read from UDP:<homeip>:6676 --->
SUBSCRIBE sip:1234@<publicip> SIP/2.0
Via: SIP/2.0/UDP <homeip>:6676;branch=z9hG4bK-d8754z-1dd51c515f8ad227-1---d8754z-;rport
Max-Forwards: 70
Contact: <sip:1234@<homeip>:6676>
To: "Rob Elkin"<sip:1234@<publicip>>
From: "Rob Elkin"<sip:1234@<publicip>>;tag=facad367
Call-ID: YWIyYjc1MDE1MGIxZWY4YTc0ZjAyODE0ODhkOTY1ODg.
CSeq: 1 SUBSCRIBE
Expires: 300
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO
User-Agent: eyeBeam release 1104g stamp 54685
Event: message-summary
Content-Length: 0

<------------->
--- (13 headers 0 lines) ---
Creating new subscription
Sending to <homeip>:6676 (no NAT)
list_route: hop: <sip:1234@<homeip>:6676>
No matching peer for '1234' from '<homeip>:6676'

<--- Transmitting (no NAT) to <homeip>:6676 --->
SIP/2.0 404 Not found (no mailbox)
Via: SIP/2.0/UDP <homeip>:6676;branch=z9hG4bK-d8754z-1dd51c515f8ad227-1---d8754z-;received=<homeip>;rport=6676
From: "Rob Elkin"<sip:1234@<publicip>>;tag=facad367
To: "Rob Elkin"<sip:1234@<publicip>>;tag=as4296a2ad
Call-ID: YWIyYjc1MDE1MGIxZWY4YTc0ZjAyODE0ODhkOTY1ODg.
CSeq: 1 SUBSCRIBE
Server: Asterisk PBX 1.8.5.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0


<------------>
[Aug 23 19:59:31] NOTICE[6966]: chan_sip.c:24012 handle_request_subscribe: Received SIP subscribe for peer without mailbox: 
Really destroying SIP dialog 'YWIyYjc1MDE1MGIxZWY4YTc0ZjAyODE0ODhkOTY1ODg.' Method: SUBSCRIBE

<--- SIP read from UDP:94.75.247.45:5060 --->
BYE sip:<sipid>@<publicip>:5060 SIP/2.0
Max-Forwards: 12
To: <sip:<diallednumber>@213.166.9.4>;tag=as5f63ed80
From: <sip:<mobile>@213.166.9.4>;tag=3523118346-597104
Call-ID: 16069301-3523118346-597098@bandx-msw3.band-x.com
CSeq: 2 BYE
Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER, SUBSCRIBE, PRACK, UPDATE, MESSAGE, PUBLISH
Via: SIP/2.0/UDP 94.75.247.45;branch=z9hG4bK063e.e16e47b6.0
Via: SIP/2.0/UDP 213.166.9.4:5060;rport=5060;branch=z9hG4bK440696ca72a7f26b2bc2589a887934a6
Contact: <sip:<mobile>@213.166.9.4:5060>
Content-Length: 0

<------------->
--- (11 headers 0 lines) ---
Sending to 94.75.247.45:5060 (no NAT)
Scheduling destruction of SIP dialog '16069301-3523118346-597098@bandx-msw3.band-x.com' in 32000 ms (Method: BYE)

<--- Transmitting (no NAT) to 94.75.247.45:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 94.75.247.45;branch=z9hG4bK063e.e16e47b6.0;received=94.75.247.45
Via: SIP/2.0/UDP 213.166.9.4:5060;rport=5060;branch=z9hG4bK440696ca72a7f26b2bc2589a887934a6
From: <sip:<mobile>@213.166.9.4>;tag=3523118346-597104
To: <sip:<diallednumber>@213.166.9.4>;tag=as5f63ed80
Call-ID: 16069301-3523118346-597098@bandx-msw3.band-x.com
CSeq: 2 BYE
Server: Asterisk PBX 1.8.5.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '43e5579521151f1672ce2eb96f8af9f4@localphone.com' in 32000 ms (Method: INVITE)
set_destination: Parsing <sip:94.75.247.45;lr=on;ftag=as3c39942f;an=YWJjRENCMzg4KSMoPTo2FWlaNj48LXtVYWEGaiYpXA--> for address/port to send to
set_destination: set destination to 94.75.247.45:5060
Reliably Transmitting (no NAT) to 94.75.247.45:5060:
BYE sip:94.75.247.29:5060;transport=udp SIP/2.0
Via: SIP/2.0/UDP 10.56.69.201:5060;branch=z9hG4bK484a1713
Route: <sip:94.75.247.45;lr=on;ftag=as3c39942f;an=YWJjRENCMzg4KSMoPTo2FWlaNj48LXtVYWEGaiYpXA-->,<sip:95.211.119.245;lr=on;ftag=as3c39942f>,<sip:94.75.247.44;lr=on>,<sip:94.75.247.53;lr=on;ftag=lp-2k9-4e52df77-00004c67-00002ae7R34581ee6.a;did=597.f0954465>
Max-Forwards: 70
From: "<mobile>" <sip:<sipid>@localphone.com>;tag=as3c39942f
To: <sip:<homenumber>@localphone.com>;tag=lp-2k9-4e52df77-00004c67-00002ae7R34581ee6.b
Call-ID: 43e5579521151f1672ce2eb96f8af9f4@localphone.com
CSeq: 104 BYE
User-Agent: Asterisk PBX 1.8.5.0
Proxy-Authorization: Digest username="<sipid>", realm="localphone.com", algorithm=MD5, uri="sip:94.75.247.29:5060", nonce="4e5407b6bf0c67d13e30f8f492d8c9bdea6706d5", response="246dd5a9a27e50cd0f641e2da8aba580"
X-Asterisk-HangupCause: Normal Clearing
X-Asterisk-HangupCauseCode: 16
Content-Length: 0


---
  == Spawn extension (localphone-in, <sipid>, 2) exited non-zero on 'SIP/localphone-0000000b'

<--- SIP read from UDP:94.75.247.45:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.56.69.201:5060;rport=5060;received=<publicip>;branch=z9hG4bK484a1713
From: "<mobile>" <sip:<sipid>@localphone.com>;tag=as3c39942f
To: <sip:<homenumber>@localphone.com>;tag=lp-2k9-4e52df77-00004c67-00002ae7R34581ee6.b
Call-ID: 43e5579521151f1672ce2eb96f8af9f4@localphone.com
CSeq: 104 BYE
Contact: <sip:94.75.247.29:5060;transport=udp>
Server: OpenSIPS (1.6.4-2-notls (x86_64/linux))
Content-Length: 0

<------------->
--- (9 headers 0 lines) ---
Really destroying SIP dialog '43e5579521151f1672ce2eb96f8af9f4@localphone.com' Method: INVITE

<--- SIP read from UDP:94.75.247.45:5060 --->
OPTIONS sip:<publicip>:5060 SIP/2.0
Via: SIP/2.0/UDP 94.75.247.45:5060;branch=0
From: sip:pinger@localphone.com;tag=6a0b0396
To: sip:<publicip>:5060
Call-ID: 95ad5523-300c7652-008f52@94.75.247.45
CSeq: 1 OPTIONS
Content-Length: 0

<------------->
--- (7 headers 0 lines) ---
Looking for s in default (domain <publicip>:5060)

<--- Transmitting (no NAT) to 94.75.247.45:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 94.75.247.45:5060;branch=0;received=94.75.247.45
From: sip:pinger@localphone.com;tag=6a0b0396
To: sip:<publicip>:5060;tag=as64453864
Call-ID: 95ad5523-300c7652-008f52@94.75.247.45
CSeq: 1 OPTIONS
Server: Asterisk PBX 1.8.5.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Contact: <sip:10.56.69.201:5060>
Accept: application/sdp
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '95ad5523-300c7652-008f52@94.75.247.45' in 32000 ms (Method: OPTIONS)
Really destroying SIP dialog '95ad5523-f09b7652-2e7f52@94.75.247.45' Method: OPTIONS
[Aug 23 19:59:48] NOTICE[6966]: chan_sip.c:12578 sip_reregister:    -- Re-registration for  <sipid>@localphone.com
REGISTER 11 headers, 0 lines
Reliably Transmitting (no NAT) to 94.75.247.45:5060:
REGISTER sip:localphone.com SIP/2.0
Via: SIP/2.0/UDP 10.56.69.201:5060;branch=z9hG4bK00f58378
Max-Forwards: 70
From: <sip:<sipid>@localphone.com>;tag=as5d92e0b0
To: <sip:<sipid>@localphone.com>
Call-ID: 66c403da3d8216b20e64c88147116307@10.56.69.201
CSeq: 111 REGISTER
User-Agent: Asterisk PBX 1.8.5.0
Authorization: Digest username="<sipid>", realm="localphone.com", algorithm=MD5, uri="sip:localphone.com", nonce="4e5406a4a5756e9d9af16cfdc3c366841f4d9860", response="7652b3212260b31c188bf23b33892dae"
Expires: 120
Contact: <sip:<sipid>@10.56.69.201:5060>
Content-Length: 0


---
Retransmitting #1 (no NAT) to 94.75.247.45:5060:
REGISTER sip:localphone.com SIP/2.0
Via: SIP/2.0/UDP 10.56.69.201:5060;branch=z9hG4bK00f58378
Max-Forwards: 70
From: <sip:<sipid>@localphone.com>;tag=as5d92e0b0
To: <sip:<sipid>@localphone.com>
Call-ID: 66c403da3d8216b20e64c88147116307@10.56.69.201
CSeq: 111 REGISTER
User-Agent: Asterisk PBX 1.8.5.0
Authorization: Digest username="<sipid>", realm="localphone.com", algorithm=MD5, uri="sip:localphone.com", nonce="4e5406a4a5756e9d9af16cfdc3c366841f4d9860", response="7652b3212260b31c188bf23b33892dae"
Expires: 120
Contact: <sip:<sipid>@10.56.69.201:5060>
Content-Length: 0


---

<--- SIP read from UDP:94.75.247.45:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 10.56.69.201:5060;branch=z9hG4bK00f58378;rport=5060;received=<publicip>
From: <sip:<sipid>@localphone.com>;tag=as5d92e0b0
To: <sip:<sipid>@localphone.com>;tag=9399de1ef8c379d4c914a855a096e8ba.a75e
Call-ID: 66c403da3d8216b20e64c88147116307@10.56.69.201
CSeq: 111 REGISTER
WWW-Authenticate: Digest realm="localphone.com", nonce="4e5407e057efc7681469a7f8dee1529b3528d1b6", stale=true
Server: OpenSER (1.2.2-notls (i386/linux))
Content-Length: 0

<------------->
--- (9 headers 0 lines) ---
Responding to challenge, registration to domain/host name localphone.com
REGISTER 11 headers, 0 lines
Reliably Transmitting (no NAT) to 94.75.247.45:5060:
REGISTER sip:localphone.com SIP/2.0
Via: SIP/2.0/UDP 10.56.69.201:5060;branch=z9hG4bK3de30f26
Max-Forwards: 70
From: <sip:<sipid>@localphone.com>;tag=as03506920
To: <sip:<sipid>@localphone.com>
Call-ID: 66c403da3d8216b20e64c88147116307@10.56.69.201
CSeq: 112 REGISTER
User-Agent: Asterisk PBX 1.8.5.0
Authorization: Digest username="<sipid>", realm="localphone.com", algorithm=MD5, uri="sip:localphone.com", nonce="4e5407e057efc7681469a7f8dee1529b3528d1b6", response="d61cf027fe241475282ec13a93782d4a"
Expires: 120
Contact: <sip:<sipid>@10.56.69.201:5060>
Content-Length: 0


---

<--- SIP read from UDP:94.75.247.45:5060 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 10.56.69.201:5060;branch=z9hG4bK00f58378;rport=5060;received=<publicip>
From: <sip:<sipid>@localphone.com>;tag=as5d92e0b0
To: <sip:<sipid>@localphone.com>;tag=9399de1ef8c379d4c914a855a096e8ba.a75e
Call-ID: 66c403da3d8216b20e64c88147116307@10.56.69.201
CSeq: 111 REGISTER
WWW-Authenticate: Digest realm="localphone.com", nonce="4e5407e112b7d973b47c6b7a49e7fb42969228f5", stale=true
Server: OpenSER (1.2.2-notls (i386/linux))
Content-Length: 0

<------------->
--- (9 headers 0 lines) ---

<--- SIP read from UDP:94.75.247.45:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.56.69.201:5060;branch=z9hG4bK3de30f26;rport=5060;received=<publicip>
From: <sip:<sipid>@localphone.com>;tag=as03506920
To: <sip:<sipid>@localphone.com>;tag=9399de1ef8c379d4c914a855a096e8ba.6bd8
Call-ID: 66c403da3d8216b20e64c88147116307@10.56.69.201
CSeq: 112 REGISTER
Contact: <sip:<sipid>@10.56.69.201:5060>;expires=120;received="sip:<publicip>:5060"
Server: OpenSER (1.2.2-notls (i386/linux))
Content-Length: 0

<------------->
--- (9 headers 0 lines) ---
Scheduling destruction of SIP dialog '66c403da3d8216b20e64c88147116307@10.56.69.201' in 32000 ms (Method: REGISTER)
[Aug 23 19:59:49] NOTICE[6966]: chan_sip.c:20043 handle_response_register: Outbound Registration: Expiry for localphone.com is 120 sec (Scheduling reregistration in 105 s)

<--- SIP read from UDP:<homeip>:6676 --->


<------------->

I removed all the sensitive information in there, but it should all still be valid.

I would point out as well that dialling from my sip phone out, using the outbound trunk that I have set up, doesn’t work either.

There seems still to be a NAT-problem in Your setup, as the audio offering is at c=IN IP4 10.56.69.201.
This should be Your internal IP - not reachable from the outside, thus audio-connection will fail.
Maybe I saw not all other things, but this was the one catching my eyes :smiley:
I assume that 10.56.69.201 is the IP of Your asterisk box. If this is correct, You should do two things:

First: set nat=yes in the definition of [localphone] (instead of the nat=no setiing actually there)
Second: Of You’ve got an static external IP which is reachable from the outside, set it as externip= in the general-section of sip.conf.

This should help with the audio problem.

About outbound calling: Check with localphone, how the expect the numberformat for dialing. If >our sure, that Your dialing operation fits there needs, just post a denug in the same manner for a try to make an outbound call.

Thanks abw1oim, however even after setting both those settings and restarting, it still didn’t work. This is still in the output:

v=0
o=root 1568170471 1568170471 IN IP4 10.56.69.201
s=Asterisk PBX 1.8.5.0
c=IN IP4 10.56.69.201
t=0 0
m=audio 11710 RTP/AVP 0 8 3 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

The 10. address is the internal ip I have on the box.

Config now looks like:

[general]
context=default                 ; Default context for incoming calls
allowguest=yes                  ; Allow or reject guest calls (default is yes)
port      = 5060
bindaddr  = 0.0.0.0
qualify   = no
disable   = all
allow     = alaw
allow     = ulaw
dtmfmode  = rfc2833
srvlookup = yes
externip  = <externalip>
[localphone]
type        = peer
nat         = yes
directmedia = no
insecure    = invite
authuser    = sipid
username    = sipid
fromuser    = sipid
fromdomain  = localphone.com
secret      = secret
host        = localphone.com
dtmfmode    = rfc2833
context     = localphone-in ;extensions.conf context for inbound calls
;context            = localphone-out
disallow    = all
allow       = ulaw
allow       = alaw
allow       = gsm
allow       = g729

I think someone said that nat= referred to the other side’s natting. You probably need to tell Asterisk which networks need natting. Is localnets set? (I think the default is all interfaces are on local nets and everything else needs natting.)

I did a search for “localnets” in sip.conf, nothing. What should the value for this be?

localnet=<ip/netmask>

in the general-section of sip.conf
The value depends on Your internal network-configuration, e.g. a classical Class-C net would be

localnet=192.168.0.0/255.255.255.0

As You’re using a IP out of class A (10.56.69.201) You have to look after neet netmask You’re using for Your internal network and define the values appropriately.

I’m not very good with netmasks, I don’t really understand them, is there a way for me to work out what the value should be?

Issue an

at the asterisk box.

You shoud get something like:

[code]eth0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
inet addr:10.56.69.201 Bcast:xxx.xxx.xxx.xxx Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:25348950 errors:0 dropped:1 overruns:0 frame:0
TX packets:24540093 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:10997966451 (10488.4 Mb) TX bytes:13981293095 (13333.6 Mb)
Interrupt:41 Base address:0xe000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:10864205 errors:0 dropped:0 overruns:0 frame:0
TX packets:10864205 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1404864850 (1339.7 Mb) TX bytes:1404864850 (1339.7 Mb)

[/code]

Once You got Your Mask You can do the rest:

for every 0 in the mask just replace the appropriate valuee in Your real internal IP-address whith this 0. In the example above Your localnet-setting would be

localnet=10.56.69.0/255.255.255.0

Thanks for that abw1oim. The debug output now no longer has the 10. address in there, however still no luck. Here is the config:

[general]
;context=localphone                 ; Default context for incoming calls
context=default
allowguest=yes                  ; Allow or reject guest calls (default is yes)
port      = 5060
bindaddr  = 0.0.0.0
qualify   = no
disable   = all
allow     = alaw
allow     = ulaw
dtmfmode  = rfc2833
srvlookup = yes
externip  = <externalip>
localnet  = 10.56.69.0/255.255.255.0

and the ifconfig:

eth0      Link encap:Ethernet  HWaddr 12:31:42:00:42:3F  
          inet addr:10.56.69.201  Bcast:10.56.69.255  Mask:255.255.255.0
          inet6 addr: fe80::1031:42ff:fe00:423f/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:170623 errors:0 dropped:0 overruns:0 frame:0
          TX packets:146810 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:18877160 (18.0 MiB)  TX bytes:75922613 (72.4 MiB)
          Interrupt:10 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:169 errors:0 dropped:0 overruns:0 frame:0
          TX packets:169 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:40189 (39.2 KiB)  TX bytes:40189 (39.2 KiB)

and here is the debug output:


SIP Debugging enabled
Really destroying SIP dialog '66288272036fa3e53c8a53962383b0de@10.56.69.201' Method: REGISTER
Really destroying SIP dialog '95ad5523-39fa6b52-6bf472@94.75.247.45' Method: OPTIONS

<--- SIP read from UDP:88.96.117.198:56512 --->


<------------->

<--- SIP read from UDP:94.75.247.45:5060 --->
INVITE sip:<sipid>@<externalip>:5060 SIP/2.0
Record-Route: <sip:94.75.247.45;lr=on;ftag=3523207728-551026>
Max-Forwards: 12
Session-Expires: 3600;refresher=uac
Min-SE: 600
Supported: timer
To: <sip:<localphonenumber>@213.166.9.4>
From: <sip:<mymobile>@213.166.9.4>;tag=3523207728-551026
Remote-Party-Id: <sip:<mymobile>@213.166.9.4>;privacy=off;screen=yes
Call-ID: 16329078-3523207728-551020@bandx-msw3.band-x.com
CSeq: 1 INVITE
Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER, SUBSCRIBE, PRACK, UPDATE, MESSAGE, PUBLISH
Via: SIP/2.0/UDP 94.75.247.45;branch=z9hG4bKc906.9b545a84.0
Via: SIP/2.0/UDP 213.166.9.4:5060;rport=5060;branch=z9hG4bK9e75ea12e5cdeca52af93f1e0560c14f
Contact: <sip:<mymobile>@213.166.9.4:5060>
Call-Info: <sip:213.166.9.4>;method="NOTIFY;Event=telephone-event;Duration=1000"
Content-Type: application/sdp
Content-Length: 259

v=0
o=bandx-msw3 1637 132707 IN IP4 213.166.9.4
s=sip call
c=IN IP4 213.166.9.6
t=0 0
m=audio 51832 RTP/AVP 0 8 18 101
a=rtpmap:0 pcmu/8000/1
a=ptime:20
a=rtpmap:8 pcma/8000/1
a=rtpmap:18 g729/8000/1
a=rtpmap:101 telephone-event/8000/1
a=sendrecv
<------------->
--- (18 headers 12 lines) ---
Sending to 94.75.247.45:5060 (no NAT)
Using INVITE request as basis request - 16329078-3523207728-551020@bandx-msw3.band-x.com
Found peer 'localphone' for '<mymobile>' from 94.75.247.45:5060
  == Using SIP RTP CoS mark 5
Found RTP audio format 0
Found RTP audio format 8
Found RTP audio format 18
Found RTP audio format 101
Found audio description format pcmu for ID 0
Found audio description format pcma for ID 8
Found audio description format g729 for ID 18
Found audio description format telephone-event for ID 101
Capabilities: us - 0x10e (gsm|ulaw|alaw|g729), peer - audio=0x10c (ulaw|alaw|g729)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0x10c (ulaw|alaw|g729)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 213.166.9.6:51832
Looking for <sipid> in localphone-in (domain <externalip>:5060)
list_route: hop: <sip:94.75.247.45;lr=on;ftag=3523207728-551026>

<--- Transmitting (NAT) to 94.75.247.45:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 94.75.247.45;branch=z9hG4bKc906.9b545a84.0;received=94.75.247.45;rport=5060
Via: SIP/2.0/UDP 213.166.9.4:5060;rport=5060;branch=z9hG4bK9e75ea12e5cdeca52af93f1e0560c14f
Record-Route: <sip:94.75.247.45;lr=on;ftag=3523207728-551026>
From: <sip:<mymobile>@213.166.9.4>;tag=3523207728-551026
To: <sip:<localphonenumber>@213.166.9.4>
Call-ID: 16329078-3523207728-551020@bandx-msw3.band-x.com
CSeq: 1 INVITE
Server: Asterisk PBX 1.8.5.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Session-Expires: 1800;refresher=uac
Contact: <sip:<sipid>@<externalip>:5060>
Content-Length: 0


<------------>
    -- Executing [<sipid>@localphone-in:1] NoOp("SIP/localphone-00000002", "") in new stack
    -- Executing [<sipid>@localphone-in:2] Dial("SIP/localphone-00000002", "SIP/<homenumber>@localphone,30,tr") in new stack
  == Using SIP RTP CoS mark 5
Audio is at 5060
Adding codec 0x4 (ulaw) to SDP
Adding codec 0x8 (alaw) to SDP
Adding codec 0x2 (gsm) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 94.75.247.45:5060:
INVITE sip:<homenumber>@localphone.com SIP/2.0
Via: SIP/2.0/UDP <externalip>:5060;branch=z9hG4bK54c27ea0;rport
Max-Forwards: 70
From: "<mymobile>" <sip:<sipid>@localphone.com>;tag=as13e57de9
To: <sip:<homenumber>@localphone.com>
Contact: <sip:<sipid>@<externalip>:5060>
Call-ID: 0c06360172128c325b4721cc27ffd2e9@localphone.com
CSeq: 102 INVITE
User-Agent: Asterisk PBX 1.8.5.0
Date: Wed, 24 Aug 2011 20:48:48 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 312

v=0
o=root 1557244268 1557244268 IN IP4 <externalip>
s=Asterisk PBX 1.8.5.0
c=IN IP4 <externalip>
t=0 0
m=audio 19512 RTP/AVP 0 8 3 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

---
    -- Called SIP/<homenumber>@localphone

<--- Transmitting (NAT) to 94.75.247.45:5060 --->
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 94.75.247.45;branch=z9hG4bKc906.9b545a84.0;received=94.75.247.45;rport=5060
Via: SIP/2.0/UDP 213.166.9.4:5060;rport=5060;branch=z9hG4bK9e75ea12e5cdeca52af93f1e0560c14f
Record-Route: <sip:94.75.247.45;lr=on;ftag=3523207728-551026>
From: <sip:<mymobile>@213.166.9.4>;tag=3523207728-551026
To: <sip:<localphonenumber>@213.166.9.4>;tag=as7a8fbfcb
Call-ID: 16329078-3523207728-551020@bandx-msw3.band-x.com
CSeq: 1 INVITE
Server: Asterisk PBX 1.8.5.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Session-Expires: 1800;refresher=uac
Contact: <sip:<sipid>@<externalip>:5060>
Content-Length: 0


<------------>

<--- SIP read from UDP:94.75.247.45:5060 --->
SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/UDP <externalip>:5060;branch=z9hG4bK54c27ea0;rport=5060
From: "<mymobile>" <sip:<sipid>@localphone.com>;tag=as13e57de9
To: <sip:<homenumber>@localphone.com>;tag=9399de1ef8c379d4c914a855a096e8ba.b645
Call-ID: 0c06360172128c325b4721cc27ffd2e9@localphone.com
CSeq: 102 INVITE
Proxy-Authenticate: Digest realm="localphone.com", nonce="4e5564dc40521b522f65c856b4dcfe27943e12e3"
Server: OpenSER (1.2.2-notls (i386/linux))
Content-Length: 0

<------------->
--- (9 headers 0 lines) ---
Transmitting (NAT) to 94.75.247.45:5060:
ACK sip:<homenumber>@localphone.com SIP/2.0
Via: SIP/2.0/UDP <externalip>:5060;branch=z9hG4bK54c27ea0;rport
Max-Forwards: 70
From: "<mymobile>" <sip:<sipid>@localphone.com>;tag=as13e57de9
To: <sip:<homenumber>@localphone.com>;tag=9399de1ef8c379d4c914a855a096e8ba.b645
Contact: <sip:<sipid>@<externalip>:5060>
Call-ID: 0c06360172128c325b4721cc27ffd2e9@localphone.com
CSeq: 102 ACK
User-Agent: Asterisk PBX 1.8.5.0
Content-Length: 0


---
Audio is at 5060
Adding codec 0x4 (ulaw) to SDP
Adding codec 0x8 (alaw) to SDP
Adding codec 0x2 (gsm) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 94.75.247.45:5060:
INVITE sip:<homenumber>@localphone.com SIP/2.0
Via: SIP/2.0/UDP <externalip>:5060;branch=z9hG4bK6f9dbee1;rport
Max-Forwards: 70
From: "<mymobile>" <sip:<sipid>@localphone.com>;tag=as13e57de9
To: <sip:<homenumber>@localphone.com>
Contact: <sip:<sipid>@<externalip>:5060>
Call-ID: 0c06360172128c325b4721cc27ffd2e9@localphone.com
CSeq: 103 INVITE
User-Agent: Asterisk PBX 1.8.5.0
Proxy-Authorization: Digest username="<sipid>", realm="localphone.com", algorithm=MD5, uri="sip:<homenumber>@localphone.com", nonce="4e5564dc40521b522f65c856b4dcfe27943e12e3", response="7f3d56e701ef72ed8391e35dab25ea6f"
Date: Wed, 24 Aug 2011 20:48:48 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 312

v=0
o=root 1557244268 1557244269 IN IP4 <externalip>
s=Asterisk PBX 1.8.5.0
c=IN IP4 <externalip>
t=0 0
m=audio 19512 RTP/AVP 0 8 3 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

---

<--- SIP read from UDP:94.75.247.45:5060 --->
SIP/2.0 100 Giving a try...
Via: SIP/2.0/UDP <externalip>:5060;branch=z9hG4bK6f9dbee1;rport=5060
From: "<mymobile>" <sip:<sipid>@localphone.com>;tag=as13e57de9
To: <sip:<homenumber>@localphone.com>
Call-ID: 0c06360172128c325b4721cc27ffd2e9@localphone.com
CSeq: 103 INVITE
Server: OpenSER (1.2.2-notls (i386/linux))
Content-Length: 0

<------------->
--- (8 headers 0 lines) ---

<--- SIP read from UDP:94.75.247.45:5060 --->
SIP/2.0 180 Ringing
Record-Route: <sip:94.75.247.53;lr=on;ftag=lp-2k9-4e5430f7-0000277b-00002bb5R4319be11.a;did=fb6.c42284b1>
Record-Route: <sip:94.75.247.44;lr=on>
Record-Route: <sip:95.211.119.245;lr=on;ftag=as13e57de9>
Record-Route: <sip:94.75.247.45;lr=on;ftag=as13e57de9;an=YWJjRENCMzg4KSMoPTo2FWlaNj48LXtVYWEGaiYpXA-->
Via: SIP/2.0/UDP <externalip>:5060;branch=z9hG4bK6f9dbee1;rport=5060
From: "<mymobile>" <sip:<sipid>@localphone.com>;tag=as13e57de9
To: <sip:<homenumber>@localphone.com>;tag=lp-2k9-4e5430f7-0000277b-00002bb5R4319be11.b
Call-ID: 0c06360172128c325b4721cc27ffd2e9@localphone.com
CSeq: 103 INVITE
Content-Type: application/sdp
Allow: INVITE,ACK,CANCEL,BYE,REGISTER,REFER,INFO,SUBSCRIBE,NOTIFY,PRACK,UPDATE,OPTIONS
Contact: <sip:94.75.247.29:5060;transport=udp>
Server: OpenSIPS (1.6.4-2-notls (x86_64/linux))
Content-Length: 241

v=0
o=Sonus_UAC 30478 1122 IN IP4 203.176.253.100
s=SIP Media Capabilities
c=IN IP4 203.176.253.101
t=0 0
m=audio 16898 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
a=maxptime:10
<------------->
--- (15 headers 11 lines) ---
Found RTP audio format 0
Found RTP audio format 101
Found audio description format PCMU for ID 0
Found audio description format telephone-event for ID 101
Capabilities: us - 0x10e (gsm|ulaw|alaw|g729), peer - audio=0x4 (ulaw)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0x4 (ulaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 203.176.253.101:16898
    -- SIP/localphone-00000003 is ringing

<--- Transmitting (NAT) to 94.75.247.45:5060 --->
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 94.75.247.45;branch=z9hG4bKc906.9b545a84.0;received=94.75.247.45;rport=5060
Via: SIP/2.0/UDP 213.166.9.4:5060;rport=5060;branch=z9hG4bK9e75ea12e5cdeca52af93f1e0560c14f
Record-Route: <sip:94.75.247.45;lr=on;ftag=3523207728-551026>
From: <sip:<mymobile>@213.166.9.4>;tag=3523207728-551026
To: <sip:<localphonenumber>@213.166.9.4>;tag=as7a8fbfcb
Call-ID: 16329078-3523207728-551020@bandx-msw3.band-x.com
CSeq: 1 INVITE
Server: Asterisk PBX 1.8.5.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Session-Expires: 1800;refresher=uac
Contact: <sip:<sipid>@<externalip>:5060>
Content-Length: 0


<------------>
    -- SIP/localphone-00000003 is making progress passing it to SIP/localphone-00000002
Really destroying SIP dialog '16329056-3523207686-950028@bandx-msw3.band-x.com' Method: BYE
Reliably Transmitting (no NAT) to 88.96.117.198:56512:
OPTIONS sip:1234@88.96.117.198:56512;rinstance=8fcd15252ddb429c SIP/2.0
Via: SIP/2.0/UDP <externalip>:5060;branch=z9hG4bK2c7592c5
Max-Forwards: 70
From: "asterisk" <sip:asterisk@<externalip>>;tag=as61a24e5f
To: <sip:1234@88.96.117.198:56512;rinstance=8fcd15252ddb429c>
Contact: <sip:asterisk@<externalip>:5060>
Call-ID: 5e7aaadf0d3640041db813a608e74ec7@<externalip>:5060
CSeq: 102 OPTIONS
User-Agent: Asterisk PBX 1.8.5.0
Date: Wed, 24 Aug 2011 20:48:53 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0


---

<--- SIP read from UDP:88.96.117.198:56512 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP <externalip>:5060;branch=z9hG4bK2c7592c5
Contact: <sip:192.168.0.20:56512>
To: <sip:1234@88.96.117.198:56512;rinstance=8fcd15252ddb429c>;tag=ed30107a
From: "asterisk"<sip:asterisk@<externalip>>;tag=as61a24e5f
Call-ID: 5e7aaadf0d3640041db813a608e74ec7@<externalip>:5060
CSeq: 102 OPTIONS
Accept: application/sdp
Accept-Language: en
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE, INFO
User-Agent: eyeBeam release 1104g stamp 54685
Content-Length: 0

<------------->
--- (12 headers 0 lines) ---
Really destroying SIP dialog '5e7aaadf0d3640041db813a608e74ec7@<externalip>:5060' Method: OPTIONS

<--- SIP read from UDP:94.75.247.45:5060 --->
SIP/2.0 200 OK
Record-Route: <sip:94.75.247.53;lr=on;ftag=lp-2k9-4e5430f7-0000277b-00002bb5R4319be11.a;did=fb6.c42284b1>
Record-Route: <sip:94.75.247.44;lr=on>
Record-Route: <sip:95.211.119.245;lr=on;ftag=as13e57de9>
Record-Route: <sip:94.75.247.45;lr=on;ftag=as13e57de9;an=YWJjRENCMzg4KSMoPTo2FWlaNj48LXtVYWEGaiYpXA-->
Via: SIP/2.0/UDP <externalip>:5060;branch=z9hG4bK6f9dbee1;rport=5060
From: "<mymobile>" <sip:<sipid>@localphone.com>;tag=as13e57de9
To: <sip:<homenumber>@localphone.com>;tag=lp-2k9-4e5430f7-0000277b-00002bb5R4319be11.b
Call-ID: 0c06360172128c325b4721cc27ffd2e9@localphone.com
CSeq: 103 INVITE
Content-Type: application/sdp
Supported: timer,replaces
Allow: INVITE,ACK,CANCEL,BYE,REGISTER,REFER,INFO,SUBSCRIBE,NOTIFY,PRACK,UPDATE,OPTIONS
Session-Expires: 1800;refresher=uas
Contact: <sip:94.75.247.29:5060;transport=udp>
Server: OpenSIPS (1.6.4-2-notls (x86_64/linux))
Content-Length: 241

v=0
o=Sonus_UAC 30478 1122 IN IP4 203.176.253.100
s=SIP Media Capabilities
c=IN IP4 203.176.253.101
t=0 0
m=audio 16898 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
a=maxptime:10
<------------->
--- (17 headers 11 lines) ---
list_route: hop: <sip:94.75.247.45;lr=on;ftag=as13e57de9;an=YWJjRENCMzg4KSMoPTo2FWlaNj48LXtVYWEGaiYpXA-->
list_route: hop: <sip:95.211.119.245;lr=on;ftag=as13e57de9>
list_route: hop: <sip:94.75.247.44;lr=on>
list_route: hop: <sip:94.75.247.53;lr=on;ftag=lp-2k9-4e5430f7-0000277b-00002bb5R4319be11.a;did=fb6.c42284b1>
set_destination: Parsing <sip:94.75.247.45;lr=on;ftag=as13e57de9;an=YWJjRENCMzg4KSMoPTo2FWlaNj48LXtVYWEGaiYpXA--> for address/port to send to
set_destination: set destination to 94.75.247.45:5060
Transmitting (NAT) to 94.75.247.45:5060:
ACK sip:94.75.247.29:5060;transport=udp SIP/2.0
Via: SIP/2.0/UDP <externalip>:5060;branch=z9hG4bK018307d0;rport
Route: <sip:94.75.247.45;lr=on;ftag=as13e57de9;an=YWJjRENCMzg4KSMoPTo2FWlaNj48LXtVYWEGaiYpXA-->,<sip:95.211.119.245;lr=on;ftag=as13e57de9>,<sip:94.75.247.44;lr=on>,<sip:94.75.247.53;lr=on;ftag=lp-2k9-4e5430f7-0000277b-00002bb5R4319be11.a;did=fb6.c42284b1>
Max-Forwards: 70
From: "<mymobile>" <sip:<sipid>@localphone.com>;tag=as13e57de9
To: <sip:<homenumber>@localphone.com>;tag=lp-2k9-4e5430f7-0000277b-00002bb5R4319be11.b
Contact: <sip:<sipid>@<externalip>:5060>
Call-ID: 0c06360172128c325b4721cc27ffd2e9@localphone.com
CSeq: 103 ACK
User-Agent: Asterisk PBX 1.8.5.0
Content-Length: 0


---
    -- SIP/localphone-00000003 answered SIP/localphone-00000002
Audio is at 5060
Adding codec 0x4 (ulaw) to SDP
Adding codec 0x8 (alaw) to SDP
Adding codec 0x100 (g729) to SDP
Adding non-codec 0x1 (telephone-event) to SDP

<--- Reliably Transmitting (NAT) to 94.75.247.45:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 94.75.247.45;branch=z9hG4bKc906.9b545a84.0;received=94.75.247.45;rport=5060
Via: SIP/2.0/UDP 213.166.9.4:5060;rport=5060;branch=z9hG4bK9e75ea12e5cdeca52af93f1e0560c14f
Record-Route: <sip:94.75.247.45;lr=on;ftag=3523207728-551026>
From: <sip:<mymobile>@213.166.9.4>;tag=3523207728-551026
To: <sip:<localphonenumber>@213.166.9.4>;tag=as7a8fbfcb
Call-ID: 16329078-3523207728-551020@bandx-msw3.band-x.com
CSeq: 1 INVITE
Server: Asterisk PBX 1.8.5.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Session-Expires: 1800;refresher=uac
Contact: <sip:<sipid>@<externalip>:5060>
Content-Type: application/sdp
Content-Length: 334

v=0
o=root 177276594 177276594 IN IP4 <externalip>
s=Asterisk PBX 1.8.5.0
c=IN IP4 <externalip>
t=0 0
m=audio 15166 RTP/AVP 0 8 18 101
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

<------------>

<--- SIP read from UDP:94.75.247.45:5060 --->
ACK sip:<sipid>@<externalip>:5060 SIP/2.0
Max-Forwards: 12
To: <sip:<localphonenumber>@213.166.9.4>;tag=as7a8fbfcb
From: <sip:<mymobile>@213.166.9.4>;tag=3523207728-551026
Call-ID: 16329078-3523207728-551020@bandx-msw3.band-x.com
CSeq: 1 ACK
Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER, SUBSCRIBE, PRACK, UPDATE, MESSAGE, PUBLISH
Via: SIP/2.0/UDP 94.75.247.45;branch=z9hG4bKc906.9b545a84.2
Via: SIP/2.0/UDP 213.166.9.4:5060;rport=5060;branch=z9hG4bK544a61760909ae0a1f483d875934f914
Contact: <sip:<mymobile>@213.166.9.4:5060>
Content-Length: 0

<------------->
--- (11 headers 0 lines) ---

<--- SIP read from UDP:94.75.247.45:5060 --->
BYE sip:<sipid>@<externalip>:5060 SIP/2.0
Max-Forwards: 12
To: <sip:<localphonenumber>@213.166.9.4>;tag=as7a8fbfcb
From: <sip:<mymobile>@213.166.9.4>;tag=3523207728-551026
Call-ID: 16329078-3523207728-551020@bandx-msw3.band-x.com
CSeq: 2 BYE
Allow: INVITE, BYE, OPTIONS, CANCEL, ACK, REGISTER, NOTIFY, INFO, REFER, SUBSCRIBE, PRACK, UPDATE, MESSAGE, PUBLISH
Via: SIP/2.0/UDP 94.75.247.45;branch=z9hG4bK9906.f43aeb45.0
Via: SIP/2.0/UDP 213.166.9.4:5060;rport=5060;branch=z9hG4bK177607438d7770c4edaf2b92d48b5757
Contact: <sip:<mymobile>@213.166.9.4:5060>
Content-Length: 0

<------------->
--- (11 headers 0 lines) ---
Sending to 94.75.247.45:5060 (NAT)
Scheduling destruction of SIP dialog '16329078-3523207728-551020@bandx-msw3.band-x.com' in 32000 ms (Method: BYE)

<--- Transmitting (NAT) to 94.75.247.45:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 94.75.247.45;branch=z9hG4bK9906.f43aeb45.0;received=94.75.247.45;rport=5060
Via: SIP/2.0/UDP 213.166.9.4:5060;rport=5060;branch=z9hG4bK177607438d7770c4edaf2b92d48b5757
From: <sip:<mymobile>@213.166.9.4>;tag=3523207728-551026
To: <sip:<localphonenumber>@213.166.9.4>;tag=as7a8fbfcb
Call-ID: 16329078-3523207728-551020@bandx-msw3.band-x.com
CSeq: 2 BYE
Server: Asterisk PBX 1.8.5.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0


<------------>
Scheduling destruction of SIP dialog '0c06360172128c325b4721cc27ffd2e9@localphone.com' in 32000 ms (Method: INVITE)
set_destination: Parsing <sip:94.75.247.45;lr=on;ftag=as13e57de9;an=YWJjRENCMzg4KSMoPTo2FWlaNj48LXtVYWEGaiYpXA--> for address/port to send to
set_destination: set destination to 94.75.247.45:5060
Reliably Transmitting (NAT) to 94.75.247.45:5060:
BYE sip:94.75.247.29:5060;transport=udp SIP/2.0
Via: SIP/2.0/UDP <externalip>:5060;branch=z9hG4bK26d1d66b;rport
Route: <sip:94.75.247.45;lr=on;ftag=as13e57de9;an=YWJjRENCMzg4KSMoPTo2FWlaNj48LXtVYWEGaiYpXA-->,<sip:95.211.119.245;lr=on;ftag=as13e57de9>,<sip:94.75.247.44;lr=on>,<sip:94.75.247.53;lr=on;ftag=lp-2k9-4e5430f7-0000277b-00002bb5R4319be11.a;did=fb6.c42284b1>
Max-Forwards: 70
From: "<mymobile>" <sip:<sipid>@localphone.com>;tag=as13e57de9
To: <sip:<homenumber>@localphone.com>;tag=lp-2k9-4e5430f7-0000277b-00002bb5R4319be11.b
Call-ID: 0c06360172128c325b4721cc27ffd2e9@localphone.com
CSeq: 104 BYE
User-Agent: Asterisk PBX 1.8.5.0
Proxy-Authorization: Digest username="<sipid>", realm="localphone.com", algorithm=MD5, uri="sip:94.75.247.29:5060", nonce="4e5564dc40521b522f65c856b4dcfe27943e12e3", response="1aea278a3422ef1d84a4e0ef096ffdd5"
X-Asterisk-HangupCause: Normal Clearing
X-Asterisk-HangupCauseCode: 16
Content-Length: 0


---
  == Spawn extension (localphone-in, <sipid>, 2) exited non-zero on 'SIP/localphone-00000002'

<--- SIP read from UDP:94.75.247.45:5060 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP <externalip>:5060;branch=z9hG4bK26d1d66b;rport=5060
From: "<mymobile>" <sip:<sipid>@localphone.com>;tag=as13e57de9
To: <sip:<homenumber>@localphone.com>;tag=lp-2k9-4e5430f7-0000277b-00002bb5R4319be11.b
Call-ID: 0c06360172128c325b4721cc27ffd2e9@localphone.com
CSeq: 104 BYE
Contact: <sip:94.75.247.29:5060;transport=udp>
Server: OpenSIPS (1.6.4-2-notls (x86_64/linux))
Content-Length: 0

<------------->
--- (9 headers 0 lines) ---
Really destroying SIP dialog '0c06360172128c325b4721cc27ffd2e9@localphone.com' Method: INVITE

<--- SIP read from UDP:88.96.117.198:56512 --->


<------------->

and since the 10. ip isn’t appearing anymore, I really don’t understand what is going on! Any help would be appreciated!

The sip dialogs look better now and the call is already connecting.
As You still encounter voice problems You should check, whether You’ve got any firewall problems in Your environment,
Normally the sip and the rtp-ports asterisk is using should be forwarded to the asterisk-box to make all things work. For configuration issues regarding this consult Your router/gateway/firewall documentation, 'cause it’s unlikely that someone could help You with the equipment You own.

However in the case of voice problems You should not try the most complex scenario at the first one (calling from outside to a target outside or from a provider to the a provider) just test with an internal extension to the outside and vice versa. If this works You may start with the more complex scenarios.