Setup:
Centos 6
OS: Linux CentOS 64-Bit
CPU: Intel® Core™ i7 - 4 cores
Asterisk 11
libpri 1.4
dahdi 2.9.1
I want to send calls to my SIP provider via asterisk. I want to use a softphone to make outgoing calls, when I make outgoing calls on the softphone it needs to route through my asterisk server and then out to the SIP Provider. Currently when I make an outbound call it produces a "Failed to authenticate" and status is 'CONGESTION' notices.
My question is simple: Since my softphone is calling from "User1" (as shown below) What do I need to write in my sip.conf and extensions.conf files in order for the SIP provider to make the outgoing call for me?
My Thoughts:
I feel like I am missing a part of the process, like how User1 is set up to handle outgoing calls...
See an overview of how I set these two files up currently:
notes: - all username and passwords have been removed for this post. - sip.us is the sip provider
sip.conf:
[general]
transport=udp
register => username:password#gw1.sip.us
[myprovider]
type=peer
insecure=port,invite
host=gw1.sip.us
port=5060
dtmfmode=rfc2833
canrevinvite=no
disallow=all
allow=ulaw
qualify=yes
qualifyfreq=30
nat=force_rport,comedia
trustrpid=yes
fromdomain=gw1.sip.us
username=*****
secret=*****
context=from-trunk
rfc2833compensate=yes
session-timers=refuse
[friends_internal](!)
type=friend
host=dynamic
context=users
disallow=all
allow=ulaw
allow=alaw
[user1](friends_internal)
secret=****
[user2](friends_internal)
secret=****
now the extensions.conf:
...
...
exten=>_1NXXNXXXXXX,1,Dial(SIP/${EXTEN}#gw1.sip.us)
[users]
exten=>6001,1,Dial(SIP/user1,20)
exten=>6002,1,Dial(SIP/user2,20)
now the asterisk cli output when i try making an outgoing call using softphone:
== Using SIP RTP CoS mark 5
-- Executing [12015550155#users:1] Dial("SIP/user1-0000001e",
"SIP/12015550155#gw1.sip.us") in new stack
== Using SIP RTP CoS mark 5
-- Called SIP/12015550155#gw1.sip.us
[May 4 10:02:13] NOTICE[28935][C-0000002a]: chan_sip.c:23094
handle_response_invite: Failed to authenticate on INVITE to
'<sip:user1#501.62.174.2>;tag=as798e5009'
-- SIP/gw1.sip.us-0000001f is circuit-busy
== Everyone is busy/congested at this time (1:0/1/0)
-- Auto fallthrough, channel 'SIP/user1-0000001e' status is 'CONGESTION'
asterisk cli> sip show registery
Host dnsmgr Username Refresh State Reg.Time
gw1.sip.us:5060 N username 105 Registered Sun, 04 May 2014 10:28:05
1 SIP registrations.
asterisk cli> sip show peers
Name/username Host Dyn Forcerport Comedia ACL Port Status
user1/user1 68.198.. D Auto (No) No 55461 Unmonitored
user2/user2 68.198.. D Auto (No) No 55461 Unmonitored
myprovider/username 65.254.44.194 Yes Yes 5060 OK (42 ms)
Try changing the #gw1.sip.us to #myprovider and see if there's any changes. This will force asterisk to use the configured trunk [myprovider] instead of directly forward the call to gw.sip.us directly.
Hope this helps.
Your DialPlan is not correct clearly from your configuration files.
Аs a first step change your register string like:
register => username:password#gw1.sip.us\Myprovider
and then add the outgoing and incoming dialplan in your extensions.conf and include these dialplans into your users context. like:
e.g: you use 6XXX series to dial to the provider:
[outgoing]
exten => _6XXX,1,Dial(SIP/Myprovider/${EXTEN:0})
exten => _6XXX,2,Hangup
and for incoming calls
[incoming]
include = users ; this will go into your local context and dial your extensions
and in users context add outgoing context like
[users]
include = outgoing
I hope this will help you :)
Related
I have configured asterisk with flowroute. The registration is successful and outbound call connects but i am unable to hear any sound. My configurations are as follow
sip.conf
[general]
register => username:password#sip.flowroute.com
allow=ulaw
sip-custom-contexts.conf
[flowroute] ; keep this lowercase, do not change format
type=friend
secret=username
username=password
host=sip.flowroute.com
type=peer
transport=udp
port=5060
dtmfmode=rfc2833
context=to-pstn ; change to 'ext-did' or 'from-trunk' for asterisk#home
canreinvite=no
allow=ulaw
;allow=g729 ;uncomment this line if you have G.729 licenses installed.
insecure=port,invite
fromdomain=sip.flowroute.com
keepalive=yes
qualify=no
progressinband=yes
rtp.conf
[general]
rtpstart=10000
rtpend=2000
Kindly guide in this regard
The problem is solved by changing codec. After changing
allow=ulaw
to
allow=all
The call was working fine, with audible voice.
Please check your nat and external ip settings.
https://www.voip-info.org/wiki/view/Asterisk+SIP+NAT+solutions
I'd like to suggest reaching out to Flowroute's support for help on this. And I'd like to second advice from lvl to get those SIP credentials removed for your own account security.
I configured SIP connection with Asterisk. Server is running successfully but when i try to connect sip with X-Lite. Its giving Sip Error 408.
disallow=all ; First disallow all codecs
allow=ulaw ; Allow codecs in order of preference
externip = **.**.***.***; Address that we're going to put in outbound SIP
; messages if we're behind a NAT
;localnet=192.168.0.0/255.255.0.0; All RFC 1918 addresses are local networks
localnet=10.0.0.0/255.0.0.0 ; Also RFC1918
;localnet=172.16.0.0/12 ; Another RFC1918 with CIDR notation
;localnet=169.254.0.0/255.255.0.0 ;Zero conf local network
nat=route ; Global NAT settings (Affects all peers and users)
; yes = Always ignore info and assume NAT
; no = Use NAT mode only according to RFC3581 (;rport)
; never = Never attempt NAT mode or RFC3581 support
; route = Assume NAT, don't send rport
; (work around more UNIDEN bugs)
This is my sip.conf file
and my extensions.conf is:
exten => *98,1,VoiceMailMain
exten => *98,2,Hangup
Please check the details and help me to connect. THANKS
If you are using Asterisk 13 then you should configure the extensions in pjsip.conf (and not in sip.conf file). Asterisk 13 have moved to pjsip.
Otherwise the error code 408 means "Request Timeout" so most probably X-Lite doesn't receive any answer for the REGISTER request. Double check your IP/port/NAT configurations.
If still doesn't then you should have a look at the logs.
(Enable logs by sipdebug=yes and in logger.conf set the Verbose config to "notice,warning,error,debug,verbose,dtmf" below the [logfiles] section)
I am having a trouble in having a sipml5 to call other sipml5 via webrtc2sip and asterisk.
I have installed configured asterisk(version 11.10.0) + webrtc2sip(latest) + sipml5(chrome version 30.0.1599.66) to call from one box to other over websocket.
I can make a SIP call through and answer from other side but seems like there is no audio/voice packets gets exchanged as is evident by rtp and sip debug log and tcpdump.
asterisk and users are on separate servers and they do establish sip call but it's just a audio packet that does not appear.
I've created 2 users(1060 and 1061) and when I make a call I get these asterisk response.
rtp set debug on
RTP Debugging Enabled
*CLI> == Spawn extension (default, 1060, 1) exited non-zero on 'SIP/1061-00000000'
== Using SIP RTP CoS mark 5
-- Executing [1060#default:1] Dial("SIP/1061-00000002", "SIP/1060") in new stack
== Using SIP RTP CoS mark 5
-- Called SIP/1060
-- SIP/1060-00000003 is ringing
-- SIP/1060-00000003 answered SIP/1061-00000002
Asterisk settings are..
sip.conf
[general]
port=5060
bindaddr=0.0.0.0
context=default
transport=ws,wss,udp
srvlookup=yes
users.conf
[1060]
type=peer
username=1060
host=dynamic
secret=1234
context=default
disallow=all
allow=ulaw
transport=udp,ws,wss
encryption=yes
avpf=yes
icesupport=yes
nat=yes,force_rport
[1061]
type=peer
username=1061
host=dynamic
secret=1234
context=default
encryption=yes
avpf=yes
icesupport=yes
nat=yes
disallow=all
allow=ulaw
transport=udp,ws,wss
extensions.conf
[general]
static=yes
writeprotect=no
[default]
exten=>1060,1,Dial(SIP/1060)
exten=>1061,1,Dial(SIP/1061)
rtp.conf
[general]
icesupport=yes
stunaddr=stun.l.google.com:19302
strictrtp=no
rtcpinterval=6000
rtpchecksums=no
I can hear dialling sound on one end and ringing on the other end but as soon as the call is connected, can't hear anything.
Could anyone kindly help please.. I am very very desperate..
Thanks in advance!
You set rtp debug on but there's no rtp flow output, so call setup has gone wrong, you should check inside the dump of sip packets the sdp data they tried to share.
But you also have a better option: latest versions of Asterisk work with WebSocket and WebRTC like a charm without any external layer or component, so configuration will be much easier.
In addition you could use apache (at least 2.4) as websocket tunnel reverse proxy to the asterisk server, so you can do all the things (but rtp) with a single connection and a single ssl certificate use (another common problem is that the same selfsigned certificate is required to be explicitly accepted by user even if for the same server but on different port...and browser don't ask users to do that but just silently refuse to connect to websocket)
remove avpf option, it is not needed when using webrtc2sip.
If still no voice - check sipml5 log (firefox or chrome debug console ) while SIP registration and while the call.
I am new on Asterisk.
I have configured and installed Asterisk + FreePbx with 4 USB MODEM as FXO.
All is working fine, but I need block or hangup all inbound calls.
I possible make it from dondle.conf ? or where?
Thanks.
Do do this you need to edit the context in the dongle.conf and then create a context in extensions.conf
The extensions.conf context can read
[dongle-inbound]
s,1,Hangup()
That will simply hangup all calls that are passed to that context.
I'm need to use SIP server.
My choice is 'Asterisk'
That's version is 1.8.0
I configured all of the asterisk.
and... i'm calling two users (0000FFFF0001,0000FFFF0002) using X-lite, Zoiper.
User Calling is not problem. It's fantastic.
But i can't hear nothing.
I just can calling other user, end the call.
My source is below.
sip.conf
[office-phone](!)
type=friend
host=dynamic
nat=yes
secret=pspsps
dtmfmode=auto
disallow=all
allow=alaw
allow=ulaw
qualify=yes
canreinvite=no
context=LocalSets
[0000FFFF0001](office-phone)
defaultip=223.33.184.3
[0000FFFF0002](office-phone)
externip=192.168.194.2
localnet=192.168.0.100/255.255.255.0
extensions.conf
[LocalSets]
exten => 100,1,Dial(SIP/0000FFFF0001)
exten => 101,1,Dial(SIP/0000FFFF0002)
exten => 200,1,Answer()
exten => 200,n,SayNumber(5)
exten => 200,n,Wait(1)
exten => 200,n,SayNumber(5)
exten => 200,n,Hangup()
I expected rtp problem.
I was opened TCP/UDP ports 20000~30000.
and my sharer NAT was configured.
help me. i need advise of you.
I believe you need to put your externip, localnet, and canreinvite in your general setting, Not in the sip peer itself.
Do you have the ports in rtp.conf natted to your server and allowed through your firewall?
I recommend you make two test extensions, Let's use 201 that answers and calls the MusicOnHold application, If you call that extension from your sip phone do you get audio?
Create Extension 202 that answers and calls the Echo Application, If you speak into your phone do you hear your voice Echo'd back to you?