if (uri=~"sip:0[0-9]*@.*") {
route(6);
break;
};
route[6] {
setflag(1);
if (uri=~"^sip:0[1-9]*@") {
strip(1);
prefix("01155");
rewritehostport("ip address:5060");
acc_rad_request("Saindo Para PSTN no Brasil");
if (method=="INVITE" && search("User-Agent: snom")) {
replace("100rel, ", "");
};
append_hf("P-hint: GATEWAY\r\n");
# use UDP to guarantee well-known sender port (TCP ephemeral)
t_relay_to_udp("ip address","5060");
} else {
if (uri=~"^sip:00[0-9][0-9]*@") { # ... forward to gateways then;
#Cheque se inicia com 00
if (uri=~"^sip:00") {
# strip the leading "1"
strip(2);
prefix("011");
# if you have passed through all the checks, let your call go to GW!
rewritehostport("ip address:5060");
# snom conditioner
if (method=="INVITE" && search("User-Agent: snom")) {
replace("100rel, ", "");
};
append_hf("P-hint: GATEWAY\r\n");
# use UDP to guarantee well-known sender port (TCP ephemeral)
t_relay_to_udp("ip address","5060");
};
} else {
if (uri=~"^sip:001*@") { # ... forward to gateways then;
#Cheque se inicia com 00
if (uri=~"^sip:00") {
# strip the leading "1"
strip(2);
# if you have passed through all the checks, let your call go to GW!
rewritehostport("ip address:5060");
# snom conditioner
if (method=="INVITE" && search("User-Agent: snom")) {
replace("100rel, ", "");
};
append_hf("P-hint: GATEWAY\r\n");
# use UDP to guarantee well-known sender port (TCP ephemeral)
t_relay_to_udp("ip address","5060");
};
};
};
};
}
Jadylson da Rocha Passos Bomfim
Redevox Telecom
Uberlandia +55 34 3234-7813
São Paulo +55 11 5055-6888
Móvel +55 34 9103-6854