<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div class="moz-cite-prefix">You have to put the the #!subst and
      listen after loading pv module.</div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">Probably env and def variable should be
      relocated to core, not having SIP/runtime dependency, to
      facilitate their use during start up.<br>
    </div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">Cheers,<br>
      Daniel<br>
    </div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">On 22.12.20 06:58, Syed Shahryar wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CA+mcf=v8fOufD6xxvJEmmY-DqX3TUUpwbs5JgNX6jrUqZcNuxw@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">Any updates on this?</div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Tue, Dec 15, 2020 at 8:13
          PM Syed Shahryar <<a href="mailto:syedshahryar@gmail.com"
            moz-do-not-send="true">syedshahryar@gmail.com</a>> wrote:<br>
        </div>
        <blockquote class="gmail_quote" style="margin:0px 0px 0px
          0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
          <div dir="ltr">
            <div>I am new to Kamailio so may be doing something wrong. I
              looked at <a
                href="https://www.kamailio.org/wiki/cookbooks/5.4.x/core"
                target="_blank" moz-do-not-send="true">https://www.kamailio.org/wiki/cookbooks/5.4.x/core</a>.</div>
            <div><br>
            </div>
            I tried the following combinations but getting errors in all
            cases:
            <div><br>
            </div>
            <div><font face="monospace">#!subst
                "/EVAPI_PORT/$env(EVAPI_PORT)/"<br>
                #!substdef "/EVAPI_PORT/$env(EVAPI_PORT)/"<br>
                #!substdefs "/EVAPI_PORT/$env(EVAPI_PORT)/"</font><br>
            </div>
            <div><br>
            </div>
            <div><font face="monospace"><b>Errors:</b></font></div>
            <div><font face="monospace"> 0(6) ERROR: <core>
                [core/pvapi.c:924]: pv_parse_spec2(): error searching
                pvar "env"<br>
                 0(6) ERROR: <core> [core/pvapi.c:1127]:
                pv_parse_spec2(): wrong char [E/69] in
                [$env(EVAPI_PORT)/] at [5 (5)]<br>
                 0(6) ERROR: <core> [core/re.c:170]: parse_repl():
                bad specifier in replace part /$env(EVAPI_PORT)/<br>
                 0(6) ERROR: <core> [core/ppcfg.c:69]:
                pp_subst_add(): bad subst expression:
                /EVAPI_PORT/$env(EVAPI_PORT)/</font><br>
            </div>
            <div><br>
            </div>
            <div>At a later step, I would like to do:</div>
            <div><font face="monospace">#!define EVAPI_LISTEN
                "0.0.0.0:EVAPI_PORT"<br>
              </font></div>
            <div><br>
            </div>
            <div>And use EVAP_LISTEN in mod_param for the evapi module.</div>
            <div><br>
            </div>
            <div>And something similar to above for TLS settings.<br>
            </div>
            <div><br>
            </div>
          </div>
          <br>
          <div class="gmail_quote">
            <div dir="ltr" class="gmail_attr">On Tue, Dec 15, 2020 at
              12:41 PM Daniel-Constantin Mierla <<a
                href="mailto:miconda@gmail.com" target="_blank"
                moz-do-not-send="true">miconda@gmail.com</a>> wrote:<br>
            </div>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
              0.8ex;border-left:1px solid
              rgb(204,204,204);padding-left:1ex">
              <div>
                <p>Hello,</p>
                <p>as written on the tracker, look at using #!subst or
                  #!substdef (see core cookbook), they should be able to
                  get the substitution value from environment using
                  $env(NAME).</p>
                <p>The master branch introduced #!defenv as a (simpler)
                  alternative.</p>
                <p>Cheers,<br>
                  Daniel<br>
                </p>
                <div>On 12.12.20 05:33, Syed Shahryar wrote:<br>
                </div>
                <blockquote type="cite">
                  <div dir="ltr">
                    <div>I tried many combinations of the following but
                      I keep getting syntax errors:</div>
                    <div><br>
                    </div>
                    <div>listen=tls:TLS_IP:$env(TLS_PORT) advertise
                      PUBLIC_IP:$env(TLS_PORT)<br>
                    </div>
                    <div><br>
                    </div>
                    <div><br>
                    </div>
                    <div>TLS_IP and PUBLIC_IP are constants defined at
                      the top using #!define. And, TLS_PORT is supposed
                      to be the env variable.<br>
                    </div>
                    <br clear="all">
                    <div><br>
                    </div>
                    -- <br>
                    <div dir="ltr">
                      <div dir="ltr">
                        <div>
                          <div dir="ltr">--<br>
                            This message contains confidential
                            information and is intended only for the
                            individual named. If you are not the named
                            addressee, you should not disseminate,
                            distribute or copy this email. Please notify
                            the sender immediately by email if you have
                            received this email by mistake and delete
                            this email from your system. Email
                            transmission cannot be guaranteed to be
                            secure or error-free, as information could
                            be intercepted, corrupted, lost, destroyed,
                            arrive late or incomplete, or contain
                            viruses. The sender, therefore, does not
                            accept liability for any errors or omissions
                            in the contents of this message which arise
                            as a result of email transmission. If
                            verification is required, please request a
                            hard-copy version.<br>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                  <br>
                  <fieldset></fieldset>
                  <pre>_______________________________________________
