Hi!
Is there a simple way to: - retrieve the RR headers (or Route/Contact ...) and to - selectively remove them?
E.g. retrieve <2> and delete <3>
I do not want to care about the format, eg: Record-Route: <1>, <2>, <3> or Record-Route: <1> Record-Route: <2> Record-Route: <3>
Thanks Klaus
Finally I found it myself. For the records:
To address a certain header (regardless if headers are in a single line or in separate lines) use the @hf_value select. The trick is to load the textopsx module (this select used to be in ser's textops module). Note, header names must use '_' instead of '-'.
To delete or manipulate a certain header also use the functions from the textopsx module, e.g: remove_hf_value(). Note, here '-' is used for headers with '-'
For example, incoming message:
Record-Route: sip:1.1.1.1;lr=on;nat=yes Record-Route: sip:2.2.2.2:5060;lr;transport=udp, sip:3.3.3.3:22506;lr;transport=udp
Dump all headers: xlog("$sel(@hf_value.Record_Route)");
Dump the first header: xlog("$sel(@hf_value.Record_Route[1])");
Dump the second last header: xlog("$sel(@hf_value.Record_Route[-2])");
Remove the last header: remove_hf_value("Record-Route[-1]"); or in above case: remove_hf_value("Record-Route[3]");
regards Klaus
On 04.06.2013 17:18, Klaus Darilion wrote:
Hi!
Is there a simple way to:
- retrieve the RR headers (or Route/Contact ...) and to
- selectively remove them?
E.g. retrieve <2> and delete <3>
I do not want to care about the format, eg: Record-Route: <1>, <2>, <3> or Record-Route: <1> Record-Route: <2> Record-Route: <3>
Thanks Klaus
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hello.
[/usr/local/lib64/kamailio/modules/tm.so] Jun 5 13:49:10 phoenix-c2 /usr/local/sbin/kamailio[10135]: DEBUG: <core> [sr_module.c:701]: find_mod_export_record(): find_export_record: found <t_relay_to_tcp> in module tm [/usr/local/lib64/kamailio/modules/tm.so] Jun 5 13:49:10 phoenix-c2 /usr/local/sbin/kamailio[10135]: DEBUG: <core> [sr_module.c:701]: find_mod_export_record(): find_export_record: found <t_relay> in module tm [/usr/local/lib64/kamailio/modules/tm.so] Jun 5 13:49:10 phoenix-c2 /usr/local/sbin/kamailio[10135]: DEBUG: <core> [sr_module.c:701]: find_mod_export_record(): find_export_record: found <load_rr> in module rr [/usr/local/lib64/kamailio/modules/rr.so] Jun 5 13:49:10 phoenix-c2 /usr/local/sbin/kamailio[10135]: DEBUG: <core> [sr_module.c:966]: init_mod(): DEBUG: init_mod: acc Jun 5 13:49:10 phoenix-c2 /usr/local/sbin/kamailio[10135]: DEBUG: <core> [sr_module.c:701]: find_mod_export_record(): find_export_record: found <load_tm> in module tm [/usr/local/lib64/kamailio/modules/tm.so] Jun 5 13:49:10 phoenix-c2 /usr/local/sbin/kamailio[10135]: DEBUG: <core> [sr_module.c:701]: find_mod_export_record(): find_export_record: found <t_newtran> in module tm [/usr/local/lib64/kamailio/modules/tm.so] Jun 5 13:49:10 phoenix-c2 /usr/local/sbin/kamailio[10135]: DEBUG: <core> [sr_module.c:701]: find_mod_export_record(): find_export_record: found <t_relay_to_tcp> in module tm [/usr/local/lib64/kamailio/modules/tm.so] Jun 5 13:49:10 phoenix-c2 /usr/local/sbin/kamailio[10135]: DEBUG: <core> [sr_module.c:701]: find_mod_export_record(): find_export_record: found <t_relay_to_udp> in module tm [/usr/local/lib64/kamailio/modules/tm.so] Jun 5 13:49:10 phoenix-c2 /usr/local/sbin/kamailio[10135]: DEBUG: <core> [sr_module.c:701]: find_mod_export_record(): find_export_record: found <t_relay> in module tm [/usr/local/lib64/kamailio/modules/tm.so] Jun 5 13:49:10 phoenix-c2 /usr/local/sbin/kamailio[10135]: DEBUG: <core> [sr_module.c:701]: find_mod_export_record(): find_export_record: found <t_forward_nonack> in module tm [/usr/local/lib64/kamailio/modules/tm.so] Jun 5 13:49:10 phoenix-c2 /usr/local/sbin/kamailio[10135]: DEBUG: <core> [sr_module.c:966]: init_mod(): DEBUG: init_mod: acc_radius Jun 5 13:49:10 phoenix-c2 /usr/local/sbin/kamailio[10135]: DEBUG: <core> [usr_avp.c:895]: parse_avp_ident(): Parsing 'i:60' Jun 5 13:49:10 phoenix-c2 /usr/local/sbin/kamailio[10135]: DEBUG: <core> [usr_avp.c:895]: parse_avp_ident(): Parsing 'numipa' Jun 5 13:49:10 phoenix-c2 kamailio: ERROR: <core> [daemonize.c:307]: daemonize(): Main process exited before writing to pipe
..and die. whats wrong?
-- WBR, Victor JID: coyote@bks.tv JID: coyote@bryansktel.ru I use FREE operation system: 3.9.4-calculate GNU/Linux
Hello,
this is related to:
http://sip-router.org/tracker/index.php?do=details&task_id=310&proje...
right?
Have you got additional details?
Cheers, Daniel
On 6/5/13 11:51 AM, Victor V. Kustov wrote:
Hello.
[/usr/local/lib64/kamailio/modules/tm.so] Jun 5 13:49:10 phoenix-c2 /usr/local/sbin/kamailio[10135]: DEBUG: <core> [sr_module.c:701]: find_mod_export_record(): find_export_record: found <t_relay_to_tcp> in module tm [/usr/local/lib64/kamailio/modules/tm.so] Jun 5 13:49:10 phoenix-c2 /usr/local/sbin/kamailio[10135]: DEBUG: <core> [sr_module.c:701]: find_mod_export_record(): find_export_record: found <t_relay> in module tm [/usr/local/lib64/kamailio/modules/tm.so] Jun 5 13:49:10 phoenix-c2 /usr/local/sbin/kamailio[10135]: DEBUG: <core> [sr_module.c:701]: find_mod_export_record(): find_export_record: found <load_rr> in module rr [/usr/local/lib64/kamailio/modules/rr.so] Jun 5 13:49:10 phoenix-c2 /usr/local/sbin/kamailio[10135]: DEBUG: <core> [sr_module.c:966]: init_mod(): DEBUG: init_mod: acc Jun 5 13:49:10 phoenix-c2 /usr/local/sbin/kamailio[10135]: DEBUG: <core> [sr_module.c:701]: find_mod_export_record(): find_export_record: found <load_tm> in module tm [/usr/local/lib64/kamailio/modules/tm.so] Jun 5 13:49:10 phoenix-c2 /usr/local/sbin/kamailio[10135]: DEBUG: <core> [sr_module.c:701]: find_mod_export_record(): find_export_record: found <t_newtran> in module tm [/usr/local/lib64/kamailio/modules/tm.so] Jun 5 13:49:10 phoenix-c2 /usr/local/sbin/kamailio[10135]: DEBUG: <core> [sr_module.c:701]: find_mod_export_record(): find_export_record: found <t_relay_to_tcp> in module tm [/usr/local/lib64/kamailio/modules/tm.so] Jun 5 13:49:10 phoenix-c2 /usr/local/sbin/kamailio[10135]: DEBUG: <core> [sr_module.c:701]: find_mod_export_record(): find_export_record: found <t_relay_to_udp> in module tm [/usr/local/lib64/kamailio/modules/tm.so] Jun 5 13:49:10 phoenix-c2 /usr/local/sbin/kamailio[10135]: DEBUG: <core> [sr_module.c:701]: find_mod_export_record(): find_export_record: found <t_relay> in module tm [/usr/local/lib64/kamailio/modules/tm.so] Jun 5 13:49:10 phoenix-c2 /usr/local/sbin/kamailio[10135]: DEBUG: <core> [sr_module.c:701]: find_mod_export_record(): find_export_record: found <t_forward_nonack> in module tm [/usr/local/lib64/kamailio/modules/tm.so] Jun 5 13:49:10 phoenix-c2 /usr/local/sbin/kamailio[10135]: DEBUG: <core> [sr_module.c:966]: init_mod(): DEBUG: init_mod: acc_radius Jun 5 13:49:10 phoenix-c2 /usr/local/sbin/kamailio[10135]: DEBUG: <core> [usr_avp.c:895]: parse_avp_ident(): Parsing 'i:60' Jun 5 13:49:10 phoenix-c2 /usr/local/sbin/kamailio[10135]: DEBUG: <core> [usr_avp.c:895]: parse_avp_ident(): Parsing 'numipa' Jun 5 13:49:10 phoenix-c2 kamailio: ERROR: <core> [daemonize.c:307]: daemonize(): Main process exited before writing to pipe
..and die. whats wrong?
-- WBR, Victor JID: coyote@bks.tv JID: coyote@bryansktel.ru I use FREE operation system: 3.9.4-calculate GNU/Linux
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hello, Daniel-Constantin!
Hello,
this is related to:
http://sip-router.org/tracker/index.php?do=details&task_id=310&proje...
right?
exactly.
Have you got additional details?
hmm... it easy to reproduce. just comment "acctserver xxxx" in radius-ng.conf AND use radius accounting.
I know, its stupid, but i think better say "Error in config ____" and stop, then silently die with core.
-- WBR, Victor JID: coyote@bks.tv JID: coyote@bryansktel.ru I use FREE operation system: 3.9.4-calculate GNU/Linux
Hello,
I am not a radius user, so it is not easy to reproduce. If you get a core, then put the backtrace on tracker and we will look at it. The issue might be in radius client library, kamailio uses function from the library to parse the config -- we can see that from the core backtrace.
Cheers, Daniel
On 6/6/13 4:15 PM, Victor V. Kustov wrote:
Hello, Daniel-Constantin!
Hello,
this is related to:
http://sip-router.org/tracker/index.php?do=details&task_id=310&proje...
right?
exactly.
Have you got additional details?
hmm... it easy to reproduce. just comment "acctserver xxxx" in radius-ng.conf AND use radius accounting.
I know, its stupid, but i think better say "Error in config ____" and stop, then silently die with core.
-- WBR, Victor JID: coyote@bks.tv JID: coyote@bryansktel.ru I use FREE operation system: 3.9.4-calculate GNU/Linux
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Hello,
it may be useful to add it in the faq or mini-howtos on the wiki, wherever you consider more appropriate:
- https://www.kamailio.org/wiki/tutorials/faq/main - https://www.kamailio.org/wiki/tutorials/mini-howto-admin/main
Cheers, Daniel
On 6/4/13 6:54 PM, Klaus Darilion wrote:
Finally I found it myself. For the records:
To address a certain header (regardless if headers are in a single line or in separate lines) use the @hf_value select. The trick is to load the textopsx module (this select used to be in ser's textops module). Note, header names must use '_' instead of '-'.
To delete or manipulate a certain header also use the functions from the textopsx module, e.g: remove_hf_value(). Note, here '-' is used for headers with '-'
For example, incoming message:
Record-Route: sip:1.1.1.1;lr=on;nat=yes Record-Route: sip:2.2.2.2:5060;lr;transport=udp, sip:3.3.3.3:22506;lr;transport=udp
Dump all headers: xlog("$sel(@hf_value.Record_Route)");
Dump the first header: xlog("$sel(@hf_value.Record_Route[1])");
Dump the second last header: xlog("$sel(@hf_value.Record_Route[-2])");
Remove the last header: remove_hf_value("Record-Route[-1]"); or in above case: remove_hf_value("Record-Route[3]");
regards Klaus
On 04.06.2013 17:18, Klaus Darilion wrote:
Hi!
Is there a simple way to:
- retrieve the RR headers (or Route/Contact ...) and to
- selectively remove them?
E.g. retrieve <2> and delete <3>
I do not want to care about the format, eg: Record-Route: <1>, <2>, <3> or Record-Route: <1> Record-Route: <2> Record-Route: <3>
Thanks Klaus
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
done
http://www.kamailio.org/wiki/tutorials/faq/main#how_to_remove_a_single_heade...
On 06.06.2013 10:33, Daniel-Constantin Mierla wrote:
Hello,
it may be useful to add it in the faq or mini-howtos on the wiki, wherever you consider more appropriate:
- https://www.kamailio.org/wiki/tutorials/faq/main
- https://www.kamailio.org/wiki/tutorials/mini-howto-admin/main
Cheers, Daniel
On 6/4/13 6:54 PM, Klaus Darilion wrote:
Finally I found it myself. For the records:
To address a certain header (regardless if headers are in a single line or in separate lines) use the @hf_value select. The trick is to load the textopsx module (this select used to be in ser's textops module). Note, header names must use '_' instead of '-'.
To delete or manipulate a certain header also use the functions from the textopsx module, e.g: remove_hf_value(). Note, here '-' is used for headers with '-'
For example, incoming message:
Record-Route: sip:1.1.1.1;lr=on;nat=yes Record-Route: sip:2.2.2.2:5060;lr;transport=udp, sip:3.3.3.3:22506;lr;transport=udp
Dump all headers: xlog("$sel(@hf_value.Record_Route)");
Dump the first header: xlog("$sel(@hf_value.Record_Route[1])");
Dump the second last header: xlog("$sel(@hf_value.Record_Route[-2])");
Remove the last header: remove_hf_value("Record-Route[-1]"); or in above case: remove_hf_value("Record-Route[3]");
regards Klaus
On 04.06.2013 17:18, Klaus Darilion wrote:
Hi!
Is there a simple way to:
- retrieve the RR headers (or Route/Contact ...) and to
- selectively remove them?
E.g. retrieve <2> and delete <3>
I do not want to care about the format, eg: Record-Route: <1>, <2>, <3> or Record-Route: <1> Record-Route: <2> Record-Route: <3>
Thanks Klaus
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users