#include <stdio.h>
#include "../../str.h"
#include "../../parser/parse_rr.h"
#include "../../parser/msg_parser.h"


Go to the source code of this file.
Data Structures | |
| struct | dlg |
| struct | dlg_hooks |
| struct | dlg_id |
| struct | dlg_seq |
Typedefs | |
| typedef int(* | dlg_add_extra_f )(dlg_t *_d, str *_ldname, str *_rdname) |
| typedef struct dlg_hooks | dlg_hooks_t |
| typedef struct dlg_id | dlg_id_t |
| typedef int(* | dlg_request_uas_f )(dlg_t *_d, struct sip_msg *_m) |
| typedef int(* | dlg_response_uac_f )(dlg_t *_d, struct sip_msg *_m) |
| typedef struct dlg_seq | dlg_seq_t |
| typedef enum dlg_state | dlg_state_t |
| typedef struct dlg | dlg_t |
| typedef void(* | free_dlg_f )(dlg_t *_d) |
| typedef int(* | new_dlg_uac_f )(str *_cid, str *_ltag, unsigned int _lseq, str *_luri, str *_ruri, dlg_t **_d) |
| typedef int(* | new_dlg_uas_f )(struct sip_msg *_req, int _code, dlg_t **_d) |
| typedef void(* | print_dlg_f )(FILE *out, dlg_t *_d) |
Enumerations | |
| enum | dlg_state { DLG_NEW = 0, DLG_EARLY, DLG_CONFIRMED, DLG_DESTROYED } |
Functions | |
| int | calculate_routeset_length (dlg_t *_d) |
| Calculate length of the route set. | |
| int | dlg_add_extra (dlg_t *_d, str *_ldname, str *_rdname) |
| Store display names into a dialog. | |
| int | dlg_request_uas (dlg_t *_d, struct sip_msg *_m) |
| UAS side - update a dialog from a request. | |
| int | dlg_response_uac (dlg_t *_d, struct sip_msg *_m) |
| A response arrived, update dialog. | |
| void | free_dlg (dlg_t *_d) |
| Destroy a dialog state. | |
| int | new_dlg_uac (str *_cid, str *_ltag, unsigned int _lseq, str *_luri, str *_ruri, dlg_t **_d) |
| Create a new dialog. | |
| int | new_dlg_uas (struct sip_msg *_req, int _code, dlg_t **_d) |
| Establishing a new dialog from the UAS side. | |
| void | print_dlg (FILE *out, dlg_t *_d) |
| Print a dialog structure, just for debugging. | |
| char * | print_routeset (char *buf, dlg_t *_d) |
| Print the route set. | |
| int | w_calculate_hooks (dlg_t *_d) |
| Small wrapper to calculate_hooks. | |
Definition in file dlg.h.
| typedef int(* dlg_add_extra_f)(dlg_t *_d, str *_ldname, str *_rdname) |
| typedef struct dlg_hooks dlg_hooks_t |
It is necessary to analyze the dialog data to find out what URI put into the Record-Route, where the message should be really sent and how to construct the route set of the message. This structure stores this information so we don't have to calculate each time we want to send a message within dialog
| typedef int(* dlg_request_uas_f)(dlg_t *_d, struct sip_msg *_m) |
| typedef int(* dlg_response_uac_f)(dlg_t *_d, struct sip_msg *_m) |
| typedef enum dlg_state dlg_state_t |
| typedef void(* free_dlg_f)(dlg_t *_d) |
| typedef int(* new_dlg_uas_f)(struct sip_msg *_req, int _code, dlg_t **_d) |
| typedef void(* print_dlg_f)(FILE *out, dlg_t *_d) |
| enum dlg_state |
| int calculate_routeset_length | ( | dlg_t * | _d | ) |
Calculate length of the route set.
| _d | dialog set |
Definition at line 896 of file dlg.c.
References CRLF_LEN, dlg_hooks::first_route, dlg::hooks, dlg_hooks::last_route, _str::len, rr::len, len, rr::next, ROUTE_PREFIX_LEN, and ROUTE_SEPARATOR_LEN.
Referenced by build_uac_req().
Store display names into a dialog.
| _d | dialog state | |
| _ldname | local display name | |
| _rdname | remote display name |
Definition at line 211 of file dlg.c.
References LM_ERR, dlg::loc_dname, dlg::rem_dname, and shm_str_dup().
Referenced by load_tm().
UAS side - update a dialog from a request.
| _d | dialog state | |
| _m | SIP request |
Definition at line 846 of file dlg.c.
References sip_msg::first_line, get_contact_uri(), get_cseq_value(), HDR_CONTACT_F, HDR_CSEQ_F, dlg_seq::is_set, _str::len, LM_ERR, METHOD_INVITE, parse_headers(), dlg::rem_seq, dlg::rem_target, msg_start::request, _str::s, shm_free, shm_str_dup(), msg_start::u, and dlg_seq::value.
Referenced by load_tm().
A response arrived, update dialog.
| _d | dialog state | |
| _m | SIP message |
Definition at line 605 of file dlg.c.
References DLG_CONFIRMED, dlg_confirmed_resp_uac(), DLG_DESTROYED, DLG_EARLY, dlg_early_resp_uac(), DLG_NEW, dlg_new_resp_uac(), LM_ERR, and dlg::state.
Referenced by load_tm(), and mi_print_uris().
| void free_dlg | ( | dlg_t * | _d | ) |
Destroy a dialog state.
| _d | dialog state |
Definition at line 978 of file dlg.c.
References dlg_id::call_id, dlg::id, dlg::loc_dname, dlg_id::loc_tag, dlg::loc_uri, dlg::rem_dname, dlg_id::rem_tag, dlg::rem_target, dlg::rem_uri, dlg::route_set, _str::s, shm_free, and shm_free_rr().
Referenced by load_tm(), mi_print_uris(), new_dlg_uas(), and request().
| int new_dlg_uac | ( | str * | _cid, | |
| str * | _ltag, | |||
| unsigned int | _lseq, | |||
| str * | _luri, | |||
| str * | _ruri, | |||
| dlg_t ** | _d | |||
| ) |
Create a new dialog.
| _cid | Callid | |
| _ltag | local tag (usually From tag) | |
| _lseq | local sequence (usually CSeq) | |
| _luri | local URI (usually From) | |
| _ruri | remote URI (usually To) | |
| _d | dialog state |
Definition at line 160 of file dlg.c.
References calculate_hooks(), dlg_id::call_id, dlg::id, dlg_seq::is_set, LM_ERR, dlg::loc_seq, dlg_id::loc_tag, dlg::loc_uri, dlg::rem_uri, shm_free, shm_malloc(), shm_str_dup(), and dlg_seq::value.
Referenced by load_tm(), req_outside(), and request().
Establishing a new dialog from the UAS side.
| _req | SIP request | |
| _code | request code | |
| _d | dialog state |
Definition at line 791 of file dlg.c.
References calc_crc_suffix(), calculate_hooks(), DLG_CONFIRMED, free_dlg(), dlg::id, _str::len, LM_DBG, LM_ERR, dlg_id::loc_tag, request2dlg(), _str::s, shm_free, shm_malloc(), shm_str_dup(), dlg::state, tm_tag_suffix, tm_tags, and TOTAG_VALUE_LEN.
Referenced by load_tm().
| void print_dlg | ( | FILE * | out, | |
| dlg_t * | _d | |||
| ) |
Print a dialog structure, just for debugging.
| out | file | |
| _d | dialog state |
Definition at line 1005 of file dlg.c.
References dlg_id::call_id, DLG_CONFIRMED, DLG_DESTROYED, DLG_EARLY, DLG_NEW, dlg_hooks::first_route, dlg::hooks, dlg::id, dlg_seq::is_set, dlg_hooks::last_route, rr::len, _str::len, dlg::loc_dname, dlg::loc_seq, dlg_id::loc_tag, dlg::loc_uri, name_addr::name, rr::nameaddr, dlg_hooks::next_hop, print_rr(), dlg::rem_dname, dlg::rem_seq, dlg_id::rem_tag, dlg::rem_target, dlg::rem_uri, dlg_hooks::request_uri, dlg::route_set, _str::s, dlg::state, and dlg_seq::value.
Referenced by load_tm().
| char* print_routeset | ( | char * | buf, | |
| dlg_t * | _d | |||
| ) |
Print the route set.
| buf | buffer | |
| _d | dialog state |
Definition at line 930 of file dlg.c.
References CRLF, CRLF_LEN, dlg_hooks::first_route, dlg::hooks, dlg_hooks::last_route, _str::len, rr::len, name_addr::name, rr::nameaddr, rr::next, ROUTE_PREFIX, ROUTE_PREFIX_LEN, ROUTE_SEPARATOR, ROUTE_SEPARATOR_LEN, and _str::s.
Referenced by build_uac_req().
| int w_calculate_hooks | ( | dlg_t * | _d | ) |
1.5.6