Asterisk ignoring the codec support


I am fairly new to Asterisk and I ran into the following issue when attempting to enable G722 codec. Despite enabling G722 via Settings–>SIP Settings Asterisk, the outbound INVITE doesn’t include the G722 codec. Here is what /etc/asterisk/sip_general_additional.conf looks like:

... alwaysauthreject=yes useragent=FPBX-2.10.1( disallow=all allow=g722 allow=ulaw allow=alaw allow=gsm ...

Here is a snippet of the sip debug trace:

Phone call is placed from the phone and as witnessed by Asterisk

<--- SIP read from UDP:<<<phone IP addr>>> ---> INVITE sip:xxx@yyyyy.zzz;user=phone SIP/2.0 … m=audio 53936 RTP/AVP 9 0 8 3 97 98 99 100 106 107 108 109 18 101 a=rtpmap:9 G722/8000 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 …

Asterisk turns around and forwards the call setup to the next hop

Reliably Transmitting (NAT) to ...<<<SIP server>>> INVITE xxx@yyyyy.zzz SIP/2.0 … m=audio 11938 RTP/AVP 0 3 101 a=rtpmap:0 PCMU/8000 a=rtpmap:3 GSM/8000 …

Besides not include G722 codec, I also notice that the ;user=phone

Lastly, here are some relevant environment info:

PIAF Installed Version = under *HARDWARE* │ │ FreePBX Version = │ │ Running Asterisk Version = │ │ Asterisk Source Version =

Any help to fix this issue will be much appreciated. I am looking forward to ramp up my knowledge of asterisk and contribute to the forum.



You need to see what codecs are explicitly allowed for the outbound peer.

You are right. I had to explicitly “allow=g722” in the outbound route definition in order for it to be included in the outbound session setup request.

Any ideas on how to keep the “;user=phone” from falling off?



I tried your suggestion it works.

Thanks a ton.


Yay :smiley:

I have been searching about this option ;usereqphone = no

; If yes, “;user=phone” is added to uri that contains ; a valid phone number

Im just curious, if can you malcolm explain a little bit deeper about this option please ?


It first came from:

which said it was added in order to make Broadworks happy.

That’s the best I’ve got, it’s an old, old option :smiley: