Hi Daniel
No, replies are not dropped.
I looked into source code, particularly tmx_mod.c::t_cancel_callid()
function.
It alter the global pointer T (pointing to the transaction currently
processed), but do not restore original value at the end:
- at the beginning of t_cancel_callid(), T is NULL
- then t_lookup_callid() make it point to the transaction we want to
cancel
- and the pointer is not cleanup before exiting t_cancel_callid
Here is a patch that fix this issue (it may not be the correct way to do it)
Regards,
Guillaume
On 20/11/2013 22:57, Daniel-Constantin Mierla wrote:
Hello,
are you dropping replies? I don't see the 'SIP/2.0 487 Request
Terminated' being sent to caller, it looks ok and has two Via headers.
Cheers,
Daniel
On 11/20/13 4:06 PM, Guillaume Bour wrote:
On 20/11/2013 12:01, Daniel-Constantin Mierla wrote:
Hello,
On 11/20/13 11:50 AM, Guillaume Bour wrote:
Hi All
We wan't to prevent our users to make more than one call at time,
so we choose to disconnect the previous call.
When the previous call is established, we use dlg_bye(), and its ok.
But when it is in early state, we use t_cancel_callid() to cancel
its INVITE transaction.
We face 2 issues:
1) we use local-request event route to account calls on
timeout. Sometimes this route is called for the cancelled call
(after default timeout of 1 hour)
what is in the local-request in this case? Is it a BYE?
2) t_cancel_callid() cancel previous call, but also _make
current dialog disappear_: call is still ongoing and we can answer
and talk to each other, but the dialog does not appear in 'kamctl
stats dialog' and 'kamctl mi dlg_list' commands
Is there a known limitation, or do we misuse t_cancel_callid() ?
Can you send the log with debug=3 in kamailio.cfg? It will help to
see what happens. Otherwise, if the call id is different for current
dialog, it should not happen. The ngrep output in this situation
(for both first and second invite) will help.
Cheers,
Daniel
Hi Daniel,
local-request is triggered by a BYE
I have attached sample log and trace
There is some kind of dialogs mixing. Here is the 1st call dialog as
reported by "kamctl mi dlg_list" _before and after_ the 2d call is
answered:
# kamctl mi dlg_list
dialog:: hash=2790:3231
state:: 2
ref_count:: 1
timestart:: 0
timeout:: 0
callid:: GoXhk8GfkIEEqFyFNcySEjSOOpVKg4Uq
from_uri:: sip:15909...@staging.voip
from_tag:: swYh88AkicGbSHpK.D1z7uo3EX9Q-.AZ
caller_contact::
sip:37984520-gch2kindtioq8@10.0.1.10:5060;transport=udp
caller_cseq:: 24899
caller_route_set::
caller_bind_addr:: udp:10.0.1.10:5060
callee_bind_addr::
to_uri:: sip:+3360000...@staging.voip
to_tag::
callee_contact::
callee_cseq::
callee_route_set::
# kamctl mi dlg_list
dialog:: hash=2790:3231
state:: 3
ref_count:: 2
timestart:: 1384952191
timeout:: 20242152
callid:: GoXhk8GfkIEEqFyFNcySEjSOOpVKg4Uq
from_uri:: sip:15909...@staging.voip
from_tag:: swYh88AkicGbSHpK.D1z7uo3EX9Q-.AZ
caller_contact::
sip:37984520-gch2kindtioq8@10.0.1.20:5060;transport=udp
caller_cseq:: 24899
caller_route_set::
caller_bind_addr:: udp:10.0.1.10:5060
callee_bind_addr:: udp:10.0.1.10:5060
to_uri:: sip:+3360000...@staging.voip
to_tag:: as6c8b935a
callee_contact:: sip:+3360000022@10.0.1.11:5060
callee_cseq::
callee_route_set::
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla -http://www.asipto.com
http://twitter.com/#!/miconda -http://www.linkedin.com/in/miconda
Kamailio Advanced Trainings - Berlin, Nov 25-28
- more details about Kamailio trainings athttp://www.asipto.com -
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
diff --git a/kamailio-4.0.3/modules/tm/t_lookup.h b/kamailio-4.0.3/modules/tm/t_lookup.h
index 32a9e8a..dad5e56 100644
--- a/kamailio-4.0.3/modules/tm/t_lookup.h
+++ b/kamailio-4.0.3/modules/tm/t_lookup.h
@@ -90,6 +90,7 @@ int get_t_branch(void);
/* use carefully or better not at all -- current transaction is
* primarily set by lookup functions */
+typedef void (*tsett_f)(struct cell *t, int branch);
void set_t(struct cell *t, int branch);
diff --git a/kamailio-4.0.3/modules/tm/tm_load.c b/kamailio-4.0.3/modules/tm/tm_load.c
index 5a0c936..1a59fa3 100644
--- a/kamailio-4.0.3/modules/tm/tm_load.c
+++ b/kamailio-4.0.3/modules/tm/tm_load.c
@@ -105,6 +105,7 @@ int load_tm( struct tm_binds *tmb)
tmb->free_dlg = free_dlg;
tmb->print_dlg = print_dlg;
tmb->t_gett = get_t;
+ tmb->t_sett = set_t;
tmb->calculate_hooks = w_calculate_hooks;
tmb->t_uac = t_uac;
tmb->t_uac_with_ids = t_uac_with_ids;
diff --git a/kamailio-4.0.3/modules/tm/tm_load.h b/kamailio-4.0.3/modules/tm/tm_load.h
index 1c43d41..9451f22 100644
--- a/kamailio-4.0.3/modules/tm/tm_load.h
+++ b/kamailio-4.0.3/modules/tm/tm_load.h
@@ -82,6 +82,7 @@ struct tm_binds {
free_dlg_f free_dlg;
print_dlg_f print_dlg;
tgett_f t_gett;
+ tsett_f t_sett;
calculate_hooks_f calculate_hooks;
t_uac_t t_uac;
t_uac_with_ids_t t_uac_with_ids;
diff --git a/kamailio-4.0.3/modules/tmx/tmx_mod.c b/kamailio-4.0.3/modules/tmx/tmx_mod.c
index c559f40..6988113 100644
--- a/kamailio-4.0.3/modules/tmx/tmx_mod.c
+++ b/kamailio-4.0.3/modules/tmx/tmx_mod.c
@@ -47,6 +47,7 @@ struct tm_binds _tmx_tmb;
static int mod_init(void);
static void destroy(void);
+
static int t_cancel_branches(struct sip_msg* msg, char *k, char *s2);
static int fixup_cancel_branches(void** param, int param_no);
static int t_cancel_callid(struct sip_msg* msg, char *cid, char *cseq,
@@ -272,6 +273,7 @@ static int fixup_cancel_branches(void** param, int param_no)
*/
static int t_cancel_branches(struct sip_msg* msg, char *k, char *s2)
{
+
struct cancel_info cancel_data;
struct cell *t = 0;
tm_ctx_t *tcx = 0;
@@ -370,6 +372,7 @@ static int t_cancel_callid(struct sip_msg* msg, char *cid, char *cseq, char *fla
_tmx_tmb.cancel_uacs(trans, &cancel_data, 0);
//_tmx_tmb.unref_cell(trans);
+ _tmx_tmb.t_sett(0, -1);
return 1;
}
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users