Sunny
Sunny

Reputation: 10075

Want to simplify Asterisk SIP message flows

I am trying to implement a SIP UA and to do so, I studied the Asterisk console in debug mode for SIP. I tried to call one extension (A) from another extension (B).

The initial message flow up to the RINGING message, I understood, including the Digest Authentication part. These are:

   (B) >--->INVITE-----[Asterisk]

Followed by a series of back-and-forth messages:

  401 Unauthorized with NONCE
  ACK
  INVITE with correct Digest
  TRYING
  TRYING
  RINGING

After the ringing phone (A) is picked up, I see the following exchange of message:

  (A) >----> OK >-----> [Asterisk]  

   (A) <----< ACK<-----< [Asterisk]

                         [Asterisk] >----- OK ------> (B)

   (A) >---(re)INVITE--> [Asterisk] 

                         [Asterisk] <-----ACK-------< (B)

                         [Asterisk] >---(re)INVITE--> (B)

   (A) >---TRYING -----> [Asterisk]

                         [Asterisk] <-----OK--------< (B)

   (A) >-----OK--------> [Asterisk]

   (A) <----ACK--------< [Asterisk]

I am writing the UA part on the (B) side and know the SDP for A beforehand and can generate the SDP for B, which is in my control. My call flow will always be from B to A. I can control all message going from (B). How can I reduce the above message flow? Also, I do not fully understand the need for so many messages after the initial SDPs are exchanged until RINGING. Or are they?

Upvotes: 0

Views: 221

Answers (1)

arheops
arheops

Reputation: 15257

Asterisk will do like described in SIP standart(rfc).

You can't remove invites. Only things you can do is do disable early media and enable directmedia/ignore sdp part.

Upvotes: 1

Related Questions