if (!sip->sip_user_agent && NH_PGET(nh, user_agent))
sip_add_make(msg, sip, sip_user_agent_class, NH_PGET(nh, user_agent));
+ if (!sip->sip_via && NH_PGET(nh, via))
+ sip_add_make(msg, sip, sip_via_class, NH_PGET(nh, via));
+
/** Any node implementing one or more event packages SHOULD include an
* appropriate @AllowEvents header indicating all supported events in
* all methods which initiate dialogs and their responses (such as
sip = NULL; /* Redirected */
if (sip == NULL) {
+ nr->nr_via = NULL, su_free(own, old->nr_via);
nr->nr_allow = NULL, su_free(own, old->nr_allow);
nr->nr_accept = NULL, su_free(own, old->nr_accept);
nr->nr_require = NULL, su_free(own, old->nr_require);
su_free(own, old->nr_supported);
}
+ if (sip->sip_via) {
+ nr->nr_via = sip_via_dup(own, sip->sip_via);
+ su_free(own, old->nr_via);
+ }
+
if (sip->sip_user_agent) {
nr->nr_user_agent = sip_user_agent_dup(own, sip->sip_user_agent);
su_free(own, old->nr_user_agent);
*/
struct nua_dialog_peer_info {
+ sip_via_t *nr_via;
sip_allow_t *nr_allow;
sip_accept_t *nr_accept;
sip_require_t *nr_require;
value = 0;
NHP_SET_STR(nhp, organization, value);
}
+ /* SIPTAG_VIA(via) */
+ else if (tag == siptag_via) {
+ NHP_SET_STR_BY_HEADER(nhp, via, value);
+ }
+ /* SIPTAG_VIA_STR(via_str) */
+ else if (tag == siptag_via_str) {
+ if (value == -1)
+ value = 0;
+ NHP_SET_STR(nhp, via, value);
+ }
/* NUTAG_REGISTRAR(registrar) */
else if (tag == nutag_registrar) {
NHP_SET_STR_BY_URL(nhp, char, registrar, value);
NHP_ZAP_OVERRIDEN(old, dst, msg_header_free, allow_events);
NHP_ZAP_OVERRIDEN(old, dst, su_free, user_agent);
NHP_ZAP_OVERRIDEN(old, dst, su_free, organization);
+ NHP_ZAP_OVERRIDEN(old, dst, su_free, via);
NHP_ZAP_OVERRIDEN(old, dst, su_free, m_display);
NHP_ZAP_OVERRIDEN(old, dst, su_free, m_username);
NHP_ZAP_OVERRIDEN(old, dst, su_free, m_params);
TIF_SIP(SIPTAG_ORGANIZATION, organization),
TIF(SIPTAG_ORGANIZATION_STR, organization),
+ TIF_SIP(SIPTAG_VIA, via),
+ TIF(SIPTAG_VIA_STR, via),
+
TIF(NUTAG_INITIAL_ROUTE, initial_route),
TIF_STR(NUTAG_INITIAL_ROUTE_STR, initial_route),
sip_allow_events_t *nhp_allow_events;
char const *nhp_user_agent;
char const *nhp_organization;
+ char const *nhp_via;
char const *nhp_m_display;
char const *nhp_m_username;
unsigned nhb_allow_events:1;
unsigned nhb_user_agent:1;
unsigned nhb_organization:1;
+ unsigned nhb_via:1;
unsigned nhb_m_display:1;
unsigned nhb_m_username:1;
sip_add_make(msg, sip, sip_organization_class,
NH_PGET(nh, organization)) < 0)
;
+ else if (!sip->sip_via && NH_PGET(nh, via) &&
+ sip_add_make(msg, sip, sip_via_class,
+ NH_PGET(nh, via)) < 0)
+ ;
else if (!sip->sip_allow && NH_PGET(nh, allow) &&
sip_add_dup(msg, sip, (void *)NH_PGET(nh, allow)) < 0)
;
*/
+/**@def NUTAG_VIA()
+ *
+ * Via string.
+ *
+ * Indicate the Via header used by the stack.
+ *
+ * @par Used with
+ * nua_set_params(), nua_set_hparams() \n
+ * nua_get_params(), nua_get_hparams(), #nua_r_get_params \n
+ * any handle-specific nua call
+ *
+ * @par Parameter type
+ * char const *
+ *
+ * @par Values
+ * See @RFC3261 \n
+ *
+ * Corresponding tag taking reference parameter is NUTAG_VIA_REF().
+ */
+tag_typedef_t nutag_via = STRTAG_TYPEDEF(via);
+
+/**@def NUTAG_VIA_REF(x)
+ * Reference tag for NUTAG_VIA().
+ */
+
/**@def NUTAG_ALLOW()
*
* Allow a method (or methods).
#define NUTAG_USER_AGENT_REF(x) nutag_user_agent_ref, tag_str_vr(&(x))
SOFIAPUBVAR tag_typedef_t nutag_user_agent_ref;
+#define NUTAG_VIA(x) nutag_via, tag_str_v(x)
+SOFIAPUBVAR tag_typedef_t nutag_via;
+#define NUTAG_VIA_REF(x) nutag_via_ref, tag_str_vr(&(x))
+SOFIAPUBVAR tag_typedef_t nutag_via_ref;
+
#define NUTAG_ALLOW(x) nutag_allow, tag_str_v(x)
SOFIAPUBVAR tag_typedef_t nutag_allow;
#define NUTAG_ALLOW_REF(x) nutag_allow_ref, tag_str_vr(&(x))