Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Asterisk - Please Help Connecting to SIP Provider

Posted on 2014-04-06
29
Medium Priority
?
688 Views
Last Modified: 2014-04-08
Hi Experts,

I am able to receive incoming calls no problems but can't dial to the outside world.

The error I get when I try to dial to outside number is:

ERROR:[4059] [C-0000000000]: chan_sip.c:33203 setup_srtp: No SRTP module loaded, can't setup SRTP session.

Open in new window


sip.conf:

[general]
dtmfmode=rfc2933
context=external
srvlookup=yes
register => MYUSERNAME:MYPASSWORD@voice.mibroadband.com.au

[office-phone](!)
type=friend
context=LocalSets
host=dynamic
nat=force_rport,comedia
dtmfmode=auto
disallow=all
allow=g722
allow=ulaw
allow=alaw

[1001](office-phone)
secret=1234

[1002](office-phone)
secret=1234

[1003](office-phone)
secret=1234

[VoipProvider]
type =peer
context =external
host =voice.mibroadband.com.au
defaultuser = MYUSERNAME
secret = MYPASSWORD
insecure = invite
dtmfmode= rfc2833
disallow = all
allow = ulaw
allow = alaw

Open in new window



extensions.conf:

[LocalSets]

exten => _XXXXX.,1,Dial(SIP/${EXTEN}@voice.mibroadband.com.au)
exten => 1001,1,Dial(SIP/1001)
exten => 1002,1,Dial(SIP/1002)
exten => 1003,1,Dial(SIP/1003)

[external]:

exten => s,1,Dial(SIP/1003)

Open in new window



Can you please help point me in the right direction?

Many Thanks,
Ricky
0
Comment
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 19
  • 10
29 Comments
 
LVL 20

Expert Comment

by:José Méndez
ID: 39982100
Hi Ricky,

I am assuming that your way out is the XXXXX pattern, correct? If so, is your SP able to route just 5 digits in Australia?

Would you be able to debug this one like we discussed in the previous thread?

core set verbose 9...
core set debug 9...
try your  call again and paste the output into a text file, try attaching it here please so I can help you out.

Try also to disable sRTP in BLink:

CTRL + P to open preferences window
Go to the Media tab and choose disabled on the sRTP Encryption menu

Regards,
0
 

Author Comment

by:Ronniel Allan Castanito
ID: 39982124
Hi willlywilburwonka, I was trying to set a number pattern to say at least 5 digits. I thought the "." at the end accepts whatever digit comes after the first 5?

As requested please see debug output:

== Using SIP RTP CoS mark 5
-- Executing [0287043077@LocalSets:1] Dial("SIP/1003-00000004", "SIP/0287043077@voice.mibroadband.com.au") in new stack
== Using SIP RTP CoS mark 5
-- Called SIP/0287043077@voice.mibroadband.com.au
-- Got SIP response 604 "Does not exist anywhere" back from 203.161.164.69:5060
== Everyone is busy/congested at this time (1:0/0/1)
-- Auto fallthrough, channel 'SIP/1003-00000004' status is 'CHANUNAVAIL'

Open in new window

0
 

Author Comment

by:Ronniel Allan Castanito
ID: 39982180
Registry Shows:

CLI> sip show registry

Host: voice.mibroadband.com.au:5060
dnsmgr: N
Username: MYUSERNAME
Refresh: 70
State: Registered
Reg.Time: Mon, 07 Apr 2014 15:18:59

Open in new window



Can you tell whether it's my configuration file that is at fault or whether it's something to do with my service provider?
0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 

Author Comment

by:Ronniel Allan Castanito
ID: 39982403
After looking around, I think error  604 "Does not exist anywhere" back from 203.161.164.69:5060 means my sip.conf isn't what the host server is expecting. I've contacted my voip provider and asked them for more details.
0
 
LVL 20

Expert Comment

by:José Méndez
ID: 39982830
Ricky,

Can you try adding these  2 lines to your sip.conf:

fromdomain=voice.mibroadband.com.au
fromuser=<broadband's account name>

You may also have to add the

domain=voice.mibroadband.com.au

voice.mibroadband.com.au is just what seems to be the right value, but your provider should share some details about how to register a SIP phone directly to them for example, and clarify if that is the correct domain.

I used Blink to register directly to my provider first before doing so with Asterisk, that way I was able to study the differences and modify Asterisk's behavior as needed.
0
 

Author Comment

by:Ronniel Allan Castanito
ID: 39982952
I can make calls when I register directly with Blink using all the default settings. I notice blink has TLS enabled with certificate file in place. Could this be it?

How do I go about in aligning Blink settings to Asterisk willlywilburwonka?
0
 
LVL 20

Expert Comment

by:José Méndez
ID: 39982978
Wow! Nice! I have tried to set up TLS but my provider still doesn't support it....

TLS is just a transport option, TCP and UPD are widely supported, I guess it is something you need to confirm with your Provider, or with Blink:

Go to Preferences > Advanced, and disable TLS transport. Try to connect using Blink afterward. This will tell you if TLS is the reason.

I don think so since you can already receive incoming calls, so the transport should not be the issue. 604 refers to an unrecognized user when sending out the INVITE.

Try this:
Register Blink with your SP
Open PReferences > LOgging > Trace SIP
Make and outbound call through BLink
Disable logging after you hang up

NOw log into Asterisk and turn on the SIP/app debugs :
core set debug 9...
core set verbose 9...
sip set debug on

Register Asterisk by resetting the SIP channel: sip reload
Make an outbound call
Disable sip debugs: sip set debug off

Now you have a copy of a working registration/call and a non working one. Try to compare the INVITE messages, or post them here after cleaning up for sensitive data
0
 

Author Comment

by:Ronniel Allan Castanito
ID: 39983035
I don't see any log files in /var/log/asterisk/cdr-csv for the sip debugging. I'll have to work out how Asterisk logs everything and get back to you.

Oh yes you're right about TLS. Disabled and was still able to make the phone call.
0
 

Author Comment

by:Ronniel Allan Castanito
ID: 39983141
Please find attached Blink's sip_trace log file.

When reading the log file, please note that my provider had given me a username which is the same as my phone number.
sip-trace.txt
0
 

Author Comment

by:Ronniel Allan Castanito
ID: 39983253
Please find attached Asterisk's verbose log file.

The FROM field keeps using my extension number instead of my username.

That must be the reason why it's giving error 604. It doesn't know who 103 is.
asterisk-verbose.txt
0
 

Author Comment

by:Ronniel Allan Castanito
ID: 39983405
Ok I think I've confused myself with all the dialplan and mapping. In Blink, should I have registered another account called VoipProvider as per my sip.conf settings and from this new account to attempt to make out-going calls?
0
 
LVL 20

Expert Comment

by:José Méndez
ID: 39983501
Wow, I not following... In Blink, you are good.. No extra accounts to set up asyou are already able to send/receive.

Now, I see what you already saw:

Blink sends:

From: "phonebusiness" <sip:MYUSERNAME@voice.mibroadband.com.au>;tag=891cdc47123247bbaaf5589f913319fd

Asterisk sends:
From: "1003" <sip:1003@192.168.0.222>;tag=as3a962481

We need to fix that. Did you add the

fromdomain=voice.mibroadband.com.au
fromuser=<broadband's account name>
domain=voice.mibroadband.com.au

and then reloaded?
0
 

Author Comment

by:Ronniel Allan Castanito
ID: 39983719
Sure did, added all those entries. fromuser is set to equal MYUSERNAME.
0
 
LVL 20

Expert Comment

by:José Méndez
ID: 39983811
Try adding Fromuser= in one of the phone sections:

[1003](office-phone)
secret=1234
Fromuser=MYUSERNAME

And by the way, we have to talk about configuring your SIP Peers as extensions: it is not secure. You are much better configuring things like [BLINK-RICKY]. But that can be discussed later =)
0
 

Author Comment

by:Ronniel Allan Castanito
ID: 39984744
Ok so here is the updated config and log files in asterisk just in case we're diverging after making all of these changes.

At the beginning of the log it looks like asterisk is using the correct username but switches back to my extension number. Is this what you're see as well?
asterisk-verbose-08042014-0947.txt
extensions.conf-08042014-0947.txt
sip.conf-08042014-0947.txt
0
 

Author Comment

by:Ronniel Allan Castanito
ID: 39984839
After making several change combinations, it still showing my extension 1003 in the "FROM" field. Why isn't it changing?
0
 

Author Comment

by:Ronniel Allan Castanito
ID: 39984907
Hi willlywilburwonka, what I don't understand is if I have an account to extension 1003 and when I dial outside, how does asterisk know user the [VoipProvider] trunk settings? I don't see anything mapping to direct these settings anywhere. Is there something else we're missing? Unless the setting type = peer is what asterisk is looking at when directing calls outside.
0
 
