Outgoing Call 403 forbidden


I’m running Asterisk asterisk18_1.8.4.4-1_ar71xx.ipk on openwrt. When I make outgoing call with my service provider it returns 403 when I answer the call. Based on the debugging I suspect, Asterisk doesn’t send the authentication credentials “Authorization: Digest”. Actually the asterisk did send the authentication when it prompted for. But after that for further request it doesn’t have the authentication digest inside when it makes request to SIP server. Juzt not sure why asterisk doesn’t maintain the authentication digest in the request. Any help?


Missing authentiation normally produces a 401, to which Asterisk will respond with the authentication. It needs the first rejection to know how to authenticate. A 403 suggests a misconfiguration.

Thanks for the reply.

My bad, yes you’re rite it’s 407, for which asterisk successfully authenticates. Then when ti makes connection with authentication it’s 403. When successfully tested X-lite, this where i see the difference. For X-lite all request have auth info.

I’ve summarize the requests series.

From SIP service provider

SIP/2.0 407 Proxy Authentication Required
Via: SIP/2.0/UDP;branch=z9hG4bK7bb71713;rport=5060
Proxy-Authenticate: Digest realm=“sip.pfingo.com”, nonce="4e75f8afbf54f5fff2d379e3ad04c7b14858299e"
Content-Length: 0

Response from Asterisk

INVITE sip:xxxx@sip.fingo.com SIP/2.0
Via: SIP/2.0/UDP;branch=z9hG4bK41d94c1c;rport
Max-Forwards: 70
CSeq: 103 INVITE
User-Agent: Asterisk PBX
Proxy-Authorization: Digest username=“jenijacob”, realm=“sip.pfingo.com”, algorithm=MD5,

From SIP service provider

<— SIP read from UDP: —>
SIP/2.0 100 trying – your call is important to us

SIP/2.0 180 Ringing
Via: SIP/2.0/UDP;rport=5060;branch=z9hG4bK41d94c1c

SIP/2.0 200 OK
Via: SIP/2.0/UDP;rport=5060;branch=z9hG4bK41d94c1c

– Remotely bridging SIP/2000-0000000f and SIP/ext-sip-account-00000010

Response from Asterisk

INVITE sip:xxxx@ SIP/2.0
Via: SIP/2.0/UDP;branch=z9hG4bK3d1a4ae5;rport
User-Agent: Asterisk PBX
Supported: replaces, timer
X-asterisk-Info: SIP re-invite (External RTP bridge)
Content-Type: application/sdp
Content-Length: 265

From SIP service provider

SIP/2.0 403 Forbidden
Via: SIP/2.0/UDP;branch=z9hG4bK3d1a4ae5;rport=5060

directmedia is incorrectly set to yes.

NB This should be survivable. If Asterisk is dropping the call after this, raise a bug report. It should just fail degraded (not responding at all, like some or all X-Lite versions, is a different matter).

It would be unusual to find and external provider that supported direct media.

Hi david55. Thanks a lot. It worked. Hours of effort finally got result.

Just curious. How did you know it? From the “Re-invite” msg?

Now moving on to the incoming call from SIP provider. Then to conference bridge.

on the rejected INVITE, although a more careful reading would probably have produced the same result.

Thanks david55. Once read about directmedia I understood the concept.

Meanwhile I manged to do outgoing and incoming SIP call from the service provider as well.

Unfortunately the my current hardware doesn’t have the pkg available for conference meetme. so ringing…