linphone::ErrorInfo Class Reference

Object representing full details about a signaling error or status. More...

`#include <error_info.hh>`

Inheritance diagram for linphone::ErrorInfo:

## Public Member Functions

LINPHONECXX_PUBLIC | ErrorInfo (void *ptr, bool takeRef=true)
LINPHONECXX_PUBLIC _LinphoneErrorInfo * | cPtr ()
LINPHONECXX_PUBLIC std::string | getPhrase () const
| Get textual phrase from the error info.
LINPHONECXX_PUBLIC void | setPhrase (const std::string &phrase)
| Assign phrase to a ErrorInfo object.
LINPHONECXX_PUBLIC std::string | getProtocol () const
| Get protocol from the error info.
LINPHONECXX_PUBLIC void | setProtocol (const std::string &protocol)
| Assign protocol name to a ErrorInfo object.
LINPHONECXX_PUBLIC int | getProtocolCode () const
| Get the status code from the low level protocol (ex a SIP status code).
LINPHONECXX_PUBLIC void | setProtocolCode (int code)
| Assign protocol code to a ErrorInfo object.
LINPHONECXX_PUBLIC linphone::Reason | getReason () const
| Get reason code from the error info.
LINPHONECXX_PUBLIC void | setReason (linphone::Reason reason)
| Assign reason Reason to a ErrorInfo object.
LINPHONECXX_PUBLIC int | getRetryAfter () const
| Get Retry-After delay second from the error info.
LINPHONECXX_PUBLIC void | setRetryAfter (int retryAfter)
| Assign retry-after value to a ErrorInfo object.
LINPHONECXX_PUBLIC std::shared_ptr< linphone::ErrorInfo > | getSubErrorInfo () const
| Get pointer to chained ErrorInfo set in sub_ei.
LINPHONECXX_PUBLIC void | setSubErrorInfo (const std::shared_ptr< linphone::ErrorInfo > &appendedErrorInfo)
| Set the sub_ei in ErrorInfo to another ErrorInfo.
LINPHONECXX_PUBLIC std::string | getWarnings () const
| Provides additional information regarding the failure.
LINPHONECXX_PUBLIC void | setWarnings (const std::string &warnings)
| Assign warnings to a ErrorInfo object.
LINPHONECXX_PUBLIC void | set (const std::string &protocol, linphone::Reason reason, int code, const std::string &status, const std::string &warning)
| Assign information to a ErrorInfo object.

## Detailed Description

Object representing full details about a signaling error or status.

All ErrorInfo object returned by the liblinphone API are readonly and transcients. For safety they must be used immediately after obtaining them. Any other function call to the liblinphone may change their content or invalidate the pointer.

## Member Function Documentation

## getPhrase()

LINPHONECXX_PUBLIC std::string linphone::ErrorInfo::getPhrase | ( |  | ) | const

Get textual phrase from the error info.

This is the text that is provided by the peer in the protocol (SIP).

Returns
  The error phrase

## getProtocol()

LINPHONECXX_PUBLIC std::string linphone::ErrorInfo::getProtocol | ( |  | ) | const

Get protocol from the error info.

Returns
  The protocol.

## getProtocolCode()

LINPHONECXX_PUBLIC int linphone::ErrorInfo::getProtocolCode | ( |  | ) | const

Get the status code from the low level protocol (ex a SIP status code).

Returns
  The status code

## getReason()

LINPHONECXX_PUBLIC linphone::Reason linphone::ErrorInfo::getReason | ( |  | ) | const

Get reason code from the error info.

Returns
  A Reason object

## getRetryAfter()

LINPHONECXX_PUBLIC int linphone::ErrorInfo::getRetryAfter | ( |  | ) | const

Get Retry-After delay second from the error info.

Returns
  The Retry-After delay second

## getSubErrorInfo()

LINPHONECXX_PUBLIC std::shared_ptr< linphone::ErrorInfo > linphone::ErrorInfo::getSubErrorInfo | ( |  | ) | const

Get pointer to chained ErrorInfo set in sub_ei.

It corresponds to a Reason header in a received SIP response.

Returns
  ErrorInfo pointer defined in the ei object.

## getWarnings()

LINPHONECXX_PUBLIC std::string linphone::ErrorInfo::getWarnings | ( |  | ) | const

Provides additional information regarding the failure.

With SIP protocol, the content of "Warning" headers are returned.

Returns
  More details about the failure.

## set()

LINPHONECXX_PUBLIC void linphone::ErrorInfo::set | ( | const std::string & | protocol,
|  | linphone::Reason | reason,
|  | int | code,
|  | const std::string & | status,
|  | const std::string & | warning )

Assign information to a ErrorInfo object.

Parameters

  protocol | protocol name
  reason | reason from Reason enum
  code | protocol code
  status | description of the reason
  warning | warning message

## setPhrase()

LINPHONECXX_PUBLIC void linphone::ErrorInfo::setPhrase | ( | const std::string & | phrase | ) |

Assign phrase to a ErrorInfo object.

Parameters

  phrase | the phrase explaining the error

## setProtocol()

LINPHONECXX_PUBLIC void linphone::ErrorInfo::setProtocol | ( | const std::string & | protocol | ) |

Assign protocol name to a ErrorInfo object.

Parameters

  protocol | the protocol name

## setProtocolCode()

LINPHONECXX_PUBLIC void linphone::ErrorInfo::setProtocolCode | ( | int | code | ) |

Assign protocol code to a ErrorInfo object.

Parameters

  code | the protocol code

## setReason()

LINPHONECXX_PUBLIC void linphone::ErrorInfo::setReason | ( | linphone::Reason | reason | ) |

Assign reason Reason to a ErrorInfo object.

Parameters

  reason | reason from Reason enum

## setRetryAfter()

LINPHONECXX_PUBLIC void linphone::ErrorInfo::setRetryAfter | ( | int | retryAfter | ) |

Assign retry-after value to a ErrorInfo object.

Parameters

  retryAfter | the retry-after value

## setSubErrorInfo()

LINPHONECXX_PUBLIC void linphone::ErrorInfo::setSubErrorInfo | ( | const std::shared_ptr< linphone::ErrorInfo > & | appendedErrorInfo | ) |

Set the sub_ei in ErrorInfo to another ErrorInfo.

Used when a reason header is to be added in a SIP response. The first level ErrorInfo defines the SIP response code and phrase, the second (sub) #LinphoneErroInfo defining the content of the Reason header.

Parameters

  appendedErrorInfo | ErrorInfo to append

## setWarnings()

LINPHONECXX_PUBLIC void linphone::ErrorInfo::setWarnings | ( | const std::string & | warnings | ) |

Assign warnings to a ErrorInfo object.

Parameters

  warnings | the warnings

The documentation for this class was generated from the following file:

- error_info.hh