Hi guys,
 
I was create a script to route some kinds of routes calls to PSTN ( like that ). So after 59 sec. it is droped.
 
Someone can help me ?
Thank you all for attention and kindness in advance.
 
Jadylson Bomfim

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

vel        +55 34 9103-6854

 
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.643 / Virus Database: 411 - Release Date: 25/3/2004