Kamailio module nathelper: Difference between revisions

From 탱이의 잡동사니
Jump to navigation Jump to search
(Created page with "== Overview == Kamailio 모듈 nathelper 내용 정리. == See also == * https://kamailio.org/docs/modules/devel/modules/nathelper.html category:kamailio")
 
Line 1: Line 1:
== Overview ==
== Overview ==
Kamailio 모듈 nathelper 내용 정리.
Kamailio 모듈 nathelper 내용 정리.
== Functions ==
=== set_contact_alias([trim]) ===
Adds an ";alias=ip~port~transport" parameter to the contact URI containing the received ip, port, and transport protocol. The new contact URI is immediately visible to other modules in the way the fix_nated_contact() does it.
* trim: by default, set_contact_alias() will not detect and trim an already existing alias parameter. If this optional parameter is set to "1", set_contact_alias() will trim the existing alias before adding a new one.
<pre>
...
    if (!is_present_hf("Record-Route")) {
        if (!set_contact_alias()) {
            xlog("L_ERR", "Error in aliasing contact $ct\n");
            send_reply("400", "Bad request");
            exit;
        };
    };
...
</pre>


== See also ==
== See also ==

Revision as of 16:19, 15 June 2022

Overview

Kamailio 모듈 nathelper 내용 정리.


Functions

set_contact_alias([trim])

Adds an ";alias=ip~port~transport" parameter to the contact URI containing the received ip, port, and transport protocol. The new contact URI is immediately visible to other modules in the way the fix_nated_contact() does it.

  • trim: by default, set_contact_alias() will not detect and trim an already existing alias parameter. If this optional parameter is set to "1", set_contact_alias() will trim the existing alias before adding a new one.
...
    if (!is_present_hf("Record-Route")) {
        if (!set_contact_alias()) {
            xlog("L_ERR", "Error in aliasing contact $ct\n");
            send_reply("400", "Bad request");
            exit;
        };
    };
...

See also