newspaint

Documenting Problems That Were Difficult To Find The Answer To

Asterisk – Getting 407 Proxy Authentication Required When Dialing Out

Using the PABX software Asterisk v1.8 on Linux I was trying to get calls from my internal network routed out via my paid-for external VoIP account.

I tried debugging by issuing the command sip set debug on but was getting messages like:

Reliably Transmitting (NAT) to 195.189.173.27:5060:
INVITE sip:155@sip.voipfone.net SIP/2.0

followed by

<--- SIP read from UDP:195.189.173.27:5060 --->
SIP/2.0 407 Proxy Authentication Required

at which point the call would fail.

What I needed in my sip.conf file in my peer definition was the following lines:

[general]
register => username:password@sip.voipfone.net/voipfone
transport=udp

[voipfone]
defaultuser=username
secret=password
type=peer
dtmfmode=rfc2833
context=fromvoipfone
deny=0.0.0.0/0.0.0.0
permit=195.189.173.27/255.255.255.255
fromuser=username
fromdomain=sip.voipfone.net
host=sip.voipfone.net

so that Asterisk could reply to this request for authentication:

Reliably Transmitting (NAT) to 195.189.173.27:5060:
INVITE sip:152@sip.voipfone.net SIP/2.0
Proxy-Authorization: Digest username='testuser', realm='asterisk', algorithm=MD5, uri='sip:152@sip.voipfone.net', nonce='42db9e63', response='ded720cda12519e7bde82e11ea21798d'

1 responses to “Asterisk – Getting 407 Proxy Authentication Required When Dialing Out

  1. Cliff 2015-12-17 at 14:14:05

    Thank you this worked for me.

Leave a comment