[OpenSER-Users] Question regarding usage of carrier-route

Carsten Bock lists at bock.info
Tue Sep 25 18:49:31 CEST 2007


Hi everybody,

I have a question regarding carrierroute: In table "route_tree" i would
have the following:
+----+----------+
| id | carrier  |
+----+----------+
|  1 | carrier1 |
|  2 | carrier2 |
+----+----------+

In the table "carrierroute" i have the following:
+----+---------+-------------+-------+------+-------+---------------+
| id | carrier | scan_prefix | level | prob | strip | rewrite_host  |
+----+---------+-------------+-------+------+-------+---------------+
|  1 |       1 | 49          | 0     |  0.5 | 0     | gateway1_1    |
|  2 |       1 | 49          | 0     |  0.5 | 0     | gateway1_2    |
|  3 |       1 | 49          | 1     |    1 | 0     | gateway1_3    |
|  4 |       1 | 49          | 2     |    1 | 0     | gateway1_4    |
|  5 |       2 | 49          | 0     |    1 | 0     | gateway2_1    |
|  6 |       2 | 49          | 1     |    1 | 0     | gateway2_2    |
+----+---------+-------------+-------+------+-------+---------------+

in the routing logic i would do the following:

route {
	# Calls to PSTN based on RURI
	if(!cr_rewrite_uri("carrier1", "call_id")){
		sl_send_reply("403", "Not allowed");
	} else {
		# In case of failure, re-route the request
		t_on_failure("1");
		# Relay the request to the gateway
		t_relay();
	}	
}

failure_route(1) {
	# In case of failure, send it to an alternative route:
	if (t_check_status("408|5[0-9][0-9]")) {
		if(!cr_rewrite_uri("carrier1", "call_id")){
			t_reply("403", "Not allowed");
		} else {
			t_on_failure("1");
			t_relay();
		}
	}
}

Questions:
1) Is this configuration right?
2) Would the call, in this case, go to either gateway1_1 or gateway1_2, in case of failure to gateway1_3?
3) In case all three fail, it would go to gateway1_4? (original route would be level 1, 1st failure-route would be level 2, 2nd failure-route would be level 3 and so on?)
4) Calls to other destinations as to destinations starting with "49" in the URI would be rejected, right?
5) Does it cause problems, when "prob" does not result in 1? E.g. does a prob of 1 and 1 result into the same as 0.5 and 0.5?

Thank you in advance,

Carsten





More information about the Users mailing list