Module: sip-router
Branch: master
Commit: 94e7ae77a6674d5e6a6d025a8e85f7b1c8733057
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=94e7ae7…
Author: Carsten Bock <carsten(a)ng-voice.com>
Committer: Carsten Bock <carsten(a)ng-voice.com>
Date: Wed Mar 20 17:31:34 2013 +0100
Updated example config for S-CSCF
---
examples/scscf/kamailio.cfg | 42 ++++++++++++++++++++++++++++++++----------
1 files changed, 32 insertions(+), 10 deletions(-)
diff --git a/examples/scscf/kamailio.cfg b/examples/scscf/kamailio.cfg
index 4fa09b0..444cd74 100644
--- a/examples/scscf/kamailio.cfg
+++ b/examples/scscf/kamailio.cfg
@@ -430,16 +430,38 @@ route[XMLRPC] {
# Route for handling Registrations:
######################################################################
route[REGISTER] {
- xlog("L_ERR", "Enter register block");
- t_newtran();
-
- ims_www_authenticate(NETWORKNAME);
-
- #check to see if user is authenticated - ie sip header has auth information - (already challenged)
- if ($avp(maa_return_code) == 1) {
- # user has not been authenticated. Lets send a challenge via 401 Unauthorized
- ims_www_challenge("$td");
- exit;
+ if (!ims_www_authenticate(NETWORKNAME)) {
+ if ($? == -2) {
+ t_reply("403", "Authentication Failed");
+ exit;
+ } else if ($? == -3) {
+ t_reply("400", "Bad Request");
+ exit;
+ } else {
+ #user has not been authenticated. Lets send a challenge via 401 Unauthorized
+ xlog("L_DBG","About to challenge! auth_ims\n");
+ ims_www_challenge("$td");
+ #this is async so to know status we have to check the reply avp
+ xlog("L_DBG","maa_return code is $avp(s:maa_return_code)\n");
+
+ switch ($avp(s:maa_return_code)){
+ case 1: #success
+ xlog("L_DBG", "MAR success - 401/407 response sent from module");
+ break;
+ case -1: #failure
+ xlog("L_ERR", "MAR failure - error response sent from module");
+ break;
+ case -2: #error
+ xlog("L_ERR", "MAR error - sending error response now");
+ t_reply("500", "MAR failed");
+ break;
+ default:
+ xlog("L_ERR", "Unknown return code from MAR, value is [$avp(s:uaa_return_code)]");
+ t_reply("500", "Unknown response code from MAR");
+ break;
+ }
+ exit;
+ }
} else {
# We need to check if this user is registered or not
if (!impu_registered("location")) {
gcc version 4.7.2 (Ubuntu/Linaro 4.7.2-2ubuntu1)
CC (gcc) [kamailio] dns_cache.o
dns_cache.c: In function âdns_srv_get_nxt_rrâ:
dns_cache.c:2302:5: warning: âr_sums[1].r_sumâ may be used
uninitialized in this function [-Wuninitialized]
dns_cache.c:2302:5: warning: âr_sums[1].rrâ may be used uninitialized
in this function [-Wuninitialized]
dns_cache.c:2302:5: warning: âr_sums[2].r_sumâ may be used
uninitialized in this function [-Wuninitialized]
dns_cache.c:2302:5: warning: âr_sums[2].rrâ may be used uninitialized
in this function [-Wuninitialized]
dns_cache.c:2302:5: warning: âr_sums[3].r_sumâ may be used
uninitialized in this function [-Wuninitialized]
dns_cache.c:2302:5: warning: âr_sums[3].rrâ may be used uninitialized
in this function [-Wuninitialized]
dns_cache.c:2302:5: warning: âr_sums[4].r_sumâ may be used
uninitialized in this function [-Wuninitialized]
dns_cache.c:2302:5: warning: âr_sums[4].rrâ may be used uninitialized
in this function [-Wuninitialized]
dns_cache.c:2302:5: warning: âr_sums[5].r_sumâ may be used
uninitialized in this function [-Wuninitialized]
dns_cache.c:2302:5: warning: âr_sums[5].rrâ may be used uninitialized
in this function [-Wuninitialized]
dns_cache.c:2302:5: warning: âr_sums[6].r_sumâ may be used
uninitialized in this function [-Wuninitialized]
dns_cache.c:2302:5: warning: âr_sums[6].rrâ may be used uninitialized
in this function [-Wuninitialized]
dns_cache.c:2302:5: warning: âr_sums[7].r_sumâ may be used
uninitialized in this function [-Wuninitialized]
dns_cache.c:2302:5: warning: âr_sums[7].rrâ may be used uninitialized
in this function [-Wuninitialized]
dns_cache.c:2302:5: warning: âr_sums[8].r_sumâ may be used
uninitialized in this function [-Wuninitialized]
dns_cache.c:2302:5: warning: âr_sums[8].rrâ may be used uninitialized
in this function [-Wuninitialized]
dns_cache.c:2302:5: warning: âr_sums[9].r_sumâ may be used
uninitialized in this function [-Wuninitialized]
dns_cache.c:2302:5: warning: âr_sums[9].rrâ may be used uninitialized
in this function [-Wuninitialized]
dns_cache.c:2302:5: warning: âr_sums[10].r_sumâ may be used
uninitialized in this function [-Wuninitialized]
dns_cache.c:2302:5: warning: âr_sums[10].rrâ may be used uninitialized
in this function [-Wuninitialized]
dns_cache.c:2302:5: warning: âr_sums[11].r_sumâ may be used
uninitialized in this function [-Wuninitialized]
dns_cache.c:2302:5: warning: âr_sums[11].rrâ may be used uninitialized
in this function [-Wuninitialized]
dns_cache.c:2302:5: warning: âr_sums[12].r_sumâ may be used
uninitialized in this function [-Wuninitialized]
dns_cache.c:2302:5: warning: âr_sums[12].rrâ may be used uninitialized
in this function [-Wuninitialized]
dns_cache.c:2302:5: warning: âr_sums[13].r_sumâ may be used
uninitialized in this function [-Wuninitialized]
dns_cache.c:2302:5: warning: âr_sums[13].rrâ may be used uninitialized
in this function [-Wuninitialized]
dns_cache.c:2302:5: warning: âr_sums[14].r_sumâ may be used
uninitialized in this function [-Wuninitialized]
dns_cache.c:2302:5: warning: âr_sums[14].rrâ may be used uninitialized
in this function [-Wuninitialized]
dns_cache.c:2302:5: warning: âr_sums[15].r_sumâ may be used
uninitialized in this function [-Wuninitialized]
dns_cache.c:2302:5: warning: âr_sums[15].rrâ may be used uninitialized
in this function [-Wuninitialized]
Module: sip-router
Branch: master
Commit: 0d8cec6b6cd9027ef7313608db7e27667643fdf6
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=0d8cec6…
Author: Anca Vamanu <anca.vamanu(a)1and1.ro>
Committer: Anca Vamanu <anca.vamanu(a)1and1.ro>
Date: Wed Mar 20 15:39:12 2013 +0200
modules/drouting Improvement for do_routing in failure route
Improvement for sort_order 2 : if the failure groups have repeating
gateways the module will take care internally not to try again a gateway
that was already tried.
---
modules/drouting/README | 37 ++++++++++++++++++------------
modules/drouting/doc/drouting_admin.xml | 15 ++++++++++++
modules/drouting/drouting.c | 38 +++++++++++++++++++++++++++++++
3 files changed, 75 insertions(+), 15 deletions(-)
diff --git a/modules/drouting/README b/modules/drouting/README
index 5fee2f2..2977033 100644
--- a/modules/drouting/README
+++ b/modules/drouting/README
@@ -304,18 +304,18 @@ Chapter 1. Admin Guide
draft 09):
Table 1.4. Time recurrence attributes
- Attribute Description
- dastard Start of interval (RFC 2445 DATE-TIME)
- duration Length of interval (RFC 2445 DURATION)
- freq Frequency of recurrence (secondly,minutely,hourly, daily,weekly,
- monthly, or yearly).
- until bound of recurrence (RFC 2445 DATE-TIME)
- interval How often the recurrence repeats
- byday List of days of the week
- bymonthday List of days of the month
- byyearday List of days of the year
- byweekno List of weeks of the year
- bymonth List of months of the year
+ Attribute Description
+ dastard Start of interval (RFC 2445 DATE-TIME)
+ duration Length of interval (RFC 2445 DURATION)
+ freq Frequency of recurrence (secondly,minutely,hourly, daily,weekly,
+ monthly, or yearly).
+ until bound of recurrence (RFC 2445 DATE-TIME)
+ interval How often the recurrence repeats
+ byday List of days of the week
+ bymonthday List of days of the month
+ byyearday List of days of the year
+ byweekno List of weeks of the year
+ bymonth List of months of the year
The value stored in database has the format of:
<dtstart>|<duration>|<freq>|<until>|<interval>|<byday>|<bymonthday>
|<byyearday>|<byweekno>|<bymonth>
@@ -570,9 +570,16 @@ modparam("drouting", "drl_table", "my_gw_lists")
destinations). Ex: 1,2;3,4,5;6 -> randomizer -> (A) 2,1;4,3,5;6 ->
usage 2,1,4,3,5,6 (B) 1,2;3,5,4;6 -> usage 1,2,3,5,4,6
* 2 - from each destination group, only a single destination is
- randomly selected; groups do maintain their order (as given); Ex:
- 1,2;3,4,5;6 -> randomizer -> (A) 2;4;6 -> usage 2,4,6 (B) 1;5;6 ->
- usage 1,5,6
+ randomly selected; groups do maintain their order (as given);
+ Ex: 1,2;3,4,5;6 -> randomizer ->
+ (A) 2;4;6 -> usage 2,4,6
+ (B) 1;5;6 -> usage 1,5,6
+ It is ok to have repeating gateways in different groups. The module
+ will take care internally in case of failure not to choose a
+ gateway that was tried already.
+ Ex: 1,2,3; 1,2,3; 1,2,3 -> no gateway will be choosen twice. So in
+ case there are 2 failures, all the three gateways (1,2,3) will be
+ tried in a random order.
Default value is “0”.
diff --git a/modules/drouting/doc/drouting_admin.xml b/modules/drouting/doc/drouting_admin.xml
index 3dbcdd9..7bde362 100644
--- a/modules/drouting/doc/drouting_admin.xml
+++ b/modules/drouting/doc/drouting_admin.xml
@@ -942,9 +942,24 @@ modparam("drouting", "drl_table", "my_gw_lists")
<emphasis>2</emphasis> - from each destination group, only a
single destination is randomly selected; groups do maintain their
order (as given);
+ <para>
Ex: 1,2;3,4,5;6 -> randomizer ->
+ </para>
+ <para>
(A) 2;4;6 -> usage 2,4,6
+ </para>
+ <para>
(B) 1;5;6 -> usage 1,5,6
+ </para>
+ <para>
+ It is ok to have repeating gateways in different groups. The module will
+ take care internally in case of failure not to choose a gateway that
+ was tried already.
+ </para>
+ <para>
+ Ex: 1,2,3; 1,2,3; 1,2,3 -> no gateway will be choosen twice. So in case there
+ are 2 failures, all the three gateways (1,2,3) will be tried in a random order.
+ </para>
</listitem>
</itemizedlist>
</para>
diff --git a/modules/drouting/drouting.c b/modules/drouting/drouting.c
index 43fd73e..7289085 100644
--- a/modules/drouting/drouting.c
+++ b/modules/drouting/drouting.c
@@ -646,6 +646,20 @@ static int use_next_gw(struct sip_msg* msg)
return 1;
}
+int dr_already_choosen(rt_info_t* rt_info, int* local_gwlist, int lgw_size, int check)
+{
+ int l;
+
+ for ( l = 0; l<lgw_size; l++ ) {
+ if ( rt_info->pgwl[local_gwlist[l]].pgw == rt_info->pgwl[check].pgw ) {
+ LM_INFO("Gateway already choosen %.*s, local_gwlist[%d]=%d, %d\n",
+ rt_info->pgwl[check].pgw->ip.len, rt_info->pgwl[check].pgw->ip.s, l, local_gwlist[l], check);
+ return 1;
+ }
+ }
+
+ return 0;
+}
static int do_routing(struct sip_msg* msg, dr_group_t *drg)
{
@@ -806,6 +820,30 @@ again:
}
}
}
+
+ if ( sort_order == 2 ) {
+ /* check not to use the same gateway as before */
+ if ( t>1 ) {
+ /* check if all in the current set were already chosen */
+ if (i-j <= t-1) {
+ for( l = j; l< i; l++) {
+ if ( ! dr_already_choosen(rt_info, local_gwlist, t-1, l) )
+ break;
+ }
+ if ( l == i ) {
+ LM_INFO("All gateways in group from %d - %d were already used\n", j, i);
+ t--; /* jump over this group, nothing to choose here */
+ j=i; continue;
+ }
+ }
+ while ( dr_already_choosen(rt_info, local_gwlist, t-1, local_gwlist[t-1]) ) {
+ local_gwlist[t-1] = j + rand()%(i-j);
+ }
+ }
+ LM_DBG("The %d gateway is %.*s [%d]\n", t, rt_info->pgwl[local_gwlist[t-1]].pgw->ip.len,
+ rt_info->pgwl[local_gwlist[t-1]].pgw->ip.s, local_gwlist[t-1]);
+ }
+
/* next group starts from i */
j=i;
}
Module: sip-router
Branch: master
Commit: 6bb98ddd9ee4913c7a56ca5ffa57d9f74e7bc1b3
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=6bb98dd…
Author: Lucian Balaceanu <lucian.balaceanu(a)1and1.ro>
Committer: Anca Vamanu <anca.vamanu(a)1and1.ro>
Date: Wed Mar 20 14:27:30 2013 +0200
modules/carrierroute Improvement for cr_route in failure route
Small improvement in cr_route() function - when it is called from
failure_route it will take care not choose a previously choosen gateway.
Added cr_reload sercmd.
---
modules/carrierroute/README | 7 +-
modules/carrierroute/carrierroute.c | 44 ++++++++-
modules/carrierroute/carrierroute.h | 3 +
modules/carrierroute/cr_func.c | 121 ++++++++++++++++++++++-
modules/carrierroute/doc/carrierroute_admin.xml | 8 ++-
5 files changed, 177 insertions(+), 6 deletions(-)
Diff: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=6bb…
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
A new Flyspray task has been opened. Details are below.
User who did this - Hugh James (hugh.james)
Attached to Project - sip-router
Summary - Added Record Route Header incorrect when Request-URI contains a SIPS URI
Task Type - Bug Report
Category - Module
Status - Unconfirmed
Assigned To -
Operating System - Linux
Severity - High
Priority - Normal
Reported Version - 3.1
Due in Version - Undecided
Due Date - Undecided
Details - The record-route header added by Kamailio to a SIPS (TLS) call using the record_route(); operation is incorrectly generated by Kamailio.
Page 101 (second sentence) of RFC3261 states
"If the Request-URI contains a SIPS URI [...] the URI placed into the Record-Route header field MUST be a SIPS URI."
Kamailio incorrectly generates record-route headers with the sip: URI scheme.
All other fields are correctly generated with the sips: URI scheme.
In response to this deviation from RFC3261, a Cisco ISR rejects the call with code 403.
Module rr source code in release 3.3.3 checked and problem is caused by #define RR_PREFIX "Record-Route: <sip:" in record.c
possible solution is check the Request URI for SIPS URI , and use #define RR_PREFIX_SIPS "Record-Route: <sips:" instead.
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=277
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.