Calls rejected sent by G711Ulaw64K

Calls sent by Voip switch to Asterisk with G711Ulaw64k and calls are rejected by below given issues.

CALLFLOW|2021-04-02 10:02:29.654347|EP2->SERVER|X.X.X.X:5060|488 Not acceptable here|149.20.164.203:5060|
SIP/2.0 488 Not acceptable here
Via: SIP/2.0/UDP X,x,x,x:5060;branch=z9hG4bK67cf353e168ffa5b;received=X.x.x.x
From: sip:1234@x.x.x.x;tag=35dc5750377e7115
To: sip:1234@61.246.7.69;tag=as3a41eab3
Call-ID: 5518abd8563616c6c12352a98@x.x.x.x
CSeq: 21805 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces
Content-Length: 0

We would need more info to be able to help diagnose the problem. Can you post the INVITE as well? Something about the INVITE is being objected to.

You also need to provide details of the codecs that you would accept.

Which of chan_pjsip, or the, deprecated, chan_sip driver you are using may also affect the behaviour.

Asterisk will send not acceptable here if none of the codecs are in those you have configured to allow. It will also send it if you have insisted on a certain type of media security but the caller is unable to provide it.