Kamailio (SER) - Users Mailing List
<a href="mailto:sr-users@lists.kamailio.org" target="_blank" moz-do-not-send="true">sr-users@lists.kamailio.org</a>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" target="_blank" moz-do-not-send="true">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
                </blockquote>
                <pre cols="72">-- 
Daniel-Constantin Mierla -- <a href="http://www.asipto.com" target="_blank" moz-do-not-send="true">www.asipto.com</a>
<a href="http://www.twitter.com/miconda" target="_blank" moz-do-not-send="true">www.twitter.com/miconda</a> -- <a href="http://www.linkedin.com/in/miconda" target="_blank" moz-do-not-send="true">www.linkedin.com/in/miconda</a>
Funding: <a href="https://www.paypal.me/dcmierla" target="_blank" moz-do-not-send="true">https://www.paypal.me/dcmierla</a></pre>
              </div>
            </blockquote>
          </div>
          <br clear="all">
          <div><br>
          </div>
          -- <br>
          <div dir="ltr">
            <div dir="ltr">
              <div>
                <div dir="ltr">--<br>
                  This message contains confidential information and is
                  intended only for the individual named. If you are not
                  the named addressee, you should not disseminate,
                  distribute or copy this email. Please notify the
                  sender immediately by email if you have received this
                  email by mistake and delete this email from your
                  system. Email transmission cannot be guaranteed to be
                  secure or error-free, as information could be
                  intercepted, corrupted, lost, destroyed, arrive late
                  or incomplete, or contain viruses. The sender,
                  therefore, does not accept liability for any errors or
                  omissions in the contents of this message which arise
                  as a result of email transmission. If verification is
                  required, please request a hard-copy version.<br>
                </div>
              </div>
            </div>
          </div>
        </blockquote>
      </div>
      <br clear="all">
      <div><br>
      </div>
      -- <br>
      <div dir="ltr" class="gmail_signature">
        <div dir="ltr">
          <div>
            <div dir="ltr">--<br>
              This message contains confidential information and is
              intended only for the individual named. If you are not the
              named addressee, you should not disseminate, distribute or
              copy this email. Please notify the sender immediately by
              email if you have received this email by mistake and
              delete this email from your system. Email transmission
              cannot be guaranteed to be secure or error-free, as
              information could be intercepted, corrupted, lost,
              destroyed, arrive late or incomplete, or contain viruses.
              The sender, therefore, does not accept liability for any
              errors or omissions in the contents of this message which
              arise as a result of email transmission. If verification
              is required, please request a hard-copy version.<br>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
Kamailio (SER) - Users Mailing List
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.kamailio.org">sr-users@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
    </blockquote>
    <p><br>
    </p>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla -- <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Funding: <a class="moz-txt-link-freetext" href="https://www.paypal.me/dcmierla">https://www.paypal.me/dcmierla</a></pre>
  </body>
</html>