提交 545f4a91 authored 作者: Michael Jerris's avatar Michael Jerris

Wed Sep 10 09:29:17 EDT 2008 Pekka Pessi <first.last@nokia.com>

  * test_s2.c: allow user-specified VIA in requests from s2



git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9505 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 5563aa8a
...@@ -230,6 +230,8 @@ s2_nua_callback(nua_event_t event, ...@@ -230,6 +230,8 @@ s2_nua_callback(nua_event_t event,
*prev = e, e->prev = prev; *prev = e, e->prev = prev;
} }
/* ---------------------------------------------------------------------- */
/* SIP messages sent by nua */
struct message * struct message *
s2_remove_message(struct message *m) s2_remove_message(struct message *m)
...@@ -515,6 +517,7 @@ s2_request_to(struct dialog *d, ...@@ -515,6 +517,7 @@ s2_request_to(struct dialog *d,
sip_content_length_t l[1]; sip_content_length_t l[1];
tp_name_t tpn[1]; tp_name_t tpn[1];
tp_magic_t *magic; tp_magic_t *magic;
int user_via = 0;
ta_start(ta, tag, value); ta_start(ta, tag, value);
tags = ta_args(ta); tags = ta_args(ta);
...@@ -606,7 +609,10 @@ s2_request_to(struct dialog *d, ...@@ -606,7 +609,10 @@ s2_request_to(struct dialog *d,
cseq->cs_seq = ++d->lseq; cseq->cs_seq = ++d->lseq;
} }
if (d->invite && method == sip_method_cancel) { if (sip->sip_via) {
user_via = 1;
}
else if (d->invite && method == sip_method_cancel) {
*via = *sip_object(d->invite)->sip_via; *via = *sip_object(d->invite)->sip_via;
} }
else { else {
...@@ -626,7 +632,7 @@ s2_request_to(struct dialog *d, ...@@ -626,7 +632,7 @@ s2_request_to(struct dialog *d,
TAG_IF(!sip->sip_to, SIPTAG_TO(d->remote)), TAG_IF(!sip->sip_to, SIPTAG_TO(d->remote)),
TAG_IF(!sip->sip_call_id, SIPTAG_CALL_ID(d->call_id)), TAG_IF(!sip->sip_call_id, SIPTAG_CALL_ID(d->call_id)),
TAG_IF(!sip->sip_cseq, SIPTAG_CSEQ(cseq)), TAG_IF(!sip->sip_cseq, SIPTAG_CSEQ(cseq)),
SIPTAG_VIA(via), TAG_IF(!user_via, SIPTAG_VIA(via)),
TAG_IF(!sip->sip_content_length, SIPTAG_CONTENT_LENGTH(l)), TAG_IF(!sip->sip_content_length, SIPTAG_CONTENT_LENGTH(l)),
TAG_IF(!sip->sip_separator, SIPTAG_SEPARATOR_STR("\r\n")), TAG_IF(!sip->sip_separator, SIPTAG_SEPARATOR_STR("\r\n")),
TAG_END()); TAG_END());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论