Question

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)             
Was it helpful?

Solution

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.

OTHER TIPS

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 :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top