<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 4/7/15 7:48 PM, Andrew Galdes wrote:<br>
    </div>
    <blockquote
cite="mid:CALm+qqBdi_RBhKtBW=Q40UT9J7DSF86fbgu=JRnxao4hfUw9Hw@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hi Dmitriy and others and thanks for your help so
        far.<br>
        <div><br>
        </div>
        <div>The option "<span style="font-size:12.8000001907349px">match_auth_username=yes"
            seems to have had no effect. From my reading, this option
            will try to match the username of the incoming SIP account
            to a section heading. If that is how it must work then i can
            see a big problem. I'm trying to present the receptionist
            with a nice display of which line the call came in on. For
            example, the receptionist answers calls for 8 different
            companies and would like the phone to display the company
            name that she should announce to the caller. </span></div>
        <div><span style="font-size:12.8000001907349px"><br>
          </span></div>
        <div><span style="font-size:12.8000001907349px">Here is a more
            complete output of an incoming call. I've changed the SIP
            numbers to "Company1', etc, to hide the numbers. </span></div>
        <div><span style="font-size:12.8000001907349px"><br>
          </span></div>
        <div>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span
              class="">Connected to Asterisk 10.12.4 currently running
              on asterisk (pid = 32267)<br>
            </span><span class="">Verbosity is at least 12<br>
            </span><span class="">asterisk*CLI> <br>
            </span><span class="">asterisk*CLI> <br>
            </span><span class="">asterisk*CLI> <br>
            </span><span class="">  == Using SIP RTP CoS mark 5<br>
            </span><span class="">    -- Executing [s@incoming:1] </span><span
              class=""><b>Set</b></span><span class="">("</span><span
              class=""><b>SIP/Company1-00000797</b></span><span class="">",
              "</span><span class=""><b>thedid=""NodePhone"<<a
                  moz-do-not-send="true"
                  href="mailto:sip%3ACompany2@sip.internode.on.net">sip:Company2@sip.internode.on.net</a>>"</b></span><span
              class="">") in new stack<br>
            </span><span class="">    -- Executing [s@incoming:2] </span><span
              class=""><b>Set</b></span><span class="">("</span><span
              class=""><b>SIP/</b><b>Company1</b><b>-00000797</b></span><span
              class="">", "</span><span class=""><b>pseudodid="NodePhone"<sip:</b><b> sip:Company2</b><b>@<a
                  moz-do-not-send="true"
                  href="http://sip.internode.on.net">sip.internode.on.net</a>></b></span><span
              class="">") in new stack<br>
            </span><span class="">    -- Executing [s@incoming:3] </span><span
              class=""><b>Set</b></span><span class="">("</span><span
              class=""><b>SIP/</b><b>Company1</b><b>-00000797</b></span><span
              class="">", "</span><span class=""><b>pseudodid="NodePhone"<sip:</b></span><span
              class=""><b> sip:Company2</b>") in new stack<br>
            </span><span class="">    -- Executing [s@incoming:4] </span><span
              class=""><b>Set</b></span><span class="">("</span><span
              class=""><b>SIP/</b><b>Company1</b><b>-00000797</b></span><span
              class="">", "</span><span class=""><b>pseudodid=</b></span><span
              class=""><b> sip:Company2</b>") in new stack<br>
            </span><span class="">    -- Executing [s@incoming:5] </span><span
              class=""><b>GotoIf</b></span><span class="">("</span><span
              class=""><b>SIP/</b><b>Company1</b><b>-00000797</b></span><span
              class="">", "</span><span class=""><b>0?internal,33,1:6</b></span><span
              class="">") in new stack<br>
            </span><span class="">    -- Goto (incoming,s,6)<br>
            </span><span class="">    -- Executing [s@incoming:6] </span><span
              class=""><b>GotoIf</b></span><span class="">("</span><span
              class=""><b>SIP/</b><b>Company1</b><b>-00000797</b></span><span
              class="">", "</span><span class=""><b>0?internal,88,1:7</b></span><span
              class="">") in new stack<br>
            </span><span class="">    -- Goto (incoming,s,7)<br>
            </span><span class="">    -- Executing [s@incoming:7] </span><span
              class=""><b>GotoIf</b></span><span class="">("</span><span
              class=""><b>SIP/</b><b>Company1</b><b>-00000797</b></span><span
              class="">", "</span><span class=""><b>0?internal,36,1:8</b></span><span
              class="">") in new stack<br>
            </span><span class="">    -- Goto (incoming,s,8)<br>
            </span><span class="">    -- Executing [s@incoming:8] </span><span
              class=""><b>GotoIf</b></span><span class="">("</span><span
              class=""><b>SIP/</b><b>Company1</b><b>-00000797</b></span><span
              class="">", "</span><span class=""><b>1?internal,36,1:9</b></span><span
              class="">") in new stack<br>
            </span><span class="">    -- Goto (internal,36,1)<br>
            </span><span class="">    -- Executing [36@internal:1] </span><span
              class=""><b>Set</b></span><span class="">("</span><span
              class=""><b>SIP/</b><b>Company1</b><b>-00000797</b></span><span
              class="">", "</span><span class=""><b>CALLERID(name)=SIP/</b><b>Company1</b><b>-00000797</b></span><span
              class="">") in new stack<br>
            </span><span class="">    -- Executing [36@internal:2] </span><span
              class=""><b>Dial</b></span><span class="">("</span><span
              class=""><b>SIP/</b><b>Company1</b><b>-00000797</b></span><span
              class="">", "</span><span class=""><b>SIP/36,20</b></span><span
              class="">") in new stack<br>
            </span><span class="">  == Using SIP RTP CoS mark 5<br>
            </span><span class="">    -- Called SIP/36<br>
            </span><span class="">    -- SIP/36-00000798 is ringing<br>
            </span><span class="">  == Spawn extension (internal, 36, 2)
              exited non-zero on 'SIP/Company1-00000797'<br>
            </span><span class="">asterisk*CLI> exit</span></blockquote>
        </div>
        <div><span style="font-size:12.8000001907349px"><br>
          </span></div>
        <div><span style="font-size:12.8000001907349px">And here is the
            "sip.conf":</span></div>
        <div><span style="font-size:12.8000001907349px"><br>
          </span></div>
        <div>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span
              class="">[general]<br>
            </span><span class="">match_auth_username=yes<br>
            </span><span class="">register=<a moz-do-not-send="true"
                href="http://081...:...@sip.internode.on.net/s">081...:...@sip.internode.on.net/s</a><br>
            </span><span class="">register=<a moz-do-not-send="true"
                href="http://082...:...@sip.internode.on.net/s">082...:...@sip.internode.on.net/s</a><br>
            </span><span class=""><a class="moz-txt-link-abbreviated" href="mailto:register=083...:...@sip.internode.on.net:/s">register=083...:...@sip.internode.on.net:/s</a><br>
            </span><span class=""><a class="moz-txt-link-abbreviated" href="mailto:register=084...:...@sip.internode.on.net:/s">register=084...:...@sip.internode.on.net:/s</a><br>
            </span><span class="">register=<a moz-do-not-send="true"
                href="http://085...:...@sip.internode.on.net/s">085...:...@sip.internode.on.net/s</a><br>
            </span><span class="">register=<a moz-do-not-send="true"
                href="http://086...:...@sip.internode.on.net/s">086...:...@sip.internode.on.net/s</a><br>
            </span><span class="">register=<a moz-do-not-send="true"
                href="http://087...:...@sip.internode.on.net/s">087...:...@sip.internode.on.net/s</a><br>
            </span><span class="">register=<a moz-do-not-send="true"
                href="http://088...:...@sip.internode.on.net/s">088...:...@sip.internode.on.net/s</a></span><br>
            <br>
            <span class="">[Company1]<br>
            </span><span class="">username=081...<br>
            </span><span class="">fromuser=081...<br>
            </span><span class="">secret=...<br>
            </span><span class="">canreinvite=no<br>
            </span><span class="">qualify=yes<br>
            </span><span class="">context=incoming<br>
            </span><span class="">type=friend<br>
            </span><span class="">insecure=invite,port<br>
            </span><span class="">fromdomain=<a moz-do-not-send="true"
                href="http://sip.internode.on.net">sip.internode.on.net</a><br>
            </span><span class="">host=<a moz-do-not-send="true"
                href="http://sip.internode.on.net">sip.internode.on.net</a><br>
            </span><span class="">dtmfmode=rfc2833<br>
            </span><span class="">disallow=all<br>
            </span><span class="">allow=alaw<br>
            </span><span class="">allow=ulaw<br>
            </span><span class="">allow=g729<br>
            </span><span class="">bindport=5060<br>
            </span><span class="">bindaddr=0.0.0.0<br>
            </span><span class="">nat=yes<br>
            </span><span class="">registertimeout=5<br>
            </span><span class="">allowoverlap=no<br>
            </span><span class="">srvlookup=no<br>
            </span><span class="">ubscribecontext=from-sip<br>
            </span><span class="">callcounter=yes</span></blockquote>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> </blockquote>
          <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span
              class="">[Company2]<br>
            </span>...<br>
            [Company3]<br>
            ...<br>
            [Company4]<br>
            ...</blockquote>
        </div>
        <div>
          <p class=""><span class=""></span></p>
          <p class=""><span class=""></span></p>
          <p class=""><span class=""></span></p>
        </div>
        <div class="gmail_extra">
          <div>
            <div class="gmail_signature">
              <div dir="ltr">
                <div>
                  <div>And here is some of the "extensions.conf" file:</div>
                  <div><br>
                  </div>
                  <div>
                    <blockquote class="gmail_quote" style="margin:0px
                      0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span
                        class="">[incoming]</span><br>
                      <span class="">; Get the DID number from the TO
                        header.</span><br>
                      <span class="">exten =>
                        s,1,Set(thedid="${SIP_HEADER(TO)}")<br>
                      </span><span class="">exten =>
                        s,2,Set(pseudodid=${SIP_HEADER(To)})<br>
                      </span><span class="">exten =>
                        s,3,Set(pseudodid=${CUT(pseudodid,@,1)})<br>
                      </span><span class="">exten =>
                        s,4,Set(pseudodid=${CUT(pseudodid,:,2)})</span></blockquote>
                    <blockquote class="gmail_quote" style="margin:0px
                      0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
                      <span class="">; Direct the DID accordingly.</span><br>
                      <span class="">exten =>
                        s,5,GotoIf($["${pseudodid}" =
                        "081"]?internal,33,1:6)<br>
                      </span><span class="">exten =>
                        s,6,GotoIf($["${pseudodid}" =
                        "082"]?internal,88,1:7) <br>
                      </span><span class="">exten =>
                        s,7,GotoIf($["${pseudodid}" =
                        "083"]?internal,36,1:8)<br>
                      </span><span class="">exten =>
                        s,8,GotoIf($["${pseudodid}" =
                        "084"]?internal,36,1:9)<br>
                      </span><span class="">exten =>
                        s,9,GotoIf($["${pseudodid}" =
                        "085"]?internal,36,1:10)<br>
                      </span><span class="">exten =>
                        s,10,GotoIf($["${pseudodid}" =
                        "086"]?internal,89,1:11)<br>
                      </span><span class="">exten =>
                        s,11,GotoIf($["${pseudodid}" =
                        "087"]?internal,36,1:12)<br>
                      </span><span class="">exten =>
                        s,12,GotoIf($["${pseudodid}" =
                        "088"]?internal,13,1:13)</span></blockquote>
                    <p class=""><span class=""></span></p>
                    <p class=""><span class=""></span></p>
                    <p class=""><span class=""></span></p>
                    <p class=""><span class=""></span></p>
                    <p class=""><span class=""></span></p>
                    <p class=""><span class=""></span></p>
                  </div>
                  <div><br>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    Since your objective is to have the receptionist identify the
    company she should be answering to then might I suggest a simple
    workaround to your problem.  Since right here you are already
    sending the call to the expected internal context and extension, you
    could simply alter the Caller Name and put in the Company Name so
    she could see it on the screen.  Something like:<br>
    <br>
    [internal] <br>
    exten => 33,1,Set(CALLERID(name)=Company1:${CALLERID})<br>
    ...<br>
    exten => 88,1,Set(CALLERID(name)=Company2:${CALLERID})<br>
    ...<br>
    exten => 36,1,Set(CALLERID(name)=Company3:${CALLERID})<br>
    ...<br>
    etc...<br>
    <br>
    That will display the Company Name you want to see followed by the
    caller ID #<br>
    <blockquote
cite="mid:CALm+qqBdi_RBhKtBW=Q40UT9J7DSF86fbgu=JRnxao4hfUw9Hw@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div>
            <div class="gmail_signature">
              <div dir="ltr">
                <div>
                  <div><br>
                  </div>
                  <div dir="ltr">-Andrew Galdes</div>
                </div>
                <div dir="ltr"><br>
                </div>
              </div>
            </div>
          </div>
          <br>
          <div class="gmail_quote">On Thu, Apr 2, 2015 at 3:46 PM,
            Dmitriy Serov <span dir="ltr"><<a moz-do-not-send="true"
                href="mailto:serov.d.p@gmail.com" target="_blank">serov.d.p@gmail.com</a>></span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
              <div bgcolor="#FFFFFF" text="#000000">
                <div><br>
                  This is one of the chronic problems. Try this option
                  in sip.conf:<span
style="color:rgb(34,34,34);font-family:Arial,sans-serif;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:18px;text-align:start;text-indent:0px;text-transform:none;white-space:pre-wrap;word-spacing:0px;float:none;display:inline!important;background-color:rgb(253,253,253)"></span><br>
                  match_auth_username=yes<br>
                  <br>
                  <span
style="color:rgb(34,34,34);font-family:Arial,sans-serif;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:18px;text-align:start;text-indent:0px;text-transform:none;white-space:pre-wrap;word-spacing:0px;background-color:rgb(253,253,253)">Carefully
                    read the description, it is better to test in "after
                    hours".</span><span
style="color:rgb(34,34,34);font-family:Arial,sans-serif;font-size:14px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:18px;text-align:start;text-indent:0px;text-transform:none;white-space:pre-wrap;word-spacing:0px;float:none;display:inline!important;background-color:rgb(253,253,253)"></span><br>
                  <br>
                  02.04.2015 2:50, Andrew Galdes пишет:<br>
                </div>
                <blockquote type="cite">
                  <div dir="ltr">Hello all,
                    <div><br>
                    </div>
                    <div>I have an Asterisk server (Asterisk 10.12.4)
                      with multiple sip accounts with the same service
                      provides. We have 8 phone numbers in total. </div>
                    <div><br>
                    </div>
                    <div>Incoming calls from the public are all
                      correctly directed to appropriate office handsets.
                      However, the display on the reception phone (the
                      only one i care about) is always showing the same
                      "SIP/Account1_0843214321" rather than the account
                      representing the number dialed. </div>
                    <div><br>
                    </div>
                    <div>For-instance, if Sam on her mobile calls "<b>0811111111</b>",

                      Asterisk will show a log entry like the following:</div>
                    <div>
                      <p> </p>
                      <p><span>-- Executing [s@incoming:1] </span><span>Set</span><span>("</span><span>SIP/<b>Account1_0822222222</b></span><span>",
                          "</span><span>thedid=""NodePhone"<sip:<b>0811111111</b>@<a
                            moz-do-not-send="true"
                            href="http://sip.internode.on.net"
                            target="_blank">sip.internode.on.net</a>>"</span><span>")
                          in new stack</span></p>
                    </div>
                    <div>But "Account1_<b>0822222222</b>" (as the name
                      suggests) has a phone number of "<b>0822222222</b>"
                      and not "<b>0811111111</b>". </div>
                    <div><br>
                    </div>
                    <div>So Sam's call will come through and be routed
                      to the correct handset as the business needs, but
                      it seems that all incoming calls are being labeled
                      as though coming in on a different account. The
                      effective problem is that the calledID is now
                      wrong. </div>
                    <div><br>
                    </div>
                    <div>
                      <div>I'm after some general advice on how to
                        handle the problem. </div>
                    </div>
                    <div><br>
                      Ta,</div>
                    <div><br>
                    </div>
                    <div><br clear="all">
                      <div>
                        <div>
                          <div dir="ltr">
                            <div>
                              <div dir="ltr">-Andrew</div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                  <br>
                  <fieldset></fieldset>
                  <br>
                </blockquote>
                <br>
              </div>
              <br>
              --<br>
_____________________________________________________________________<br>
              -- Bandwidth and Colocation Provided by <a
                moz-do-not-send="true" href="http://www.api-digital.com"
                target="_blank">http://www.api-digital.com</a> --<br>
              New to Asterisk? Join us for a live introductory webinar
              every Thurs:<br>
                             <a moz-do-not-send="true"
                href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
              <br>
              asterisk-users mailing list<br>
              To UNSUBSCRIBE or update options visit:<br>
                 <a moz-do-not-send="true"
                href="http://lists.digium.com/mailman/listinfo/asterisk-users"
                target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
            </blockquote>
          </div>
          <br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Technical Support
<a class="moz-txt-link-freetext" href="http://www.cellroute.net">http://www.cellroute.net</a></pre>
  </body>
</html>