<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    Hello,<br>
    <br>
    the INVITE comes with that Caller ID set from Asterisk. It was very
    unlikely Kamailio changes it unless you use uac module.<br>
    <br>
    I guess Asterisk in matching on source IP and port and happens to
    select another (pretty much randomly) caller id.<br>
    <br>
    Try to use type=user in sipusers table.<br>
    <br>
    Another option is to get the caller id from incoming invite to
    asterisk and set it for outgoing invite from asterisk.<br>
    <br>
    Let me know if any of these works.<br>
    <br>
    Cheers,<br>
    Daniel<br>
    <br>
    <br>
    On 10/12/10 5:14 PM, Lucas Alvarez wrote:
    <blockquote
      cite="mid:AANLkTim1UXHKFniy9QeTeDiu53BZ3P0103+GQfgr7xEA@mail.gmail.com"
      type="cite"><span class="Apple-style-span" style="font-family:
        arial,sans-serif; font-size: 13px; border-collapse: collapse;">Hi
        Daniel-Constantin, thank for your quick response. This is the
        link to the SIP trace:&nbsp;</span>
      <div><span class="Apple-style-span" style="font-family:
          arial,sans-serif; font-size: 13px; border-collapse: collapse;"><br>
        </span></div>
      <div><span class="Apple-style-span" style="font-family:
          arial,sans-serif; font-size: 13px; border-collapse: collapse;"><font
            size="3"><a moz-do-not-send="true"
              href="http://www.euscorp.com/images/Wedpooi321989812j1DD9ddd9PaHw8XCa">http://www.euscorp.com/images/Wedpooi321989812j1DD9ddd9PaHw8XCa</a></font></span>
        <div>
          <font class="Apple-style-span" face="arial, sans-serif"><span
              class="Apple-style-span" style="border-collapse: collapse;
              font-size: medium;"><br>
            </span></font>
          <div><span class="Apple-style-span" style="font-family:
              arial,sans-serif; font-size: 13px; border-collapse:
              collapse;">I didn't send it through the list cause the
              body size needed approval.</span>
            <div>
              <span class="Apple-style-span" style="font-family:
                arial,sans-serif; font-size: 13px; border-collapse:
                collapse;">The trace is a call from the extension 1090
                to 1020. Kamailio is listening at&nbsp;</span><span
                class="Apple-style-span" style="font-family:
                arial,sans-serif; font-size: 13px; border-collapse:
                collapse;"><a moz-do-not-send="true"
                  href="http://192.168.15.11:5060/" target="_blank"
                  style="color: rgb(0, 0, 204);">192.168.15.11:5060</a></span><span
                class="Apple-style-span" style="font-family:
                arial,sans-serif; font-size: 13px; border-collapse:
                collapse;">&nbsp;and asterisk at&nbsp;</span><span
                class="Apple-style-span" style="font-family:
                arial,sans-serif; font-size: 13px; border-collapse:
                collapse;"><a moz-do-not-send="true"
                  href="http://192.168.15.11:5080/" target="_blank"
                  style="color: rgb(0, 0, 204);">192.168.15.11:5080</a></span><span
                class="Apple-style-span" style="font-family:
                arial,sans-serif; font-size: 13px; border-collapse:
                collapse;">.&nbsp;Additionally I have pasted below a short
                CLI trace on asterisk showing up a NoOp with the caller
                id followed by the dial and the first invite.&nbsp;</span><span
                class="Apple-style-span" style="font-family:
                arial,sans-serif; font-size: 13px; border-collapse:
                collapse;"><br>
              </span><span class="Apple-style-span" style="font-family:
                arial,sans-serif; font-size: 13px; border-collapse:
                collapse;">I really appreciate you help. Regards.</span><span
                class="Apple-style-span" style="font-family:
                arial,sans-serif; font-size: 13px; border-collapse:
                collapse;"><br>
              </span><span class="Apple-style-span" style="font-family:
                arial,sans-serif; font-size: 13px; border-collapse:
                collapse;"><br>
              </span><span class="Apple-style-span" style="font-family:
                arial,sans-serif; font-size: 13px; border-collapse:
                collapse;">Lucas</span></div>
            <div><font class="Apple-style-span" face="arial, sans-serif"><span
                  class="Apple-style-span" style="border-collapse:
                  collapse;"><br>
                </span></font></div>
            <div><font class="Apple-style-span" face="arial, sans-serif"><span
                  class="Apple-style-span" style="border-collapse:
                  collapse;"><br>
                </span></font></div>
            <div><font class="Apple-style-span" face="arial, sans-serif"><span
                  class="Apple-style-span" style="border-collapse:
                  collapse;">CLI trace:</span></font></div>
            <div><font class="Apple-style-span" face="arial, sans-serif"><span
                  class="Apple-style-span" style="border-collapse:
                  collapse;"><br>
                </span></font></div>
            <div><font class="Apple-style-span" face="arial, sans-serif"><span
                  class="Apple-style-span" style="border-collapse:
                  collapse;"><br>
                </span></font></div>
            <div><font class="Apple-style-span" face="arial, sans-serif"><span
                  class="Apple-style-span" style="border-collapse:
                  collapse;">
                  <div>
                    &nbsp;&nbsp; &nbsp;-- Executing [1020@longdistance:1]
                    NoOp("SIP/1090-00000037", "Callerid number: 1090 &nbsp; &nbsp;
                    &nbsp;Name: Lucas Voice ") in new stack</div>
                  <div>&nbsp;&nbsp; &nbsp;-- Executing [1020@longdistance:2]
                    Dial("SIP/1090-00000037", "SIP/1020") in new stack</div>
                  <div>[Oct 12 10:44:26] DEBUG[17631]: chan_sip.c:3462
                    update_call_counter: Call to peer '1020' is 1 out of
                    10</div>
                  <div>Audio is at 192.168.15.11 port 18106</div>
                  <div>Adding codec 0x4 (ulaw) to SDP</div>
                  <div>Adding codec 0x8 (alaw) to SDP</div>
                  <div>Adding codec 0x2 (gsm) to SDP</div>
                  <div>Adding non-codec 0x1 (telephone-event) to SDP</div>
                  <div>Reliably Transmitting (no NAT) to <a
                      moz-do-not-send="true"
                      href="http://192.168.15.11:5060">192.168.15.11:5060</a>:</div>
                  <div>INVITE <a moz-do-not-send="true"
                      href="http://sip:1020@192.168.15.11:5060">sip:1020@192.168.15.11:5060</a>
                    SIP/2.0</div>
                  <div>Via: SIP/2.0/UDP
                    192.168.15.11:5080;branch=z9hG4bK7c1bd27b;rport</div>
                  <div>From: "Lucas Voice" &lt;<a moz-do-not-send="true"
                      href="mailto:sip%3A1020@192.168.15.11">sip:1020@192.168.15.11</a>&gt;;tag=as1a1d0e0e</div>
                  <div>To: &lt;<a moz-do-not-send="true"
                      href="http://sip:1020@192.168.15.11:5060">sip:1020@192.168.15.11:5060</a>&gt;</div>
                  <div>Contact: &lt;<a moz-do-not-send="true"
                      href="http://sip:1020@192.168.15.11:5080">sip:1020@192.168.15.11:5080</a>&gt;</div>
                  <div>Call-ID: <a moz-do-not-send="true"
                      href="mailto:7278984921bca2d55477817467d99103@192.168.15.11">7278984921bca2d55477817467d99103@192.168.15.11</a></div>
                  <div>CSeq: 102 INVITE</div>
                  <div>User-Agent: Asterisk PBX</div>
                  <div>Max-Forwards: 70</div>
                  <div>Date: Tue, 12 Oct 2010 14:44:26 GMT</div>
                  <div>Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER,
                    SUBSCRIBE, NOTIFY, INFO</div>
                  <div>
                    Supported: replaces</div>
                  <div>Content-Type: application/sdp</div>
                  <div>Content-Length: 287</div>
                  <div><br>
                  </div>
                  <div><br>
                  </div>
                  <div><br>
                  </div>
                  <div><br>
                  </div>
                  <div><br>
                  </div>
                </span></font><br>
              <div class="gmail_quote">On Mon, Oct 11, 2010 at 7:36 PM,
                Daniel-Constantin Mierla <span dir="ltr">&lt;<a
                    moz-do-not-send="true"
                    href="mailto:miconda@gmail.com">miconda@gmail.com</a>&gt;</span>
                wrote:<br>
                <blockquote class="gmail_quote" style="margin: 0pt 0pt
                  0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204);
                  padding-left: 1ex;">&nbsp;Hello,
                  <div>
                    <div class="h5"><br>
                      <br>
                      On 10/11/10 11:28 PM, Lucas Alvarez wrote:<br>
                      <blockquote class="gmail_quote" style="margin: 0pt
                        0pt 0pt 0.8ex; border-left: 1px solid rgb(204,
                        204, 204); padding-left: 1ex;">
                        Hi, I'm having a problem with the caller ID, I
                        have implemented an<br>
                        integration between asterisk and kamailio
                        following this tutorial:<br>
                        <a moz-do-not-send="true"
href="http://kb.asipto.com/asterisk:realtime:kamailio-3.0.x-asterisk-1.6.2-astdb"
                          target="_blank">http://kb.asipto.com/asterisk:realtime:kamailio-3.0.x-asterisk-1.6.2-astdb</a><br>
                        and the problem is that when I call from
                        extension, let's say 1000, to<br>
                        another extension, let's say 2000, the callerid
                        number is always the<br>
                        number I'm calling, in this case 2000. Using
                        xlog and printing $fu,<br>
                        $fU variables I realize that when the call came
                        from asterisk to the<br>
                        destination number, &nbsp;kamailio changes the "From"
                        headers. I will<br>
                        appreciate any kind of help.<br>
                        Regards.<br>
                        <br>
                      </blockquote>
                    </div>
                  </div>
                  can you take a SIP trace of such case on kamailio
                  server? preferably with ngrep:<br>
                  <br>
                  ngrep -d any -qt -W byline port 5060<br>
                  <br>
                  Cheers,<br>
                  Daniel<br>
                  <font color="#888888">
                    <br>
                    -- <br>
                    Daniel-Constantin Mierla<br>
                    <a moz-do-not-send="true"
                      href="http://www.asipto.com" target="_blank">http://www.asipto.com</a><br>
                    <br>
                  </font></blockquote>
              </div>
              <br>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-freetext" href="http://www.asipto.com">http://www.asipto.com</a></pre>
  </body>
</html>