Call Us Today! 877.742.2583




Page tree
Skip to end of metadata
Go to start of metadata

About

A description of how FreeSWITCH processes a typical SIP call.


 Click to expand Table of Contents


Typical SIP Call Between Registered FreeSWITCH™ Extensions


 Click here to expand UML diagram




Call States

Routing

In the routing state FreeSWITCH™ hunts through the XML dial plan. When it finds a condition test that returns true it builds a to-do list with name–value action pairs, including lists of variables to set and dialplan applications to execute later such as "bridge". During this routing state none of the applications encountered will be executed, except for a limited number that can be run immediately by including the "inline" attribute.

Execute

The execute state performs the instructions compiled in the routing state. The name–value pairs are parsed and executed.

Hangup

The hangup state either transfers the call back to the routing state, if there is a name–value pair that requests it, or else it will hang up the call.

Channel States

A channel (representing a call leg) will go occupy many different states during its lifetime. The table below lists the different states that a channel can occupy, and what each of those states means.

Channel StateDescription
CS_NEWChannel is newly created.
CS_INITChannel has been initialized.
CS_ROUTINGChannel is hunting through a dialplan for an extension to execute.
CS_SOFT_EXECUTEChannel is ready to execute from 3rd party control.
CS_EXECUTEChannel is executing its dialplan instructions.
CS_EXCHANGE_MEDIAChannel is exchanging media with another channel.
CS_PARKChannel is accepting media awaiting commands.
CS_CONSUME_MEDIAChannel is consuming all media and dropping it.
CS_HIBERNATEChannel is in a sleep state.
CS_RESETChannel is in a reset state.
CS_HANGUPChannel is flagged for hangup and ready to end. Media will now end, and no further call routing will occur.
CS_REPORTINGThe channel is already hung up, media has already ended, and now it's time to do any sort of reporting processes such as CDR logging.
CS_DESTROYChannel is ready to be destroyed and out of the state machine. Memory utilized by the channel is freed and memory pools are returned to the core.

State Handlers

Custom state handlers can be added to the channels either globally or on a per-channel basis. This will allow you to do your own custom reporting or clean up your own dynamically created objects, for example. Custom handlers can also then be removed from a channel.


See Also