Module: sip-router
Branch: master
Commit: e404d123610b63ddd1c75d39667b373c40071eab
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=e404d12…
Author: Kristian Frederik Høgh <kfh(a)uni-tel.dk>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Mon Sep 1 22:03:20 2014 +0200
tm: rebuild local Via when force socket is changed in event_route[tm:local-request]
- new forced socket is also set for sending out
---
modules/tm/uac.c | 48 +++++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 43 insertions(+), 5 deletions(-)
diff --git a/modules/tm/uac.c b/modules/tm/uac.c
index 104fc5d..cf78a78 100644
--- a/modules/tm/uac.c
+++ b/modules/tm/uac.c
@@ -83,6 +83,7 @@
#include "../../cfg_core.h" /* cfg_get(core, core_cfg, use_dns_failover) */
#endif
#ifdef WITH_EVENT_LOCAL_REQUEST
+#include "../../data_lump.h"
#include "../../receive.h"
#include "../../route.h"
#include "../../action.h"
@@ -406,18 +407,55 @@ static inline int t_uac_prepare(uac_req_t *uac_r,
lreq.dst_uri.len=0;
}
- if (unlikely(lreq.add_rm || lreq.body_lumps)) {
- LM_DBG("apply new updates to sip msg\n");
+ if(lreq.force_send_socket != uac_r->dialog->send_sock) {
+ LM_DBG("Send socket updated to: %.*s",
+ lreq.force_send_socket->address_str.len,
+ lreq.force_send_socket->address_str.s);
+
+ /* rebuild local Via - remove previous value
+ * and add the one for the new send socket */
+ if (!del_lump(&lreq, lreq.h_via1->name.s - lreq.buf,
+ lreq.h_via1->len, 0)) {
+ LM_ERR("Failed to remove previous local Via\n");
+ /* attempt a normal update to give it a chance */
+ goto normal_update;
+ }
+
+ /* reuse same branch value from previous local Via */
+ memcpy(lreq.add_to_branch_s, lreq.via1->branch->value.s,
+ lreq.via1->branch->value.len);
+ lreq.add_to_branch_len = lreq.via1->branch->value.len;
+
+ /* update also info about new destination and send sock */
+ uac_r->dialog->send_sock=lreq.force_send_socket;
+ request->dst.send_sock = lreq.force_send_socket;
+ request->dst.proto = lreq.force_send_socket->proto;
+
+ LM_DBG("apply new updates with Via to sip msg\n");
buf1 = build_req_buf_from_sip_req(&lreq,
- (unsigned int*)&buf_len1,
- &dst, BUILD_NO_LOCAL_VIA|BUILD_NO_VIA1_UPDATE|
- BUILD_IN_SHM);
+ (unsigned int*)&buf_len1, &dst, BUILD_IN_SHM);
if (likely(buf1)){
shm_free(buf);
buf = buf1;
buf_len = buf_len1;
/* a possible change of the method is not handled! */
}
+
+ } else {
+normal_update:
+ if (unlikely(lreq.add_rm || lreq.body_lumps)) {
+ LM_DBG("apply new updates without Via to sip msg\n");
+ buf1 = build_req_buf_from_sip_req(&lreq,
+ (unsigned int*)&buf_len1,
+ &dst, BUILD_NO_LOCAL_VIA|BUILD_NO_VIA1_UPDATE|
+ BUILD_IN_SHM);
+ if (likely(buf1)){
+ shm_free(buf);
+ buf = buf1;
+ buf_len = buf_len1;
+ /* a possible change of the method is not handled! */
+ }
+ }
}
lreq.buf=0; /* covers the obsolete DYN_BUF */
free_sip_msg(&lreq);
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#463 - Content of $dlg_vars are mixed with each other when writing cdr values on version 4.1.5-1.1
User who did this - Daniel-Constantin Mierla (miconda)
----------
What do you mean by 'contents of all $dlg_vars are mixed with each other'?
Can you provide more details and some examples?
----------
More information can be found at the following URL:
https://sip-router.org/tracker/index.php?do=details&task_id=463#comment1605
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task is now closed:
FS#449 - CRASH: Program terminated with signal 6, Aborted.
User who did this - Daniel-Constantin Mierla (miconda)
Reason for closing: Fixed
Additional comments about closing: Re-open if issue shows up after last commits.
More information can be found at the following URL:
https://sip-router.org/tracker/index.php?do=details&task_id=449
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task is now closed:
FS#451 - rtpproxy_manage with "l" option returns wrong ports
User who did this - Daniel-Constantin Mierla (miconda)
Reason for closing: Fixed
More information can be found at the following URL:
https://sip-router.org/tracker/index.php?do=details&task_id=451
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task is now closed:
FS#457 - FTBFS with clang instead of gcc ( Debian user report )
User who did this - Daniel-Constantin Mierla (miconda)
Reason for closing: Fixed
More information can be found at the following URL:
https://sip-router.org/tracker/index.php?do=details&task_id=457
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#457 - FTBFS with clang instead of gcc ( Debian user report )
User who did this - Daniel-Constantin Mierla (miconda)
----------
I replaced the rpc printf() api member with rpl_printf(), considering there is struct_printf(), just to keep some pattern there.
I couldn't reuse the patch that much because it replaced the tabs with whitespaces, breaking indentation. Also, the master has more rpc code.
Soon to be sequentially backported to 4.1.
----------
More information can be found at the following URL:
https://sip-router.org/tracker/index.php?do=details&task_id=457#comment1604
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.