<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello,<br>
<br>
the mail is quite long and has lot of inner references that makes it
not that easy to follow, better focus only on what is wrong.<br>
<br>
I see lot of OKs, but I don't get it if you tried with v3.2.0. If
still does not work, send the debug messages.<br>
<br>
You can always use acc_db_request(...) just to record a missed call
whenever you want, but the other way with flags should work as well,
after latest enhancement, maybe it needs some tuning if not there
yet. Previously there was no callback to tm registered for failure
event if the missed call flag was not set in main route block.<br>
<br>
Cheers,<br>
Daniel<br>
<br>
On 9/26/11 3:17 PM, Ozren Lapcevic wrote:
<blockquote
cite="mid:CAK1NKFu6MqWEUO_y+vs+-+dwTXUfbt+dk9msTDCeh5WhW8-6kA@mail.gmail.com"
type="cite">Hi, <br>
<br>
sorry if I haven't been clear in the last mail(s). I'll try to
recap. <br>
<br>
I have a call with 3 branches that are serially forked. branch 1
and 2 can be PSTN number or SIP URI. branch 3 is voicemail. I do
not want to account 1st branch if call is missed, only the 2nd
one. <br>
<br>
Here are the snippets from the configuration file that I'm using
since I've started this thread. I've bolded parts where acc
related flags are set.<br>
<br>
route { ....<br>
route(WITHINDLG); ....<br>
<br>
if ( is_method("INVITE") ) { ...<br>
<b>setflag(FLT_ACC); # [1]</b><br>
#check for user defined forking priorities and
timers<br>
route(FORK);<br>
}<br>
route(LOCATION);<br>
route(RELAY);<br>
}<br>
<br>
#check for user defined forking priorities and timers<br>
route[FORK]{ ...<br>
# user has multiple contacts, do serial forking<br>
setflag(FLT_USRPREF); ....<br>
# overwrite request URI with highest priority
contact<br>
if ($avp(prio1) =~ "^<a class="moz-txt-link-freetext" href="sip:00">sip:00</a>") $ru = $avp(prio1) +
"@host";<br>
else $ru = $avp(prio1); ....<br>
}<br>
<br>
route[RELAY] {<br>
if (is_method("INVITE")) {<br>
t_on_reply("REPLY_ONE");<br>
t_on_failure("FAIL_ONE");<br>
<br>
#if users have priorities set, use FAIL_FORK
failure route<br>
if ( isflagset(FLT_USRPREF) )
t_on_failure("FAIL_FORK");<br>
}<br>
if (!t_relay()) sl_reply_error();<br>
exit;<br>
}<br>
<br>
# Handle requests within SIP dialogs<br>
route[WITHINDLG] {<br>
if (has_totag()) {<br>
if (loose_route()) {<br>
if (is_method("BYE")) {<br>
<b>setflag(FLT_ACC);</b> <b>#
[2]</b><br>
<b>setflag(FLT_ACCFAILED);</b> <b>#
[3]</b><br>
}<br>
route(RELAY);<br>
} ....} }<br>
<br>
# USER location service<br>
route[LOCATION] {<br>
if ($ru =~ "^<a class="moz-txt-link-freetext" href="sip:00">sip:00</a>") xlog("L_INFO","SKIP lookup...");<br>
else {<br>
if (!lookup("location")) {<br>
switch ($rc) {<br>
case -1:<br>
case -3:<br>
t_newtran();<br>
t_reply("404", "Not
Found");<br>
exit;<br>
case -2:<br>
sl_send_reply("405",
"Method Not Allowed");<br>
exit;<br>
}<br>
}<br>
}<br>
# when routing via usrloc, log the missed calls also, but
only if user doesn't have prios set<br>
if ( is_method("INVITE") &&
!(isflagset(FLT_USRPREF))) {<br>
<b>setflag(FLT_ACCMISSED);</b> <b># [4] - not
used in serial forking scenario<br>
</b> }<br>
}<br>
<br>
# Failure route for forked calls<br>
failure_route[FAIL_FORK] { ...<br>
# handle 2nd branch<br>
if ( ($avp(prio) == 2) && (
isflagset(FLT_USRPREF) )) {<br>
t_on_failure("FAIL_FORK");<br>
<br>
if ($avp(prio2) =~ "^<a class="moz-txt-link-freetext" href="sip:00">sip:00</a>") $ru =
$avp(prio2) + "@host"; # tel number<br>
else {<br>
$ru = $avp(prio2); # sip uri<br>
route(LOCATION);<br>
}<br>
<b>setflag(FLT_ACCMISSED); # [5]</b><br>
}<br>
# 3rd branch is voicemail<br>
else {<br>
$ru = $(avp(uuid));<br>
rewritehostport("host:port");<br>
append_hf("P-App-Name: voicemail\r\n");<br>
append_hf("P-App-Param:
Email-Address=$avp(email)\r\n");<br>
}<br>
route(RELAY);<br>
<br>
if (t_is_canceled()) {<br>
exit;<br>
}<br>
}
<br>
<br>
With code above I'm testing following scenarios, where <a
moz-do-not-send="true" href="mailto:oz@abc.hr">oz@abc.hr</a>
calls <a moz-do-not-send="true" href="mailto:pero@abc.hr">pero@abc.hr</a>.
Due to <a moz-do-not-send="true" href="mailto:pero@abc.hr">pero@abc.hr</a>
settings and priorities set, 1st branch is PSTN number, 2nd branch
is <a moz-do-not-send="true" href="mailto:sip%3Apero@abc.hr">sip:pero@abc.hr</a>
and 3rd branch is voicemail:<br>
1. pero doesn't answer 1st branch and 2nd branch, voicemail
activates. There are no logs in missed_calls. I want to have a
single log in missed_calls for this case.<br>
2. pero doesn't answer 1st branch, declines call at 2nd branch
(486 Busy), voicemail activates. There are no logs in
missed_calls. I want to have a single log in missed_calls for this
case.<br>
3. pero doesn't answer 1st branch, 2nd branch rings, oz cancels
call, voicemail doesn't activate. There is a single log in
missed_calls (487). This is ok, as expected.<br>
4. 1st branch rings, oz cancels call. There is a single log in
missed_calls (487). This is also ok.<br>
Logs in acc table exist and are good for all 4 cases - all of them
are related to established call to voicemail server. <br>
<br>
Previously, I've tested several variations of config file above:<br>
<br>
Variation 1: remove [1], [2] and [3]. (look for bolded lines
above). In this variation, only [5] is related to acc flags and is
set in failure route. When testing 4 scenarios above, there are no
logs in acc and acc_missed table. This is probably related to your
comment that acc does not register itself for a tm callback that
is used for handling accounting events if there are no flags
defined in request route block.<br>
<br>
Variation 2: [1], [2], [3] are used again, but 3rd branch is
removed, there is no voicemail. Lets go through 4 scenarios again:<br>
1. pero doesn't answer 1st branch and 2nd branch. There is a
single log in missed_calls (408) - OK.<br>
2. pero doesn't answer 1st branch, declines call at 2nd branch
(486 Busy). There is a single log in missed_calls (486) - OK.<br>
3. pero doesn't answer 1st branch, 2nd branch rings, oz cancels
call. There is a single log in missed_calls (487) - OK.<br>
4. 1st branch rings, oz cancels call. There is a single log in
missed_calls (487) - OK.<br>
There are no logs in acc table. This is OK because no calls have
been established. Everything works as expected here! However, I
need the voicemail, I can't replace it for accounting.<br>
<br>
Variation 3: [1], [2], [3] are used, as well as voicemail. [5] is
removed from failure route. Instead, in failure route
setflag(FL_2NDBRANCH) is set when 2nd branch is processed. In
RELAY route following line is added: if ( isflagset(FL_2NDBRANCH)
) setflag(FLT_ACCMISSED). Results are the same as for original
configuration. <br>
<br>
<br>
<br>
<div class="gmail_quote">On Mon, Sep 26, 2011 at 12:06 PM,
Daniel-Constantin Mierla <span dir="ltr"><<a
moz-do-not-send="true" href="mailto:miconda@gmail.com">miconda@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div bgcolor="#FFFFFF" text="#000000"> Hello,
<div class="im"><br>
<br>
On 9/26/11 11:44 AM, Ozren Lapcevic wrote:
<blockquote type="cite"><br>
<div class="gmail_quote">On Sat, Sep 24, 2011 at 9:11
AM, Daniel-Constantin Mierla <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"> Hello,<br>
<br>
just to refresh in case you mentioned already, do
you set acc missed call flag in request route
block?<br>
</div>
</blockquote>
<div><br>
<br>
No. I'm setting setflag(FLT_ACCMISSED) in failure
route for serially forked calls. <br>
</div>
</div>
</blockquote>
</div>
ok, so that caused not to register to TM for a callback on
failure events when the transaction for respective INVITE
was created.
<div class="im"><br>
<blockquote type="cite">
<div class="gmail_quote">
<div><br>
(Also, I'm setting setflag(FLT_ACC); in main route
for INVITES. I'm setting setflag(FLT_ACC) and
setflag(FLT_ACCFAILED) in WITHINDLG route for loose
routed BYEs.)<br>
</div>
</div>
</blockquote>
</div>
This is different that what we looked after.
<div class="im"><br>
<blockquote type="cite">
<div class="gmail_quote">
<div> <br>
Previously, before starting this thread, and before
any of your patches, I've tried setting
FLT_ACCMISSED in LOCATION route and in RELAY route,
but didn't help with properly accounting only the
2nd branch. <br>
</div>
</div>
</blockquote>
<br>
</div>
Because it caused the first branch also to be recorded to
missed calls.</div>
</blockquote>
<div><br>
By that, I meant Variation 3. <br>
<br>
<br>
</div>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
<div bgcolor="#FFFFFF" text="#000000">
<div class="im"> <br>
<blockquote type="cite">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0pt 0pt
0pt 0.8ex;border-left:1px solid rgb(204, 204,
204);padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"> I found
another issue that if this flag is no set in
request route, the callback to tm that is used for
accounting missed calls is not registered. Can you
try with 3.2.0 (git master branch at this moment)
and set the acc_prepare_flag parameter, plus the
flag itself for invites?<br>
</div>
</blockquote>
<div><br>
<br>
I've installed new Kamailio with instructions from:
<a moz-do-not-send="true"
href="http://www.kamailio.org/dokuwiki/doku.php/install:kamailio-devel-from-git"
target="_blank">http://www.kamailio.org/dokuwiki/doku.php/install:kamailio-devel-from-git</a>.
However, default kamailio config file and kamctl
file both show 3.1 version. How can I check whether
I have 3.2 version installed?<br>
</div>
</div>
</blockquote>
</div>
Do:<br>
<br>
/usr/local/sbin/kamailio -V<br>
<br>
The config file kamailio.cfg is not overwritten if already
exists, to prevent mistakenly loss (no backup).<br>
</div>
</blockquote>
<div> </div>
<div><br>
Ok, I have good version installed. I'll test it and report
results. <br>
<br>
<br>
Cheers<br>
Ozren<br>
<br>
<br>
</div>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
<div bgcolor="#FFFFFF" text="#000000">
<div class="im">
<blockquote type="cite">
<div class="gmail_quote">
<div> <br>
acc_prepare_flag should be set in main route, e.g.
in the same place as FLT_ACC for INVITES?<br>
</div>
</div>
</blockquote>
</div>
Yes, it has to be set in request route {...} block.<br>
<br>
Cheers,<br>
<font color="#888888"> Daniel</font>
<div class="im"><br>
<br>
<pre cols="72">--
Daniel-Constantin Mierla -- <a moz-do-not-send="true" href="http://www.asipto.com" target="_blank">http://www.asipto.com</a>
Kamailio Advanced Training, Oct 10-13, Berlin: <a moz-do-not-send="true" href="http://asipto.com/u/kat" target="_blank">http://asipto.com/u/kat</a>
<a moz-do-not-send="true" href="http://linkedin.com/in/miconda" target="_blank">http://linkedin.com/in/miconda</a> -- <a moz-do-not-send="true" href="http://twitter.com/miconda" target="_blank">http://twitter.com/miconda</a></pre>
</div>
</div>
</blockquote>
</div>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla -- <a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a>
Kamailio Advanced Training, Oct 10-13, Berlin: <a class="moz-txt-link-freetext" href="http://asipto.com/u/kat">http://asipto.com/u/kat</a>
<a class="moz-txt-link-freetext" href="http://linkedin.com/in/miconda">http://linkedin.com/in/miconda</a> -- <a class="moz-txt-link-freetext" href="http://twitter.com/miconda">http://twitter.com/miconda</a></pre>
</body>
</html>