You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kamailio/misc/examples/mixed/uas.cfg

50 lines
1.1 KiB

#
# $Id$
#
# this example shows usage of ser as user agent
# server which does some functionality (in this
# example, 'log' is used to print a notification
# on a new transaction) and behaves statefully
# (e.g., it retransmits replies on request
# retransmissions)
# ------------------ module loading ----------------------------------
loadmodule "modules/sl/sl.so"
loadmodule "modules/tm/tm.so"
# ------------------------- request routing logic -------------------
# main routing logic
route{
# for testing purposes, simply okay all REGISTERs
if (method=="REGISTER") {
log("REGISTER");
sl_send_reply("200", "ok");
break;
};
# create transaction state; abort if error occurred
if ( !t_newtran()) {
sl_reply_error();
break;
};
# the following log will be only printed on receipt of
# a new message; retranmissions are absorbed by t_newtran
log(1, "New Transaction Arrived\n");
# do what you want to do as a sever...
if (uri=~"a@") {
if (!t_reply("409", "Bizzar Error")) {
sl_reply_error();
};
} else {
if (!t_reply("699", "I don't want to chat with you")) {
sl_reply_error();
};
};
}