Hi,
I am using the following routing configuration for testing Ser as a presence server only.
The aim is to route all register, invite and other audio related messages to the main SIP
and RTP proxy while keeping presence messages to SER.
But there are some configuration parts that I don't understand:
1- if I remove the following lines from route[2] , client can't register through Ser.
if (!t_newtran()) {
log(1, "newtran error\n");
sl_reply_error();
break;
};
2- What is the meaning of : if (uri==myself) { ?
I just commented this out and it seems to work.
3- Can anyone explain me the meaning of following lines:
# if (!method=="REGISTER") record_route();
# if (loose_route()) {
# # mark routing logic in request
# append_hf("P-hint: rr-enforced\r\n");
# route(1);
# break;
# };
Thanks,
İlker
Below is my full routing configuration:
# main routing logic
route{
# XML RPC
if (method == "POST" || method == "GET") {
create_via();
dispatch_rpc();
break;
}
# initial sanity checks -- messages with
# max_forwards==0, or excessively long requests
if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
break;
};
if (msg:len >= max_len ) {
sl_send_reply("513", "Message too big");
break;
};
# we record-route all messages -- to make sure that
# subsequent messages will go through our proxy; that's
# particularly good if upstream and downstream entities
# use different transport protocol
# if (!method=="REGISTER") record_route();
# subsequent messages withing a dialog should take the
# path determined by record-routing
# if (loose_route()) {
# # mark routing logic in request
# append_hf("P-hint: rr-enforced\r\n");
# route(1);
# break;
# };
# if the request is for other domain use UsrLoc
# (in case, it does not work, use the following command
# with proper names and addresses in it)
# if (uri==myself) {
# if (!lookup_domain("To")) {
#xlog("L_ERR", "URI=MYSELF\n");
#xlog("L_ERR", "to: %tu from: %fu\n");
# log(1, "Unknown domain - message should be forwarded?");
# route(1);
# break;
# }
# }
if (method=="REGISTER") {
xlog("L_ERR", "REGISTER\n");
xlog("L_ERR", "to: %tu from: %fu\n");
append_hf("P-hint: outbound\r\n");
save_noreply("location");
route(2);
break;
};
if (method=="INVITE") {
xlog("L_ERR", "INVITE\n");
xlog("L_ERR", "to: %tu from: %fu\n");
if (!lookup("location")) {
route(2);
break;
};
if (lookup("location")) {
route(1);
break;
};
};
if (method=="MESSAGE") {
xlog("L_ERR", "MESSAGE\n");
xlog("L_ERR", "to: %tu from: %fu\n");
if (!lookup("location")) {
sl_send_reply("404","Not found");
break;
};
route(1);
break;
};
if (method=="NOTIFY") {
xlog("L_ERR", "NOTIFY\n");
xlog("L_ERR", "to: %tu from: %fu\n");
if (!lookup("location")) {
sl_send_reply("404","Not found");
break;
};
route(1);
break;
};
if (method=="SUBSCRIBE") {
xlog("L_ERR", "SUBSCRIBE\n");
xlog("L_ERR", "to: %tu from: %fu\n");
if (!t_newtran()) { # creates a new transaction
sl_reply_error();
break;
};
handle_subscription("registrar");
break;
};
if (method=="PUBLISH") {
xlog("L_ERR", "PUBLISH\n");
xlog("L_ERR", "to: %tu from: %fu\n");
if (!t_newtran()) {
sl_reply_error();
break;
};
handle_publish("registrar");
break;
};
xlog("L_ERR", "OTHER\n");
xlog("L_ERR", "to: %tu from: %fu\n");
if (!lookup("location")) {
route(2);
break;
};
if (lookup("location")) {
route(1);
break;
};
# append_hf("P-hint: outbound\r\n");
# route(2);
# break;
}
route[1]
{
xlog("L_INFO","t_relay()\n");
if (!t_relay()) {
sl_reply_error();
};
}
route[2]
{
if (!t_newtran()) {
xlog("L_ERR", "newtran error ?????\n");
log(1, "newtran error\n");
sl_reply_error();
break;
};
if (!t_forward_nonack("10.100.200.97", 5060)) {
sl_reply_error();
};
xlog("L_ERR", "FORWARD\n");
}
<http://387555.sigclick.mailinfo.com/sigclick/04090107/04074E00/07094A00/17162122.jpg>
_____________________________________________________________________________________________________________________________________________
Bu e-posta mesaji kisiye ozel olup, gizli bilgiler iceriyor olabilir. Eger bu e-posta
mesaji size yanlislikla ulasmissa, icerigini hic bir sekilde kullanmayiniz ve ekli
dosyalari acmayiniz. Bu durumda lutfen e-posta mesajini kullaniciya hemen geri gonderiniz
ve tum kopyalarini mesaj kutunuzdan siliniz. Bu e-posta mesaji, hic bir sekilde, herhangi
bir amac icin cogaltilamaz, yayinlanamaz ve para karsiligi satilamaz. Bu e-posta mesaji
viruslere karsi anti-virus sistemleri tarafindan taranmistir. Ancak yollayici, bu e-posta
mesajinin - virus koruma sistemleri ile kontrol ediliyor olsa bile - virus icermedigini
garanti etmez ve meydana gelebilecek zararlardan dogacak hicbir sorumlulugu kabul etmez.
This message is intended solely for the use of the individual or entity to whom it is
addressed , and may contain confidential information. If you are not the intended
recipient of this message or you receive this mail in error, you should refrain from
making any use of the contents and from opening any attachment. In that case, please
notify the sender immediately and return the message to the sender, then, delete and
destroy all copies. This e-mail message, can not be copied, published or sold for any
reason. This e-mail message has been swept by anti-virus systems for the presence of
computer viruses. In doing so, however, sender cannot warrant that virus or other forms
of data corruption may not be present and do not take any responsibility in any
occurrence.
_____________________________________________________________________________________________________________________________________________