Connecting to service provider through SIP


#1

Hello,

This is my first Asterisk project and I am having a problem regarding SIP.
I have set up an Asterisk server (version 1.2.4) and I need to connect to a service provider through SIP (they don’t support any other protocol and they aren’t using Asterisk) to get PSTN connectivity.
There is no NAT being used on my side but on the provider side NAT is being used.
I can make calls from the PSTN to one of the VoIP phones, so the conversion from analogue to digital works fine, but I can’t make outgoing calls. When I try to call out the phone rings but it just times out. Is this because of NAT?
Could anyone please give me some advise about how to solve this or where I should look? I have already read the Wiki and numerous posts on this forum and they have been, and still are, very helpfull, but I need some help on this one.

I can’t post any output from the CLI or configuration details right now, but I’ll do so tomorrow, sorry about that.

Thanks in advance for any suggestions.


#2

NAT on the provider side? What a nice “provider” :wink:
Anyway your problem might be with sip reinvires. Try adding a “canreinvote=no” for the peer in the sip.conf.

Stoyan


#3

You can say that again :smile: thanks for the reply btw.
I have set the canreinvite option to no, but the problem is still there.

In my previous post I promised to post more info so here it is.

The register statement in sip.conf also times out because of WARNING[1906] - wrong password on authentication, but for all I know there is no password!

sip.conf:

register=xx.xx.xx.xx@yy.yy.yy.yy (xx.xx… = my ip, yy.yy… = provider ip)

[SIPphone1]
type=friend
username=Sip3
secret=******
host=dynamic
mailbox=100
canreinvite=no
outgoinglimit=2
incominglimit=2
context=default
callerid=SIPphone1<100>
allow=all

[provider]
type=peer
username=xx.xx.xx.xx
secret=
host=yy.yy.yy.yy
canreinvite=no

extensions.conf

[default]
include => intern
include => QAgents
include => incoming
include => viaProvider
include => standard
include => outgoing
include => mobile
include => outrt-002-Provider

[intern]
exten => 100,1,Set(LANGUAGE()=nl)
exten => 100,2,Dial(SIP/SIPphone1|30,r)
exten => 100,3,Voicemail(u100)

[outgoing]
include => mobile
include => outrt-002-Provider

[outrt-002-Provider]
exten => _00ZXX.,1,Macro(dialout-trunk,2,${EXTEN:1})

[macro-dialout-trunk]
exten => s,1,Set (LANGUAGE()=nl)
exten => s,2,Dial(SIP/provider/${ARG2}|30,r)
exten => s,3,Hangup()

CLI output:

– Executing Macro(“SIP/SIPphone1”, “dialout-trunk|2|”) in new stack
– Executing Set(“SIP/SIPphone1”, “LANGUAGE()=nl”) in new stack
– Executing Dial(“SIP/SIPphone1”, “SIP/provider/|30|r”) in new stack
– Called provider/
– Nobody picked up in 30000 ms
– Executing Hangup(“SIP/SIPphone1”, “”) in new stack

debug output:

The debug output shows the standard SIP messages with the To: and From: fields etc. Nothing special here, it just keeps trying for 30 seconds.


#4

OK, are you sure the problem isn’t with the Caller*ID or the dial prefix (dialing only the local number, while the provider expects 00<country_code><area_code>)? For example I have a provider, which identifies me by callerid. They are using Mera for SIP gateway.

Stoyan


#5

Ok, it’s working now :laughing: it turned out to be an error at the provider side.
I already had incoming calls working, I was using the wrong IP adress for connecting to the provider :blush: , and now also outgoing calls work. I tested the outgoing calls by calling a mobile number, but the provider only had 1 (G.711) codec in the SIP gateway and I enabled all codecs (allow=all), so that was the problem.

Thanks for the help Stoyan. :smiley: