summaryrefslogtreecommitdiff
path: root/pjsip/include
diff options
context:
space:
mode:
Diffstat (limited to 'pjsip/include')
-rw-r--r--pjsip/include/pjsip-simple/errno.h22
-rw-r--r--pjsip/include/pjsip-simple/evsub.h15
-rw-r--r--pjsip/include/pjsip-simple/evsub_msg.h2
-rw-r--r--pjsip/include/pjsip-ua/sip_xfer.h9
-rw-r--r--pjsip/include/pjsip/sip_config.h6
-rw-r--r--pjsip/include/pjsip/sip_dialog.h2
-rw-r--r--pjsip/include/pjsip/sip_errno.h17
-rw-r--r--pjsip/include/pjsip/sip_event.h2
-rw-r--r--pjsip/include/pjsip/sip_msg.h43
-rw-r--r--pjsip/include/pjsip/sip_parser.h118
-rw-r--r--pjsip/include/pjsip/sip_ua_layer.h2
-rw-r--r--pjsip/include/pjsua-lib/pjsua.h121
12 files changed, 185 insertions, 174 deletions
diff --git a/pjsip/include/pjsip-simple/errno.h b/pjsip/include/pjsip-simple/errno.h
index 911333c8..ab3d4ec3 100644
--- a/pjsip/include/pjsip-simple/errno.h
+++ b/pjsip/include/pjsip-simple/errno.h
@@ -19,9 +19,10 @@
#ifndef __PJSIP_SIMPLE_ERRNO_H__
#define __PJSIP_SIMPLE_ERRNO_H__
-
#include <pjsip/sip_errno.h>
+PJ_BEGIN_DECL
+
/**
* Start of error code relative to PJ_ERRNO_START_USER.
*/
@@ -87,6 +88,25 @@
*/
#define PJSIP_SIMPLE_EBADISCOMPOSE (PJSIP_SIMPLE_ERRNO_START+40) /*270040*/
+/**
+ * Get error message for the specified error code. Note that this
+ * function is only able to decode PJSIP-SIMPLE specific error code.
+ * Application should use pj_strerror(), which should be able to
+ * decode all error codes belonging to all subsystems (e.g. pjlib,
+ * pjmedia, pjsip, etc).
+ *
+ * @param status The error code.
+ * @param buffer The buffer where to put the error message.
+ * @param bufsize Size of the buffer.
+ *
+ * @return The error message as NULL terminated string,
+ * wrapped with pj_str_t.
+ */
+PJ_DECL(pj_str_t) pjsipsimple_strerror(pj_status_t status,
+ char *buffer, pj_size_t bufsize);
+
+
+PJ_END_DECL
#endif /* __PJSIP_SIMPLE_ERRNO_H__ */
diff --git a/pjsip/include/pjsip-simple/evsub.h b/pjsip/include/pjsip-simple/evsub.h
index 3f67590b..1c3ee97c 100644
--- a/pjsip/include/pjsip-simple/evsub.h
+++ b/pjsip/include/pjsip-simple/evsub.h
@@ -202,15 +202,24 @@ typedef struct pjsip_evsub_user pjsip_evsub_user;
/**
+ * SUBSCRIBE method constant. @see pjsip_get_subscribe_method()
+ */
+PJ_DECL_DATA(const pjsip_method) pjsip_subscribe_method;
+
+/**
+ * NOTIFY method constant. @see pjsip_get_notify_method()
+ */
+PJ_DECL_DATA(const pjsip_method) pjsip_notify_method;
+
+/**
* SUBSCRIBE method constant.
*/
-extern const pjsip_method pjsip_subscribe_method;
+PJ_DECL(const pjsip_method*) pjsip_get_subscribe_method();
/**
* NOTIFY method constant.
*/
-extern const pjsip_method pjsip_notify_method;
-
+PJ_DECL(const pjsip_method*) pjsip_get_notify_method();
/**
diff --git a/pjsip/include/pjsip-simple/evsub_msg.h b/pjsip/include/pjsip-simple/evsub_msg.h
index a27e07aa..f1c3f4b7 100644
--- a/pjsip/include/pjsip-simple/evsub_msg.h
+++ b/pjsip/include/pjsip-simple/evsub_msg.h
@@ -104,7 +104,7 @@ PJ_DECL(pjsip_sub_state_hdr*) pjsip_sub_state_hdr_create(pj_pool_t *pool);
/**
* Initialize parser for event notify module.
*/
-PJ_DEF(void) pjsip_evsub_init_parser(void);
+PJ_DECL(void) pjsip_evsub_init_parser(void);
PJ_END_DECL
diff --git a/pjsip/include/pjsip-ua/sip_xfer.h b/pjsip/include/pjsip-ua/sip_xfer.h
index cbc3a7de..2ad9324e 100644
--- a/pjsip/include/pjsip-ua/sip_xfer.h
+++ b/pjsip/include/pjsip-ua/sip_xfer.h
@@ -61,10 +61,11 @@
PJ_BEGIN_DECL
-/**
- * Declaration for REFER method constant.
- */
-extern const pjsip_method pjsip_refer_method;
+/** Declaration for REFER method constant. */
+PJ_DECL_DATA(const pjsip_method) pjsip_refer_method;
+
+/** Get REFER method constant */
+PJ_DECL(const pjsip_method*) pjsip_get_refer_method();
/**
diff --git a/pjsip/include/pjsip/sip_config.h b/pjsip/include/pjsip/sip_config.h
index c591e0db..846c2a57 100644
--- a/pjsip/include/pjsip/sip_config.h
+++ b/pjsip/include/pjsip/sip_config.h
@@ -467,9 +467,9 @@
#define PJSIP_POOL_INC_USER_AGENT 1024
/* Message/URL related constants. */
-#define PJSIP_MAX_CALL_ID_LEN PJ_GUID_STRING_LENGTH
-#define PJSIP_MAX_TAG_LEN PJ_GUID_STRING_LENGTH
-#define PJSIP_MAX_BRANCH_LEN (PJSIP_RFC3261_BRANCH_LEN + PJ_GUID_STRING_LENGTH + 2)
+#define PJSIP_MAX_CALL_ID_LEN pj_GUID_STRING_LENGTH()
+#define PJSIP_MAX_TAG_LEN pj_GUID_STRING_LENGTH()
+#define PJSIP_MAX_BRANCH_LEN (PJSIP_RFC3261_BRANCH_LEN + pj_GUID_STRING_LENGTH() + 2)
#define PJSIP_MAX_HNAME_LEN 64
/* Dialog related constants. */
diff --git a/pjsip/include/pjsip/sip_dialog.h b/pjsip/include/pjsip/sip_dialog.h
index 00768ffd..626ec08b 100644
--- a/pjsip/include/pjsip/sip_dialog.h
+++ b/pjsip/include/pjsip/sip_dialog.h
@@ -86,6 +86,7 @@ typedef enum pjsip_dialog_state
PJSIP_DIALOG_STATE_ESTABLISHED
} pjsip_dialog_state;
+
/**
* This structure describes the dialog structure. Application MUST NOT
* try to SET the values here directly, but instead it MUST use the
@@ -126,6 +127,7 @@ struct pjsip_dialog
pjsip_role_e role; /**< Initial role. */
pj_bool_t uac_has_2xx;/**< UAC has received 2xx response? */
pj_bool_t secure; /**< Use secure transport? */
+ pj_bool_t add_allow; /**< Add Allow header in requests? */
pjsip_cid_hdr *call_id; /**< Call-ID header. */
pjsip_route_hdr route_set; /**< Route set. */
pjsip_auth_clt_sess auth_sess; /**< Client authentication session. */
diff --git a/pjsip/include/pjsip/sip_errno.h b/pjsip/include/pjsip/sip_errno.h
index 11823c9a..0e5ae2f1 100644
--- a/pjsip/include/pjsip/sip_errno.h
+++ b/pjsip/include/pjsip/sip_errno.h
@@ -487,6 +487,22 @@ PJ_BEGIN_DECL
#define PJSIP_TLS_ETIMEDOUT (PJSIP_ERRNO_START_PJSIP+172) /* 171172 */
+/**
+ * Get error message for the specified error code. Note that this
+ * function is only able to decode PJSIP specific error code.
+ * Application should use pj_strerror(), which should be able to
+ * decode all error codes belonging to all subsystems (e.g. pjlib,
+ * pjmedia, pjsip, etc).
+ *
+ * @param status The error code.
+ * @param buffer The buffer where to put the error message.
+ * @param bufsize Size of the buffer.
+ *
+ * @return The error message as NULL terminated string,
+ * wrapped with pj_str_t.
+ */
+PJ_DECL(pj_str_t) pjsip_strerror(pj_status_t status,
+ char *buffer, pj_size_t bufsize);
PJ_END_DECL
@@ -497,3 +513,4 @@ PJ_END_DECL
*/
#endif /* __PJSIP_SIP_ERRNO_H__ */
+
diff --git a/pjsip/include/pjsip/sip_event.h b/pjsip/include/pjsip/sip_event.h
index 0df0c044..e4b27ca1 100644
--- a/pjsip/include/pjsip/sip_event.h
+++ b/pjsip/include/pjsip/sip_event.h
@@ -218,7 +218,7 @@ struct pjsip_event
* @param e the event ID.
* @note defined in sip_util.c
*/
-PJ_DEF(const char *) pjsip_event_str(pjsip_event_id_e e);
+PJ_DECL(const char *) pjsip_event_str(pjsip_event_id_e e);
/**
* @}
diff --git a/pjsip/include/pjsip/sip_msg.h b/pjsip/include/pjsip/sip_msg.h
index 7a303521..906c4a5f 100644
--- a/pjsip/include/pjsip/sip_msg.h
+++ b/pjsip/include/pjsip/sip_msg.h
@@ -84,13 +84,44 @@ struct pjsip_method
/*
* For convenience, standard method structures are defined in the library.
*/
-extern const pjsip_method pjsip_invite_method; /**< INVITE structure. */
-extern const pjsip_method pjsip_cancel_method; /**< CANCEL structure. */
-extern const pjsip_method pjsip_ack_method; /**< ACK structure. */
-extern const pjsip_method pjsip_bye_method; /**< BYE structure. */
-extern const pjsip_method pjsip_register_method; /**< REGISTER structure.*/
-extern const pjsip_method pjsip_options_method; /**< OPTIONS structure. */
+/** INVITE method constant. @see pjsip_get_invite_method() */
+PJ_DECL_DATA(const pjsip_method) pjsip_invite_method;
+/** CANCEL method constant. @see pjsip_get_cancel_method() */
+PJ_DECL_DATA(const pjsip_method) pjsip_cancel_method;
+
+/** ACK method constant. @see pjsip_get_ack_method() */
+PJ_DECL_DATA(const pjsip_method) pjsip_ack_method;
+
+/** BYE method constant. @see pjsip_get_bye_method() */
+PJ_DECL_DATA(const pjsip_method) pjsip_bye_method;
+
+/** REGISTER method constant. @see pjsip_get_register_method() */
+PJ_DECL_DATA(const pjsip_method) pjsip_register_method;
+
+/** OPTIONS method constant. @see pjsip_get_options_method() */
+PJ_DECL_DATA(const pjsip_method) pjsip_options_method;
+
+/*
+ * Accessor functions for standard SIP methods.
+ */
+/** Get INVITE method constant. */
+PJ_DECL(const pjsip_method*) pjsip_get_invite_method(void);
+/** Get CANCEL method constant. */
+PJ_DECL(const pjsip_method*) pjsip_get_cancel_method(void);
+/** Get ACK method constant. */
+PJ_DECL(const pjsip_method*) pjsip_get_ack_method(void);
+/** Get BYE method constant. */
+PJ_DECL(const pjsip_method*) pjsip_get_bye_method(void);
+/** Get REGISTER method constant.*/
+PJ_DECL(const pjsip_method*) pjsip_get_register_method(void);
+/** Get OPTIONS method constant. */
+PJ_DECL(const pjsip_method*) pjsip_get_options_method(void);
+
+
+/*
+ * Accessor functions
+ */
/**
* Initialize the method structure from a string.
diff --git a/pjsip/include/pjsip/sip_parser.h b/pjsip/include/pjsip/sip_parser.h
index ef8277fb..804aed1c 100644
--- a/pjsip/include/pjsip/sip_parser.h
+++ b/pjsip/include/pjsip/sip_parser.h
@@ -315,51 +315,64 @@ PJ_DECL(pj_status_t) pjsip_parse_headers( pj_pool_t *pool,
*/
-/*
- * Various specification used in parsing, exported here as extern for other
- * parsers.
+/**
+ * Parser constants. @see pjsip_parser_const()
*/
-extern pj_cis_t
- pjsip_HOST_SPEC, /**< For scanning host part. */
- pjsip_DIGIT_SPEC, /**< Decimal digits */
- pjsip_ALPHA_SPEC, /**< Alpha (A-Z, a-z) */
- pjsip_ALNUM_SPEC, /**< Decimal + Alpha. */
- pjsip_TOKEN_SPEC, /**< Token. */
- pjsip_TOKEN_SPEC_ESC, /**< Token without '%' character */
- pjsip_HEX_SPEC, /**< Hexadecimal digits. */
- pjsip_PARAM_CHAR_SPEC, /**< For scanning pname (or pvalue when it's
- not quoted.) in URI */
- pjsip_PARAM_CHAR_SPEC_ESC, /**< Variant without the escape ('%') char */
- pjsip_HDR_CHAR_SPEC, /**< Chars in hname/havalue in URL. */
- pjsip_HDR_CHAR_SPEC_ESC, /**< Variant without the escape ('%') char */
- pjsip_PROBE_USER_HOST_SPEC, /**< Hostname characters. */
- pjsip_PASSWD_SPEC, /**< Password. */
- pjsip_PASSWD_SPEC_ESC, /**< Variant without the escape ('%') char */
- pjsip_USER_SPEC, /**< User */
- pjsip_USER_SPEC_ESC, /**< Variant without the escape ('%') char */
- pjsip_NOT_NEWLINE, /**< For eating up header, basicly any chars
- except newlines or zero. */
- pjsip_NOT_COMMA_OR_NEWLINE, /**< Array elements. */
- pjsip_DISPLAY_SPEC; /**< Used when searching for display name. */
+typedef struct pjsip_parser_const_t
+{
+ const pj_str_t pjsip_USER_STR; /**< "user" string constant. */
+ const pj_str_t pjsip_METHOD_STR; /**< "method" string constant */
+ const pj_str_t pjsip_TRANSPORT_STR; /**< "transport" string const. */
+ const pj_str_t pjsip_MADDR_STR; /**< "maddr" string const. */
+ const pj_str_t pjsip_LR_STR; /**< "lr" string const. */
+ const pj_str_t pjsip_SIP_STR; /**< "sip" string constant. */
+ const pj_str_t pjsip_SIPS_STR; /**< "sips" string constant. */
+ const pj_str_t pjsip_TEL_STR; /**< "tel" string constant. */
+ const pj_str_t pjsip_BRANCH_STR; /**< "branch" string constant. */
+ const pj_str_t pjsip_TTL_STR; /**< "ttl" string constant. */
+ const pj_str_t pjsip_RECEIVED_STR; /**< "received" string const. */
+ const pj_str_t pjsip_Q_STR; /**< "q" string constant. */
+ const pj_str_t pjsip_EXPIRES_STR; /**< "expires" string constant. */
+ const pj_str_t pjsip_TAG_STR; /**< "tag" string constant. */
+ const pj_str_t pjsip_RPORT_STR; /**< "rport" string const. */
+
+ pj_cis_t pjsip_HOST_SPEC; /**< For scanning host part. */
+ pj_cis_t pjsip_DIGIT_SPEC; /**< Decimal digits */
+ pj_cis_t pjsip_ALPHA_SPEC; /**< Alpha (A-Z, a-z) */
+ pj_cis_t pjsip_ALNUM_SPEC; /**< Decimal + Alpha. */
+ pj_cis_t pjsip_TOKEN_SPEC; /**< Token. */
+ pj_cis_t pjsip_TOKEN_SPEC_ESC; /**< Token without '%' character */
+ pj_cis_t pjsip_HEX_SPEC; /**< Hexadecimal digits. */
+ pj_cis_t pjsip_PARAM_CHAR_SPEC; /**< For scanning pname (or pvalue
+ when it's not quoted.) in URI */
+ pj_cis_t pjsip_PARAM_CHAR_SPEC_ESC; /**< Variant without the escape ('%')
+ char */
+ pj_cis_t pjsip_HDR_CHAR_SPEC; /**< Chars in hname/havalue in URL. */
+ pj_cis_t pjsip_HDR_CHAR_SPEC_ESC; /**< Variant without the escape ('%')
+ char */
+ pj_cis_t pjsip_PROBE_USER_HOST_SPEC;/**< Hostname characters. */
+ pj_cis_t pjsip_PASSWD_SPEC; /**< Password. */
+ pj_cis_t pjsip_PASSWD_SPEC_ESC; /**< Variant without the escape ('%')
+ char */
+ pj_cis_t pjsip_USER_SPEC; /**< User */
+ pj_cis_t pjsip_USER_SPEC_ESC; /**< Variant without the escape ('%')
+ char */
+ pj_cis_t pjsip_USER_SPEC_LENIENT; /**< User, with additional '#' char */
+ pj_cis_t pjsip_USER_SPEC_LENIENT_ESC;/**< pjsip_USER_SPEC_ESC with '#' */
+ pj_cis_t pjsip_NOT_NEWLINE; /**< For eating up header, basically
+ any chars except newlines or
+ zero. */
+ pj_cis_t pjsip_NOT_COMMA_OR_NEWLINE;/**< Array elements. */
+ pj_cis_t pjsip_DISPLAY_SPEC; /**< Used when searching for display
+ name. */
+
+} pjsip_parser_const_t;
-/*
- * Various string constants.
+
+/**
+ * Get parser constants.
*/
-extern const pj_str_t pjsip_USER_STR, /**< "user" string constant. */
- pjsip_METHOD_STR, /**< "method" string constant */
- pjsip_TRANSPORT_STR, /**< "transport" string const. */
- pjsip_MADDR_STR, /**< "maddr" string const. */
- pjsip_LR_STR, /**< "lr" string const. */
- pjsip_SIP_STR, /**< "sip" string constant. */
- pjsip_SIPS_STR, /**< "sips" string constant. */
- pjsip_TEL_STR, /**< "tel" string constant. */
- pjsip_BRANCH_STR, /**< "branch" string constant. */
- pjsip_TTL_STR, /**< "ttl" string constant. */
- pjsip_RECEIVED_STR, /**< "received" string const. */
- pjsip_Q_STR, /**< "q" string constant. */
- pjsip_EXPIRES_STR, /**< "expires" string constant. */
- pjsip_TAG_STR, /**< "tag" string constant. */
- pjsip_RPORT_STR; /**< "rport" string const. */
+PJ_DECL(const pjsip_parser_const_t*) pjsip_parser_const(void);
/*
@@ -371,17 +384,18 @@ enum
};
/* Parse parameter in header (matching the character as token) */
-void pjsip_parse_param_imp( pj_scanner *scanner, pj_pool_t *pool,
- pj_str_t *pname, pj_str_t *pvalue,
- unsigned opt);
+PJ_DECL(void) pjsip_parse_param_imp(pj_scanner *scanner, pj_pool_t *pool,
+ pj_str_t *pname, pj_str_t *pvalue,
+ unsigned opt);
/* Parse parameter in URL (matching the character as paramchar) */
-void pjsip_parse_uri_param_imp( pj_scanner *scanner, pj_pool_t *pool,
- pj_str_t *pname, pj_str_t *pvalue,
- unsigned opt);
-void pjsip_concat_param_imp( pj_str_t *param, pj_pool_t *pool,
- const pj_str_t *pname, const pj_str_t *pvalue,
- int sepchar);
-void pjsip_parse_end_hdr_imp ( pj_scanner *scanner );
+PJ_DECL(void) pjsip_parse_uri_param_imp(pj_scanner *scanner, pj_pool_t *pool,
+ pj_str_t *pname, pj_str_t *pvalue,
+ unsigned opt);
+PJ_DECL(void) pjsip_concat_param_imp(pj_str_t *param, pj_pool_t *pool,
+ const pj_str_t *pname,
+ const pj_str_t *pvalue,
+ int sepchar);
+PJ_DECL(void) pjsip_parse_end_hdr_imp ( pj_scanner *scanner );
PJ_END_DECL
diff --git a/pjsip/include/pjsip/sip_ua_layer.h b/pjsip/include/pjsip/sip_ua_layer.h
index e08d7396..67d3e644 100644
--- a/pjsip/include/pjsip/sip_ua_layer.h
+++ b/pjsip/include/pjsip/sip_ua_layer.h
@@ -114,7 +114,7 @@ PJ_DECL(pj_status_t) pjsip_ua_destroy(void);
*
* @param detail If non-zero, list of dialogs will be printed.
*/
-PJ_DEF(void) pjsip_ua_dump(pj_bool_t detail);
+PJ_DECL(void) pjsip_ua_dump(pj_bool_t detail);
/**
* Get the endpoint instance of a user agent module.
diff --git a/pjsip/include/pjsua-lib/pjsua.h b/pjsip/include/pjsua-lib/pjsua.h
index 78f8b1bd..73793247 100644
--- a/pjsip/include/pjsua-lib/pjsua.h
+++ b/pjsip/include/pjsua-lib/pjsua.h
@@ -474,16 +474,8 @@ typedef struct pjsua_logging_config
logging_cfg = py_pjsua.logging_config_default()
* \endcode
*/
-PJ_INLINE(void) pjsua_logging_config_default(pjsua_logging_config *cfg)
-{
- pj_bzero(cfg, sizeof(*cfg));
+PJ_DECL(void) pjsua_logging_config_default(pjsua_logging_config *cfg);
- cfg->msg_logging = PJ_TRUE;
- cfg->level = 5;
- cfg->console_level = 4;
- cfg->decor = PJ_LOG_HAS_SENDER | PJ_LOG_HAS_TIME |
- PJ_LOG_HAS_MICRO_SEC | PJ_LOG_HAS_NEWLINE;
-}
/**
* Use this function to duplicate logging config.
@@ -496,14 +488,9 @@ PJ_INLINE(void) pjsua_logging_config_default(pjsua_logging_config *cfg)
* Not available (for now). Ideally we should be able to just assign
* one config to another, but this has not been tested.
*/
-PJ_INLINE(void) pjsua_logging_config_dup(pj_pool_t *pool,
- pjsua_logging_config *dst,
- const pjsua_logging_config *src)
-{
- pj_memcpy(dst, src, sizeof(*src));
- pj_strdup_with_null(pool, &dst->log_filename, &src->log_filename);
-}
-
+PJ_DECL(void) pjsua_logging_config_dup(pj_pool_t *pool,
+ pjsua_logging_config *dst,
+ const pjsua_logging_config *src);
/**
@@ -1015,13 +1002,7 @@ typedef struct pjsua_config
* \endcode
*/
-PJ_INLINE(void) pjsua_config_default(pjsua_config *cfg)
-{
- pj_bzero(cfg, sizeof(*cfg));
-
- cfg->max_calls = 4;
- cfg->thread_cnt = 1;
-}
+PJ_DECL(void) pjsua_config_default(pjsua_config *cfg);
/**
@@ -1035,16 +1016,9 @@ PJ_INLINE(void) pjsua_config_default(pjsua_config *cfg)
* Not applicable (for now). Probably we could just assign one credential
* variable to another, but this has not been tested.
*/
-PJ_INLINE(void) pjsip_cred_dup( pj_pool_t *pool,
- pjsip_cred_info *dst,
- const pjsip_cred_info *src)
-{
- pj_strdup_with_null(pool, &dst->realm, &src->realm);
- pj_strdup_with_null(pool, &dst->scheme, &src->scheme);
- pj_strdup_with_null(pool, &dst->username, &src->username);
- pj_strdup_with_null(pool, &dst->data, &src->data);
-
-}
+PJ_DECL(void) pjsip_cred_dup( pj_pool_t *pool,
+ pjsip_cred_info *dst,
+ const pjsip_cred_info *src);
/**
@@ -1054,29 +1028,9 @@ PJ_INLINE(void) pjsip_cred_dup( pj_pool_t *pool,
* @param dst Destination config.
* @param src Source config.
*/
-PJ_INLINE(void) pjsua_config_dup(pj_pool_t *pool,
- pjsua_config *dst,
- const pjsua_config *src)
-{
- unsigned i;
-
- pj_memcpy(dst, src, sizeof(*src));
-
- for (i=0; i<src->outbound_proxy_cnt; ++i) {
- pj_strdup_with_null(pool, &dst->outbound_proxy[i],
- &src->outbound_proxy[i]);
- }
-
- for (i=0; i<src->cred_count; ++i) {
- pjsip_cred_dup(pool, &dst->cred_info[i], &src->cred_info[i]);
- }
-
- pj_strdup_with_null(pool, &dst->user_agent, &src->user_agent);
- pj_strdup_with_null(pool, &dst->stun_domain, &src->stun_domain);
- pj_strdup_with_null(pool, &dst->stun_host, &src->stun_host);
- pj_strdup_with_null(pool, &dst->stun_relay_host, &src->stun_relay_host);
-}
-
+PJ_DECL(void) pjsua_config_dup(pj_pool_t *pool,
+ pjsua_config *dst,
+ const pjsua_config *src);
/**
@@ -1137,12 +1091,7 @@ typedef struct pjsua_msg_data
msg_data = py_pjsua.msg_data_init()
* \endcode
*/
-PJ_INLINE(void) pjsua_msg_data_init(pjsua_msg_data *msg_data)
-{
- pj_bzero(msg_data, sizeof(*msg_data));
- pj_list_init(&msg_data->hdr_list);
-}
-
+PJ_DECL(void) pjsua_msg_data_init(pjsua_msg_data *msg_data);
/**
@@ -1485,11 +1434,7 @@ typedef struct pjsua_transport_config
transport_cfg = py_pjsua.transport_config_default()
* \endcode
*/
-PJ_INLINE(void) pjsua_transport_config_default(pjsua_transport_config *cfg)
-{
- pj_bzero(cfg, sizeof(*cfg));
- pjsip_tls_setting_default(&cfg->tls_setting);
-}
+PJ_DECL(void) pjsua_transport_config_default(pjsua_transport_config *cfg);
/**
@@ -1503,14 +1448,9 @@ PJ_INLINE(void) pjsua_transport_config_default(pjsua_transport_config *cfg)
* Not applicable. One should be able to just copy one variable instance
* to another in Python.
*/
-PJ_INLINE(void) pjsua_transport_config_dup(pj_pool_t *pool,
- pjsua_transport_config *dst,
- const pjsua_transport_config *src)
-{
- PJ_UNUSED_ARG(pool);
- pj_memcpy(dst, src, sizeof(*src));
-}
-
+PJ_DECL(void) pjsua_transport_config_dup(pj_pool_t *pool,
+ pjsua_transport_config *dst,
+ const pjsua_transport_config *src);
/**
@@ -1916,14 +1856,7 @@ typedef struct pjsua_acc_config
acc_cfg = py_pjsua.acc_config_default()
* \endcode
*/
-PJ_INLINE(void) pjsua_acc_config_default(pjsua_acc_config *cfg)
-{
- pj_bzero(cfg, sizeof(*cfg));
-
- cfg->reg_timeout = PJSUA_REG_INTERVAL;
- cfg->transport_id = PJSUA_INVALID_ID;
-}
-
+PJ_DECL(void) pjsua_acc_config_default(pjsua_acc_config *cfg);
/**
@@ -3064,10 +2997,7 @@ typedef struct pjsua_buddy_info
buddy_cfg = py_pjsua.buddy_config_default()
* \endcode
*/
-PJ_INLINE(void) pjsua_buddy_config_default(pjsua_buddy_config *cfg)
-{
- pj_bzero(cfg, sizeof(*cfg));
-}
+PJ_DECL(void) pjsua_buddy_config_default(pjsua_buddy_config *cfg);
/**
@@ -3555,20 +3485,7 @@ struct pjsua_media_config
media_cfg = py_pjsua.media_config_default()
* \endcode
*/
-PJ_INLINE(void) pjsua_media_config_default(pjsua_media_config *cfg)
-{
- pj_bzero(cfg, sizeof(*cfg));
-
- cfg->clock_rate = PJSUA_DEFAULT_CLOCK_RATE;
- cfg->max_media_ports = 32;
- cfg->has_ioqueue = PJ_TRUE;
- cfg->thread_cnt = 1;
- cfg->quality = PJSUA_DEFAULT_CODEC_QUALITY;
- cfg->ilbc_mode = PJSUA_DEFAULT_ILBC_MODE;
- cfg->ec_tail_len = PJSUA_DEFAULT_EC_TAIL_LEN;
- cfg->jb_init = cfg->jb_min_pre = cfg->jb_max_pre = cfg->jb_max = -1;
-}
-
+PJ_DECL(void) pjsua_media_config_default(pjsua_media_config *cfg);
/**