#include <stdio.h>
#include "../../ut.h"
#include "../../parser/msg_parser.h"
#include "../../parser/parse_supported.h"
#include "../../data_lump_rpl.h"
#include "../usrloc/usrloc.h"
#include "rerrno.h"
#include "reg_mod.h"
#include "regtime.h"
#include "reply.h"

Go to the source code of this file.
Defines | |
| #define | CONTACT_BEGIN "Contact: " |
| #define | CONTACT_BEGIN_LEN (sizeof(CONTACT_BEGIN) - 1) |
| #define | CONTACT_SEP ", " |
| #define | CONTACT_SEP_LEN (sizeof(CONTACT_SEP) - 1) |
| #define | E_INFO "P-Registrar-Error: " |
| #define | E_INFO_LEN (sizeof(E_INFO) - 1) |
| #define | EI_R_AOR_LEN "Address Of Record too long" |
| #define | EI_R_AOR_PARSE "Error while parsing AOR" |
| #define | EI_R_CALLID_LEN "Callid too long" |
| #define | EI_R_CID_MISS "Call-ID header not found" |
| #define | EI_R_CONTACT_LEN "Contact/received too long" |
| #define | EI_R_CS_MISS "CSeq header not found" |
| #define | EI_R_FINE "No problem" |
| #define | EI_R_INV_CSEQ "Invalid CSeq number" |
| #define | EI_R_INV_EXP "Invalid expires param in contact" |
| #define | EI_R_INV_Q "Invalid q param in contact" |
| #define | EI_R_OOO "Out of order request" |
| #define | EI_R_PARSE "Message parse error" |
| #define | EI_R_PARSE_CONT "Contact parse error" |
| #define | EI_R_PARSE_EXP "Expires parse error" |
| #define | EI_R_PARSE_PATH "Path parse error" |
| #define | EI_R_PATH_UNSUP "No support for found Path indicated" |
| #define | EI_R_RETRANS "Retransmission" |
| #define | EI_R_STAR_CONT "* used in contact and more than 1 contact" |
| #define | EI_R_STAR_EXP "* used in contact and expires is not zero" |
| #define | EI_R_TO_MISS "To header not found" |
| #define | EI_R_TO_USER "No username in To URI" |
| #define | EI_R_TOO_MANY "Too many registered contacts" |
| #define | EI_R_UL_DEL_C "usrloc_contact_delete failed" |
| #define | EI_R_UL_DEL_R "usrloc_record_delete failed" |
| #define | EI_R_UL_GET_R "usrloc_record_get failed" |
| #define | EI_R_UL_INS_C "usrloc_contact_insert failed" |
| #define | EI_R_UL_INS_R "usrloc_record_insert failed" |
| #define | EI_R_UL_NEW_R "usrloc_record_new failed" |
| #define | EI_R_UL_UPD_C "usrloc_contact_update failed" |
| #define | EI_R_UNESCAPE "Error while unescaping username" |
| #define | EXPIRES_PARAM ";expires=" |
| #define | EXPIRES_PARAM_LEN (sizeof(EXPIRES_PARAM) - 1) |
| #define | MAX_CONTACT_BUFFER 1024 |
| #define | MSG_200 "OK" |
| #define | MSG_400 "Bad Request" |
| #define | MSG_420 "Bad Extension" |
| #define | MSG_500 "Server Internal Error" |
| #define | MSG_503 "Service Unavailable" |
| #define | PATH "Path: " |
| #define | PATH_LEN (sizeof(PATH) - 1) |
| #define | Q_PARAM ";q=" |
| #define | Q_PARAM_LEN (sizeof(Q_PARAM) - 1) |
| #define | RETRY_AFTER "Retry-After: " |
| #define | RETRY_AFTER_LEN (sizeof(RETRY_AFTER) - 1) |
| #define | UNSUPPORTED "Unsupported: " |
| #define | UNSUPPORTED_LEN (sizeof(UNSUPPORTED) - 1) |
Functions | |
| static int | add_path (struct sip_msg *_m, str *_p) |
| static int | add_retry_after (struct sip_msg *_m) |
| static int | add_unsupported (struct sip_msg *_m, str *_p) |
| int | build_contact (ucontact_t *c) |
| Allocate a memory buffer and print Contact header fields into it. | |
| static unsigned int | calc_buf_len (ucontact_t *c) |
| Calculate the length of buffer needed to print contacts. | |
| void | free_contact_buf (void) |
| Release contact buffer if any. | |
| int | send_reply (struct sip_msg *_m) |
| Send a reply. | |
Variables | |
| int | codes [] |
| struct { | |
| char * buf | |
| int buf_len | |
| int data_len | |
| } | contact |
| Buffer for Contact header field. | |
| str | error_info [] |
Definition in file reply.c.
| #define CONTACT_BEGIN "Contact: " |
| #define CONTACT_BEGIN_LEN (sizeof(CONTACT_BEGIN) - 1) |
| #define CONTACT_SEP ", " |
| #define CONTACT_SEP_LEN (sizeof(CONTACT_SEP) - 1) |
| #define E_INFO "P-Registrar-Error: " |
| #define E_INFO_LEN (sizeof(E_INFO) - 1) |
| #define EI_R_PATH_UNSUP "No support for found Path indicated" |
| #define EXPIRES_PARAM ";expires=" |
| #define EXPIRES_PARAM_LEN (sizeof(EXPIRES_PARAM) - 1) |
| #define MSG_200 "OK" |
| #define MSG_400 "Bad Request" |
| #define MSG_420 "Bad Extension" |
| #define MSG_500 "Server Internal Error" |
| #define MSG_503 "Service Unavailable" |
| #define PATH "Path: " |
| #define PATH_LEN (sizeof(PATH) - 1) |
| #define RETRY_AFTER "Retry-After: " |
| #define RETRY_AFTER_LEN (sizeof(RETRY_AFTER) - 1) |
| #define UNSUPPORTED "Unsupported: " |
| #define UNSUPPORTED_LEN (sizeof(UNSUPPORTED) - 1) |
Definition at line 328 of file reply.c.
References add_lump_rpl(), buf, CRLF, CRLF_LEN, _str::len, LM_ERR, LUMP_RPL_HDR, LUMP_RPL_NODUP, PATH, PATH_LEN, pkg_malloc, and _str::s.
| static int add_retry_after | ( | struct sip_msg * | _m | ) | [static] |
Definition at line 306 of file reply.c.
References add_lump_rpl(), buf, CRLF, CRLF_LEN, int2str(), LM_ERR, LUMP_RPL_HDR, LUMP_RPL_NODUP, pkg_malloc, RETRY_AFTER, retry_after, and RETRY_AFTER_LEN.
Referenced by send_reply().
Definition at line 348 of file reply.c.
References add_lump_rpl(), buf, CRLF, CRLF_LEN, _str::len, LM_ERR, LUMP_RPL_HDR, LUMP_RPL_NODUP, pkg_malloc, _str::s, UNSUPPORTED, and UNSUPPORTED_LEN.
Referenced by send_reply().
| int build_contact | ( | ucontact_t * | c | ) |
Allocate a memory buffer and print Contact header fields into it.
Build Contact HF for reply.
Definition at line 117 of file reply.c.
References act_time, ucontact::c, calc_buf_len(), CONTACT_BEGIN, CONTACT_BEGIN_LEN, CONTACT_SEP, CONTACT_SEP_LEN, CRLF, CRLF_LEN, ucontact::expires, EXPIRES_PARAM, EXPIRES_PARAM_LEN, int2str(), _str::len, len, len_q(), LM_DBG, LM_ERR, ucontact::next, pkg_free, pkg_malloc, ucontact::q, q2str(), Q_PARAM, Q_PARAM_LEN, rcv_param, ucontact::received, _str::s, and VALID_CONTACT.
Referenced by add_contacts(), insert_contacts(), no_contacts(), and star().
| static unsigned int calc_buf_len | ( | ucontact_t * | c | ) | [inline, static] |
Calculate the length of buffer needed to print contacts.
Definition at line 82 of file reply.c.
References act_time, ucontact::c, CONTACT_BEGIN_LEN, CONTACT_SEP_LEN, CRLF_LEN, EXPIRES_PARAM_LEN, INT2STR_MAX_LEN, _str::len, len, len_q(), ucontact::next, ucontact::q, Q_PARAM_LEN, rcv_param, ucontact::received, _str::s, and VALID_CONTACT.
Referenced by build_contact().
| void free_contact_buf | ( | void | ) |
Release contact buffer if any.
Definition at line 440 of file reply.c.
References pkg_free.
Referenced by mod_destroy().
| int send_reply | ( | struct sip_msg * | _m | ) |
Send a reply.
Definition at line 368 of file reply.c.
References add_lump_rpl(), add_path(), add_retry_after(), add_unsupported(), sip_msg::buf, buf, CRLF, CRLF_LEN, E_INFO, E_INFO_LEN, F_SUPPORTED_PATH, get_supported, len, _str::len, LM_ERR, LUMP_RPL_HDR, LUMP_RPL_NODUP, LUMP_RPL_NOFREE, MSG_200, MSG_400, MSG_420, MSG_500, MSG_503, parse_supported(), path_enabled, path_mode, PATH_MODE_OFF, PATH_MODE_STRICT, sip_msg::path_vec, pkg_malloc, R_FINE, R_PATH_UNSUP, rerrno, retry_after, s, _str::s, sl_binds::send_reply, slb, str_init, and SUPPORTED_PATH_STR.
Referenced by load_sl(), save(), and w_send_reply().
| char* buf |
Definition at line 72 of file reply.c.
Referenced by _reply(), AAAPrintMessage(), add_dlg_rr_param(), add_event(), add_maxfwd_header(), add_path(), add_retry_after(), add_unsupported(), alter_mediaip(), alter_mediaport(), alter_rtcp(), ap_cvt(), bdb_is_database(), bdblib_log(), bla_handle_notify(), build_path_vector(), build_pidf(), build_req_buf_from_sip_req(), build_res_buf_from_sip_req(), build_res_buf_from_sip_res(), build_sipping(), build_uac_req(), clen_builder(), conf_show(), constr_multipart_body(), create_rcv_uri(), db_key(), db_oracle_new_connection(), dbt_is_database(), dbt_load_file(), decode_from(), decode_mail_url(), decode_uri_sip_xmpp(), decode_uri_xmpp_sip(), do_replace_body_f(), encode_from(), encode_uri_sip_xmpp(), encode_uri_xmpp_sip(), encodeCPL(), event_parser(), fix_nated_contact_f(), fix_nated_sdp_f(), FixContact(), forward_request(), generate_string(), get_name(), get_node_selector(), handle_publish(), id_builder(), insert_element(), mi_parse_tree(), mi_write_tree(), net_printf(), net_read_static(), nh_timer(), pres_process_body(), print_stats_info(), print_uac_request(), publ_build_hdr(), publ_send200ok(), put_command(), pv_printf_s(), q2str(), received_builder(), relay_reply(), replace_all_f(), replace_element(), replace_from(), resource_subscriptions(), rewrite_uri(), rport_builder(), send_as_sms(), send_http_get(), send_reply(), send_rtpp_command(), set_body_f(), set_rpl_body_f(), sl_send_reply_helper(), socket2str(), stream_node_callback(), subs_build_hdr(), t_uac_cancel(), timer_send_notify(), tlsops_alt(), tlsops_bits(), tlsops_cert_version(), tlsops_cipher(), tlsops_comp(), tlsops_desc(), tlsops_sn(), tlsops_validity(), tlsops_version(), update_filter(), use_media_proxy(), verify_callback(), warning_builder(), xj_send_sip_msg(), xmpp_component_child_process(), xmpp_send_sip_msg(), xmpp_server_child_process(), xode_from_file(), xr_build_response(), and xr_build_response_array().
| int buf_len |
Definition at line 73 of file reply.c.
Referenced by _reply_light(), get_name(), handle_publish(), publ_send200ok(), put_command(), send_as_sms(), t_uac(), and timer_send_notify().
struct { ... } contact [static] |
Buffer for Contact header field.
1.5.6