LVL 20

Accepted Solution

by:
José Méndez earned 2000 total points
ID: 39985027
Ricky, could you please try removing the spaces between parameters = values ? Please also arrange the values under [VoipProvider] in this order:

type=peer
canreinvite=no
nat=yes
qualify=yes
domain=
fromdomain=
fromuser=
defaultuser=
insecure=invite

Those are the Trunk setting with which I successfully send MYUSERNAME in the initial INVITE in the From header:

From: "blink-1" <sip:MYUSERNAME@MYPROVIDERSDOMAIN>

In your case, it is sending

From: "1003" <sip:1003@192.168.0.222>

This are the settings from my Blink account:

[blink-1]
type=friend
secret=
context=context
callerid=MYUSERNAME
fromuser=MYUSERNAME
description=Blink Phone
host=dynamic
directmedia=yes


PLease make sure to reload the SIP channel.
0
 

Author Comment

by:Ronniel Allan Castanito
ID: 39985058
Same result. Still From: "1003" <sip:1003@192.168.0.222> showing.

The system indicated that nat=yes is deprecated and that I should use nat=force_rport,comedia instead. I tried both with the same results.
0
 
LVL 20

Expert Comment

by:José Méndez
ID: 39985072
yes I have same behavior here with the NAT line.


 That is the key I believe... Sending the fromuser as MYUSERNAME is the key...

Sorry mate I gotta go take some sleep =S, its late over here.

Talk to you later
0
 

Author Comment

by:Ronniel Allan Castanito
ID: 39985104
Please see updated sip, extensions and log files.

I'd noticed that you left out the context settings under [VoipProvider]. I'd tried testing with the context field added but without success. The log file looked the same.
asterisk-verbose-08042014-1517.txt
extensions.conf-08042014-1517.txt
sip.conf-08042014-1517.txt
0
 

Author Comment

by:Ronniel Allan Castanito
ID: 39985108
Not a problem mate. Rest up and many thanks for your help this far.
0
 
LVL 20

Expert Comment

by:José Méndez
ID: 39986204
Yup, sorry about the context= parameter.

I tried yesterday poking with my setup, and neither the callerid= or the fromuser= inside my Blink's SIP.con section had any effect on the FROM header sent out. I was too tired and forgot to test modifying the fromuser= and fromdomain= in the Trunk section. I will try this today and let you know.

I am pretty sure those are the lines that will modify the FROM header, can't understand why it won't work in your system. Maybe if we used FreePBX...... lol
0
 

Author Comment

by:Ronniel Allan Castanito
ID: 39987484
lol!! Oh no don't tell me that now.. hehe

I still have the FreePBX though. I just haven't figured out how to configure it to test.
0
 

Author Comment

by:Ronniel Allan Castanito
ID: 39987507
Just tested the settings on FreePBX and it works!!
0
 

Author Comment

by:Ronniel Allan Castanito
ID: 39987508
This is the settings I used:

host=voice.mibroadband.com.au
domain=voice.mibroadband.com.au
fromdomain=voice.mibroadband.com.au
defaultuser=MYUSERNAME
fromuser=MYUSERNAME
secret=MYSECRET
type=peer
canreinvite=no
nat=force_rport,comedia
qualify=yes
insecure=invite

Open in new window

0
 
LVL 20

Expert Comment

by:José Méndez
ID: 39987528
Well... maybe I was wrong then. There will be things FreePBX will easy out for us.... hahaha

is it maybe the defaultuser= parameter...?
0
 

Author Comment

by:Ronniel Allan Castanito
ID: 39987543
You weren't wrong, it was a very good learning experience!! I'm very comfortable with the settings in FreePBX and all the options made a lot of sense. Prior to this, everything was a little overwhelming. Thanks for sticking with me through that experience :)
0
 
LVL 20

Expert Comment

by:José Méndez
ID: 39987557
I have learned much myself! Thank you for that. I'm very happy to know you can make calls to the outside now, and will be glad to continue assisting if I can.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently purchased a Bluetooth headset called the Music Jogger (model BSH10). The control buttons on it look like this: One of my goals is to use it as the microphone and speakers for Skype calls. In that respect, it works well. However, I …
Why do some people recommend buying business VoIP from an ISP? What are the benefits to my company? What are the costs?
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question