SIP - SDP handshake error

Dear Asterisk Community,

I am integrating an Asterisk architecture (Opensips+Asterisk with PJSIP) with a SIP provider and we observe the following error.

SIP Provider sends an incoming INVITE which reaches Asterisk with the following SDP parameters:

Media Description, name and address (m): audio 40116 RTP/AVP 8 18 97
    Media Type: audio
    Media Port: 40116
    Media Protocol: RTP/AVP
    Media Format: ITU-T G.711 PCMA
    Media Format: ITU-T G.729
    Media Format: DynamicRTP-Type-97

where type 97 is defined as

Media Attribute (a): rtpmap:97 telephone-event/8000
    Media Attribute Fieldname: rtpmap
    Media Format: 97
    MIME Type: telephone-event
    Sample Rate: 8000
Media Attribute (a): fmtp:97 0-15
    Media Attribute Fieldname: fmtp
    Media Format: 97 [telephone-event]
    Media format specific parameters: 0-15

Asterisk replies 200 OK with the following SDP offer:

Media Description, name and address (m): audio 19558 RTP/AVP 8 97
    Media Type: audio
    Media Port: 19558
    Media Protocol: RTP/AVP
    Media Format: ITU-T G.711 PCMA
    Media Format: DynamicRTP-Type-97
Media Attribute (a): rtpmap:97 telephone-event/8000
    Media Attribute Fieldname: rtpmap
    Media Format: 97
    MIME Type: telephone-event
    Sample Rate: 8000
Media Attribute (a): fmtp:97 0-16
    Media Attribute Fieldname: fmtp
    Media Format: 97 [telephone-event]
    Media format specific parameters: 0-16

As you observe, Asterisk has changed the 0-15 to 0-16 and therefore SIP provider discards the call (BYE with Reason Media Negotiation Failed).

My question is how could Asterisk reply with 0-15. Is there such a configuration at the pjsip.conf file for example?

Thank you in advance for your time.

There is no such configuration. It’s hardcoded[1] to be 0-16.

[1] asterisk/res_pjsip_sdp_rtp.c at master · asterisk/asterisk · GitHub

As the provider is willing to accept a subset of what Asterisk is offering, there is no good reason for it to reject Asterisk. They are not going to send hook flash, so they shouldn’t care whether or not Asterisk supports it.

SDP isn’t really a negotiation. It is a statement of the capabilities of each side

Thank you all for your answers. I will communicate the response.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.