Re: Getting started with Kamailio and Freeswitch

Alex Lake via sr-users <[email protected]> Thu, 30 Jul 2026 05:45:22 +0000
Newsgroups gmane.comp.voip.ser
Message-ID <[email protected]>
--===============1972968889==
Content-Type: multipart/alternative; boundary="_av-9Igddc9YtK4Yb964RctYrg"

--_av-9Igddc9YtK4Yb964RctYrg
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable

So I took out the definition of WITH_AUTH.
Sure enough, it doesn't do the 407, but it still rejects

This is the code where it fails. Not sure what route(TOVOICEMAIL) is all 
about, so I'm assuming that lookup("location") is failing for some reason.

route[LOCATION] {

 =C2=A0 =C2=A0 =C2=A0 =C2=A0 $avp(oexten) =3D $rU;
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (!lookup("location")) {
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 $var(rc) =3D $rc;
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 route(TOVOICEMAIL)=
;
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 t_newtran();
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 switch ($var(rc)) =
{
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 case -1:
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 case -3:
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 send_reply("404", "Not Found A");
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 exit;
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 case -2:
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 send_reply("405", "Method Not Allowe=
d");
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 exit;
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return;
}


On 30/07/2026 06:10, Rajneesh Soni via sr-users wrote:
> I think you are calling "auth_check()/auth_challenge()" for the INVITE 
> request.
>
> if proxy-auth is not required, you need skip auth*() for the INVITE path.
>
> On Thu, Jul 30, 2026 at 1:43=E2=80=AFAM Ghulam Mustafa via sr-users 
> <[email protected]> wrote:
>
>     Share logs and SIP messages if possible
>
>     On Thu, Jul 30, 2026 at 1:31=E2=80=AFAM Alex Lake via sr-users
>     <[email protected]> wrote:
>
>         Hi all,
>
>         I've been meaning to use this since it was called SER, but now
>         is the
>         time...
>
>         I've tried to follow some guides on how to set it up.
>
>         I created a user which seems to be able to REGISTER perfectly
>         well.
>
>         However, when I try to send a call, the 407 response seems to
>         be replied
>         to perfectly well, but it would appear that the
>         lookup("location")
>         function sets $rc to -3 and so Kamailio returns 404 to the INVITE=
.
>
>         Any ideas about where to look for getting past this?
>
>         Many thanks!
>
>         Alex
>         __________________________________________________________
>         Kamailio - Users Mailing List - Non Commercial Discussions --
>         [email protected]
>         To unsubscribe send an email to [email protected]
>         Important: keep the mailing list in the recipients, do not
>         reply only to the sender!
>
>     __________________________________________________________
>     Kamailio - Users Mailing List - Non Commercial Discussions --
>     [email protected]
>     To unsubscribe send an email to [email protected]
>     Important: keep the mailing list in the recipients, do not reply
>     only to the sender!
>
>
> __________________________________________________________
> Kamailio - Users Mailing List - Non Commercial Discussions --sr-users@lis=
ts.kamailio.org
> To unsubscribe send an email [email protected]
> Important: keep the mailing list in the recipients, do not reply only to =
the sender!




--_av-9Igddc9YtK4Yb964RctYrg
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DUTF-8=
">
  </head>
  <body>
    <div class=3D"moz-cite-prefix">So I took out the definition of
      WITH_AUTH.</div>
    <div class=3D"moz-cite-prefix">Sure enough, it doesn't do the 407, but
      it still rejects</div>
    <div class=3D"moz-cite-prefix"><br>
    </div>
    <div class=3D"moz-cite-prefix">This is the code where it fails. Not
      sure what route(TOVOICEMAIL) is all about, so I'm assuming that
      lookup("location") is failing for some reason.</div>
    <div class=3D"moz-cite-prefix"><br>
    </div>
    <div class=3D"moz-cite-prefix">route[LOCATION] {<br>
      <br>
      =C2=A0 =C2=A0 =C2=A0 =C2=A0 $avp(oexten) =3D $rU;<br>
      =C2=A0 =C2=A0 =C2=A0 =C2=A0 if (!lookup("location")) {<br>
      =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 $var(rc) =3D =
$rc;<br>
      =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 route(TOVOICE=
MAIL);<br>
      =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 t_newtran();<=
br>
      =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 switch ($var(=
rc)) {<br>
      =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 case -1:<br>
      =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 case -3:<br>
      =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 send_reply("404", "Not Found A")=
;<br>
      =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 exit;<br>
      =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 case -2:<br>
      =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 send_reply("405", "Method Not
      Allowed");<br>
      =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=
 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 exit;<br>
      =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>
      =C2=A0 =C2=A0 =C2=A0 =C2=A0 }<br>
      =C2=A0 =C2=A0 =C2=A0 =C2=A0 return;<br>
      }<br>
      <br>
    </div>
    <div class=3D"moz-cite-prefix"><br>
    </div>
    <div class=3D"moz-cite-prefix">On 30/07/2026 06:10, Rajneesh Soni via
      sr-users wrote:<br>
    </div>
    <blockquote type=3D"cite" cite=3D"mid:CAMwZW1mcZNtwdTcm7TUbCH75pKz9XTBn=
[email protected]">
      <meta http-equiv=3D"content-type" content=3D"text/html; charset=3DUTF=
-8">
      <div dir=3D"ltr">I think you are calling
        "auth_check()/auth_challenge()" for the INVITE request.
        <div><br>
        </div>
        <div>if proxy-auth is not required, you need skip auth*() for
          the INVITE path.</div>
      </div>
      <br>
      <div class=3D"gmail_quote gmail_quote_container">
        <div dir=3D"ltr" class=3D"gmail_attr">On Thu, Jul 30, 2026 at
          1:43=E2=80=AFAM Ghulam Mustafa via sr-users &lt;<a href=3D"mailto=
:[email protected]" moz-do-not-send=3D"true" class=3D"moz-txt-lin=
k-freetext">[email protected]</a>&gt;
          wrote:<br>
        </div>
        <blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex=
;border-left:1px solid rgb(204,204,204);padding-left:1ex">
          <div dir=3D"ltr">Share logs and SIP messages if possible=C2=A0</d=
iv>
          <br>
          <div class=3D"gmail_quote">
            <div dir=3D"ltr" class=3D"gmail_attr">On Thu, Jul 30, 2026 at
              1:31=E2=80=AFAM Alex Lake via sr-users &lt;<a href=3D"mailto:=
[email protected]" target=3D"_blank" moz-do-not-send=3D"true" cla=
ss=3D"moz-txt-link-freetext">[email protected]</a>&gt;
              wrote:<br>
            </div>
            <blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0=
.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi
              all,<br>
              <br>
              I've been meaning to use this since it was called SER, but
              now is the <br>
              time...<br>
              <br>
              I've tried to follow some guides on how to set it up.<br>
              <br>
              I created a user which seems to be able to REGISTER
              perfectly well.<br>
              <br>
              However, when I try to send a call, the 407 response seems
              to be replied <br>
              to perfectly well, but it would appear that the
              lookup("location") <br>
              function sets $rc to -3 and so Kamailio returns 404 to the
              INVITE.<br>
              <br>
              Any ideas about where to look for getting past this?<br>
              <br>
              Many thanks!<br>
              <br>
              Alex<br>
              __________________________________________________________<br=
>
              Kamailio - Users Mailing List - Non Commercial Discussions
              -- <a href=3D"mailto:[email protected]" target=3D"_=
blank" moz-do-not-send=3D"true" class=3D"moz-txt-link-freetext">sr-users@li=
sts.kamailio.org</a><br>
              To unsubscribe send an email to <a href=3D"mailto:sr-users-le=
[email protected]" target=3D"_blank" moz-do-not-send=3D"true" class=3D=
"moz-txt-link-freetext">[email protected]</a><br>
              Important: keep the mailing list in the recipients, do not
              reply only to the sender!<br>
            </blockquote>
          </div>
          __________________________________________________________<br>
          Kamailio - Users Mailing List - Non Commercial Discussions --
          <a href=3D"mailto:[email protected]" target=3D"_blank" =
moz-do-not-send=3D"true" class=3D"moz-txt-link-freetext">[email protected]=
ailio.org</a><br>
          To unsubscribe send an email to <a href=3D"mailto:sr-users-leave@=
lists.kamailio.org" target=3D"_blank" moz-do-not-send=3D"true" class=3D"moz=
-txt-link-freetext">[email protected]</a><br>
          Important: keep the mailing list in the recipients, do not
          reply only to the sender!<br>
        </blockquote>
      </div>
      <br>
      <fieldset class=3D"moz-mime-attachment-header"></fieldset>
      <pre wrap=3D"" class=3D"moz-quote-pre">______________________________=
____________________________
Kamailio - Users Mailing List - Non Commercial Discussions -- <a class=3D"m=
oz-txt-link-abbreviated" href=3D"mailto:[email protected]">sr-use=
[email protected]</a>
To unsubscribe send an email to <a class=3D"moz-txt-link-abbreviated" href=
=3D"mailto:[email protected]">[email protected]=
.org</a>
Important: keep the mailing list in the recipients, do not reply only to th=
e sender!
</pre>
    </blockquote>
    <p><br>
    </p>
  <img src=3D"https://mandrillapp.com/track/open.php?u=3D31612945&id=3D4841=
fcfa54504ee5bd4635e53446f5cc" height=3D"1" width=3D"1" alt=3D""></body>
</html>



--_av-9Igddc9YtK4Yb964RctYrg--


--===============1972968889==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the sender!

--===============1972968889==--