Hi,
I want SER to handle forwarding multicast requests. To do that, I want to realise this scenario : All the UACs which want to belong to the multicast group need to register themselves with the same multicast URI. When SER receive request with that multicast URI, it looks for all the contacts for the username of that URI in usrloc (with lookup() function call) and then forward the request to all the contacts found (with t_relay() function call).
But I don't want SER to forward the request to the sender.
That's why I want to ensure myself that URIs which have been added to the destination set and the one which rewrites the request URI (after the lookup() function call) don't match with SIP URI in the Contact header field of the processing request.
Here is the test code :
########################### Server: Sip EXpress router (0.8.11pre29 (i386/linux)) Platform: GNU/Linux 2.4.18-14 i686 ###########################
# ------------------ module loading ----------------------------------
loadmodule "/usr/local/lib/ser/modules/mysql.so" loadmodule "/usr/local/lib/ser/modules/sl.so" loadmodule "/usr/local/lib/ser/modules/tm.so" loadmodule "/usr/local/lib/ser/modules/usrloc.so" loadmodule "/usr/local/lib/ser/modules/registrar.so"
# ----------------- setting module-specific parameters ---------------
# -- registrar params -- # to add contacts in the destination set modparam("registrar", "append_branches", 1)
# -- usrloc params -- # use SQL database for persistent storage modparam("usrloc", "db_mode", 1)
# ------------------------- request routing logic -------------------
# main routing logic
route{
if (uri==myself) { (...)
# registering if (method=="REGISTER") { save("location"); break; };
(...)
# to find contacts, rewrite request URI and # add contacts to the destination set if (!lookup("location")) { sl_send_reply("404","not found"); break; };
# Here I want to compare the destination set # and the rewrited request URI with the Contact header # field of the processing request before forwarding ...
# forward if (!t_relay()) { sl_reply_error(); break; };
(...) }else{ (...) }
}
################
I think it's not possible using only ser script functionalities. I think I have to write a specific function in a specific module to do that (based on lookup() function). What do you think about it ? Any suggestions are welcomed.
Thanks in advance.
Matthieu Saunier
Hello,
yes, it is not possible to do it from the script, you will have to write a new function.
Jan.
On 20-06 12:21, matthieu saunier wrote:
Hi,
I want SER to handle forwarding multicast requests. To do that, I want to realise this scenario : All the UACs which want to belong to the multicast group need to register themselves with the same multicast URI. When SER receive request with that multicast URI, it looks for all the contacts for the username of that URI in usrloc (with lookup() function call) and then forward the request to all the contacts found (with t_relay() function call).
But I don't want SER to forward the request to the sender.
That's why I want to ensure myself that URIs which have been added to the destination set and the one which rewrites the request URI (after the lookup() function call) don't match with SIP URI in the Contact header field of the processing request.
Here is the test code :
########################### Server: Sip EXpress router (0.8.11pre29 (i386/linux)) Platform: GNU/Linux 2.4.18-14 i686 ###########################
# ------------------ module loading ----------------------------------
loadmodule "/usr/local/lib/ser/modules/mysql.so" loadmodule "/usr/local/lib/ser/modules/sl.so" loadmodule "/usr/local/lib/ser/modules/tm.so" loadmodule "/usr/local/lib/ser/modules/usrloc.so" loadmodule "/usr/local/lib/ser/modules/registrar.so"
# ----------------- setting module-specific parameters ---------------
# -- registrar params -- # to add contacts in the destination set modparam("registrar", "append_branches", 1)
# -- usrloc params -- # use SQL database for persistent storage modparam("usrloc", "db_mode", 1)
# ------------------------- request routing logic -------------------
# main routing logic
route{
if (uri==myself) { (...)
# registering if (method=="REGISTER") { save("location"); break; }; (...) # to find contacts, rewrite request URI and # add contacts to the destination set if (!lookup("location")) { sl_send_reply("404","not found"); break; }; # Here I want to compare the destination set # and the rewrited request URI with the Contact header # field of the processing request before forwarding ... # forward if (!t_relay()) { sl_reply_error(); break; }; (...)
}else{ (...) }
}
################
I think it's not possible using only ser script functionalities. I think I have to write a specific function in a specific module to do that (based on lookup() function). What do you think about it ? Any suggestions are welcomed.
Thanks in advance.
Matthieu Saunier
Serusers mailing list serusers@lists.iptel.org http://lists.iptel.org/mailman/listinfo/serusers