Problem calling through provider

Dear all,

I need some help with configuring outgoing authentication. I have a SIP provider that I want to make my calls through. With the following settings, I can receive incoming calls, but when I try an outgoing call, I get a voice message “this account number is not valid”

my sip.conf:

[code]register => enet?my_username:my_password@sipgw.e-net.sk

[enet]
type=peer
host=sipgw.e-net.sk
defaultuser=my_username
fromuser=my_username
fromdomain=sipgw.e-net.sk
remotesecret=my_password
context=incoming
directmedia=no
nat=yes
callerid=my_number
qualify=yes[/code]

I tried to connect directly to the provider using a softphone (ekiga, x-lite), I could place outgoing calls. So the problem must be in asterisk.

Using tcpdump I compared the traffic generated by the softphone and by asterisk. Using softphone, there’s first an invite without Digest: line, which is then rejected by the peer with 401 Unauthorized, after which the softphone sends another INVITE, this time with a Digest: line.

When a place a call through Asterisk, there is only one INVITE, which seems to be somehow accepted and I get a voice prompt telling me that some account number is not correct.

I am sure the username and password are correct, the registration works and also direct softphone calls work. Seems that the peer runs SER 0.9.4.

Just for the record, this is the INVITE sent by asterisk (maybe it’s not 100% match with the configuration, I took this in between experimenting and maybe I changed the peer in sip.conf afterwards):

[code]INVITE sip:0903662537@sipgw.e-net.sk SIP/2.0
Via: SIP/2.0/UDP 10.21.0.2:5060;branch=z9hG4bK229b65b9;rport
Max-Forwards: 70
From: “Peter Jr Halicky” sip:421220202021@10.21.0.2;tag=as4290159f
To: sip:0903662537@sipgw.e-net.sk
Contact: sip:421220202021@10.21.0.2
Call-ID: 4c950edd76629a5a445fd5a574c7e67b@10.21.0.2
CSeq: 102 INVITE
User-Agent: Asterisk PBX 1.6.2.5-0ubuntu1
Date: Wed, 02 Jun 2010 12:12:15 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 385

v=0
o=root 1362614572 1362614572 IN IP4 10.21.0.2
s=Asterisk PBX 1.6.2.5-0ubuntu1
c=IN IP4 10.21.0.2
b=CT:384
t=0 0
m=audio 10106 RTP/AVP 0 3 8 101
a=rtpmap:0 PCMU/8000
a=rtpmap:3 GSM/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv
m=video 13272 RTP/AVP 34
a=rtpmap:34 H263/90000
a=sendrecv[/code]

and this is the first INVITE sent by ekiga:

[code]INVITE sip:0903662537@sipgw.e-net.sk SIP/2.0
Date: Wed, 02 Jun 2010 12:10:47 GMT
CSeq: 1 INVITE
Via: SIP/2.0/UDP 87.197.128.173:3772;branch=z9hG4bKc281ad8b-ad6c-df11-94da-002215917efe;rport
User-Agent: Ekiga/3.2.6
From: “Peter Jr Halicky” sip:421220202021@sipgw.e-net.sk;tag=9e6aac8b-ad6c-df11-94da-002215917efe
Call-ID: b06cac8b-ad6c-df11-94da-002215917efe@nexus
To: sip:0903662537@sipgw.e-net.sk
Contact: sip:421220202021@87.197.128.173:3772
Allow: INVITE,ACK,OPTIONS,BYE,CANCEL,SUBSCRIBE,NOTIFY,REFER,MESSAGE,INFO,PING
Content-Type: application/sdp
Content-Length: 638
Max-Forwards: 70

v=0
o=- 1275480647 1 IN IP4 87.197.128.173
s=Opal SIP Session
c=IN IP4 87.197.128.173
t=0 0
m=audio 5072 RTP/AVP 116 0 8 3 115 9 101 120
a=sendrecv
a=rtpmap:116 Speex/16000/1
a=fmtp:116 sr=16000,mode=any
a=rtpmap:0 PCMU/8000/1
a=rtpmap:8 PCMA/8000/1
a=rtpmap:3 gsm/8000/1
a=rtpmap:115 Speex/8000/1
a=fmtp:115 sr=8000,mode=any
a=rtpmap:9 G722/8000/1
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16,32,36
a=rtpmap:120 NSE/8000
a=fmtp:120 192-193
m=video 5074 RTP/AVP 99 31
b=AS:4096
b=TIAS:4096000
a=sendrecv
a=rtpmap:99 theora/90000
a=fmtp:99 height=576;width=704
a=rtpmap:31 h261/90000
a=fmtp:31 CIF=1;QCIF=1[/code]

I’d appreciate any help…

Thanks!
Peter

You have a NAT problem. You are sending private (10.0.0.0/8) addresses.

okay - any suggestion how to fix that? note that audio is working fine…

Check your localnet, externhost/externip and stunaddr settings.

None of them were set, I have set them to what I think are correct values, but the behaviour is still the same :frowning:

can you please paste your extensions.conf in, especially your context where you dial out of your sip trunk? Also can you paste the output of “sip show registry” and “sip show peers”. Also can you paste the entire call from start to after you hangup.