[OpenSIPS-Users] b2b_logic - add/modifiy custom header on script_req_route/script_reply_route
Ovidiu Sas
osas at voipembedded.com
Wed Oct 4 20:42:43 UTC 2023
Take a look at:
https://opensips.org/docs/modules/3.4.x/b2b_logic.html#func_b2b_server_new
https://opensips.org/docs/modules/3.4.x/b2b_logic.html#func_b2b_client_new
Check the extra_hdrs and extra_hdr_bodies params.
-ovidiu
On Thu, Feb 16, 2023 at 2:00 AM Eagle Cheung <feiyingcheung at 126.com> wrote:
>
> Hi,
> I want to know how to add/modifiy custom header on script_req_route/script_reply_route.
>
> cfg file statement
> ------------------------------------------
> loadmodule "b2b_logic.so"
> modparam("b2b_logic", "script_req_route", "b2b_request")
> modparam("b2b_logic", "script_reply_route", "b2b_reply")
> modparam("b2b_logic", "custom_headers", "P-Local-Header")
>
> rotue {
> ...
>
> if (is_method("INVITE") && !has_totag()) {
> b2b_server_new("caller");
> b2b_client_new("media", "sip:1234 at 192.168.216.1");
> # !!!!!!!!!!!!!work fine, add header succeed.
> append_hf("P-Local-Header: test1\r\n");
> b2b_init_request("base");
> exit;
> }
>
> ...
> }
>
> route[b2b_request] {
> # !!!!!!!!!!!!!!!!dosen't work, could not to add.
> append_hf("P-Local-Header: test2\r\n");
> b2b_pass_request();
> }
>
> route[b2b_reply] {
> # !!!!!!!!!!!!!!dosen't work, could not to add.
> append_hf("P-Local-Header: test2\r\n");
> b2b_handle_reply();
> }
> --------------------------------------
> looking forward your reply!
> BR
> Sam Cheung
>
>
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
--
VoIP Embedded, Inc.
http://www.voipembedded.com
More information about the Users
mailing list