Outbound SIP Calls Slow and Problematic

All,

I am new to Asterisk please bear with me.

I’m running Asterisk 1.8 on Ubuntu 10.04. I am attempting to place an outbound SIP call to a PSTN gateway provider. Simple enough? I want to initiate the calls from a java servlet so I am using the asterisk-java api 100m3.

All is not well I can place a call–the phone rings–but it is slow. Almost twenty seconds from dialing to ringing. Also the asterisk console shows the following after the call terminates:

Channel ‘SIP/216.86.150.76-0000000a’ sent into invalid extension ‘s’ in context ‘default’, but no invalid handler

Why is it so slow? is the aforementioned message related?

There is insufficient information to answer the first question.

The second question is probably unrelated.

You need to provide verbose console output, a the very least. (Preferably enable the full log, and take it from there, as tiemstamps are likely to be important here.)

You may need to take a SIP trace.

A likely reason for a long delay is a DNS problem, e.g. an unresolvable reverse DNS.

Thanks for the response.

Wrt the DNS I’ll say I don’t think it is the problem. The reason is because I can perform the same call using Mobicents and the phone rings within 2-3 seconds. All else is equal.

I will take the measures suggested to up the verbosity. Thanks for that.

I am puzzled by something. What is the connection (for lack of a better word) between my java code and sip.conf?

The following java code fragment works:
OriginateAction action = new OriginateAction();
action.setChannel(“SIP/15056461286@221.45.50.79”);

The examples are different and don’t work:
OriginateAction action = new OriginateAction();
action.setChannel(“SIP/15056461286”);

Notice the difference wrt “@” and the ip address. No ip, no works.

In sip.conf the ip address is present. Why isn’t it being used? ; Have I misconfigured myself? I’ve included my sip.conf below and for good measure, I’ve also included my extensions.conf.

My sip.conf:

[general]

context=dialer
bindaddr=192.168.1.102 ; Where my asterisk is running
bindport=5060 ; My Asterisk port
srvlookup=yes
disallow=all
allow=g723.1
allow=g729a
allow=ulaw
allow=gsm
language=en
transport=udp

[dialer]
type=peer
host=221.45.50.79 ; My PSTN gateway
nat=yes ; I do have nat but the Asterisk machine is on the DMZ and has a reserved address.
insecure=invite

My extensions.conf:

[general]

[globals]

[dialer]
exten => _X.,1,NoOp()
exten => _X.,n,Dial(SIP/${EXTEN}@dialer,30,r)