Asterisk trunking mode

Hi all.

How can I configure Asterisk SIP trunking when Asterisk doesn’t answer 407 for incoming REGISTER from
SIP UA Client and accepts with 200 OK ?

Thank in advance.

Please provide more details - the relevant piece of Asterisk configuration, sip debug, etc.

Asterisk will never answer with a 407. A 407 is a Proxy Authorization required, and Asterisk is not a Proxy. Asterisk will respond with a 401 to challenge an inbound request if it is configured to do so.

If the goal is to accept the registration from a SIP UA, then:

  • If you are using chan_sip, then you would configure a peer with authentication credentials.
  • If you are using chan_pjsip, you would configure an endpoint with an aor and auth object.

Example configuration for both of those is documented in sample configuration files and on the Asterisk wiki:

1 Like

Thanks, I’ll investigate more with chan_sip sample config and try create config
for my case and inform about results.

Anyway the main goal is to create SIP network
SIP UA Client < – > Asterisk < – > SIP Proxy Server.
Where Asterisk will configured (if possible) to run as Outbound SIP Proxy for SIP UAC.
And the messaging flow I want to be as follows.

SIP UAC < – > Asterisk < – > SIP Proxy

  1. SIPRequest1 – >
    2. SIPRequest1 – >
    3. < – SIP Response1
  2.                     < -- SIP Response1
  3. SIPRequest1 – >
    6. SIPRequest1 – >
    7. < – SIP Response1
  4. < – SIP Response1

And the same flow when SIP Request comes from SIP Proxy to SIP UAC via Asterisk.

If yes How should be Asterisk configuration?

Thank in advance.

Asterisk is a back to back user agent, not a proxy. SIP requests are converted into an internal format that also covers analogue lines, ISDN and other VoIP proptocols. Although there are some optimisations of SDP for SIP to SIP calls, you should not rely on Asterisk generate SIP one for one with the input SIP.