<div dir="ltr"><div>Solved it, kinda. It's not cute. I'm sure this is the way NOT to do it but it does work. For prosperity, the SIP service is through Internode. </div><div><br></div><div>Here is my "extensions.conf" file:<br><br>exten => s,1,Set(thedid="${SIP_HEADER(TO)}"); ignore this one<br>exten => s,2,Set(pseudodid=${SIP_HEADER(To)})<br>exten => s,3,Set(pseudodid=${CUT(pseudodid,@,1)})<br>exten => s,4,Set(pseudodid=${CUT(pseudodid,:,2)})<br><br>exten => s,5,Set(callersname=${IF($[ ${pseudodid} = 081...]?Company1:${callersname})})<br>exten => s,6,Set(callersname=${IF($[ ${pseudodid} = 082...]?Company2:${callersname})})<br>exten => s,7,Set(callersname=${IF($[ ${pseudodid} = 083...]?Company3:${callersname})})<br>exten => s,8,Set(callersname=${IF($[ ${pseudodid} = 084...]?Company4:${callersname})})<br>exten => s,9,Set(callersname=${IF($[ ${pseudodid} = 085...]?Company5:${callersname})})<br>exten => s,10,Set(callersname=${IF($[ ${pseudodid} = 086...]?Company6:${callersname})})<br>exten => s,11,Set(callersname=${IF($[ ${pseudodid} = 087...]?Company7:${callersname})})<br>exten => s,12,Set(callersname=${IF($[ ${pseudodid} = 088...]?Company8:${callersname})})<br><br></div><div>exten => s,13,GotoIf($["${callersname}" = "Company1"]?internal,36,1:14); to reception<br>exten => s,14,GotoIf($["${callersname}" = "Company2"]?internal,88,1:15); to department1<br>exten => s,15,GotoIf($["${callersname}" = "Company3"]?internal,36,1:16); to reception<br>exten => s,16,GotoIf($["${callersname}" = "Company4"]?internal,36,1:17); to reception<br>exten => s,17,GotoIf($["${callersname}" = "Company5"]?internal,36,1:18); to reception<br>exten => s,18,GotoIf($["${callersname}" = "Company6"]?internal,89,1:19); to department2<br>exten => s,19,GotoIf($["${callersname}" = "Company7"]?internal,36,1:20); to reception<br>exten => s,20,GotoIf($["${callersname}" = "Company8"]?internal,13,1:21); to department3<br><br>And later in same 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="">; Phone 36 reception</span><span class=""><br></span><span class=""><b>exten => 36,1,Set(CALLERID(name)=${callersname})</b><br></span><span class="">exten => 36,n,Dial(SIP/36,20)<br></span><span class="">exten => 36,n,VoiceMail(36,u)<br></span><span class="">exten => 36,n,Hangup</span></blockquote>





<div> </div><div>Ta,</div><div><br></div>






</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr">-Andrew Galdes<br>Managing Director<div><br></div><div>RHCE, LPI, CCENT<br><br><div>AGIX Linux<br><br>Ph: 08 7324 4429<br>Mb: 0422 927 598<br><br>Find us: <a href="http://www.agix.com.au" target="_blank">Website</a> | <a href="http://au.linkedin.com/in/andrewgaldes" target="_blank">LinkedIn</a> | <a href="http://agix.com.au/blog" target="_blank">Blog</a> | <a href="http://www.youtube.com/user/andrewgaldes" target="_blank">YouTube</a> | <a href="http://google.com/+AndrewGaldes" target="_blank">Google+</a><div><br></div><div><img src="http://www.agix.com.au/wp-content/uploads/2014/12/agix_black_1.png"></div></div></div><div><i style="color:rgb(55,55,55);font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:15px;line-height:24.375px">Platform Architects for High Demand Web Applications.</i><br></div></div></div></div></div></div>
<br><div class="gmail_quote">On Wed, Apr 8, 2015 at 9:18 AM, Andrew Galdes <span dir="ltr"><<a href="mailto:andrew.galdes@agix.com.au" target="_blank">andrew.galdes@agix.com.au</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 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>Connected to Asterisk 10.12.4 currently running on asterisk (pid = 32267)<br></span><span>Verbosity is at least 12<br></span><span>asterisk*CLI> <br></span><span>asterisk*CLI> <br></span><span>asterisk*CLI> <br></span><span>  == Using SIP RTP CoS mark 5<br></span><span>    -- Executing [s@incoming:1] </span><span><b>Set</b></span><span>("</span><span><b>SIP/Company1-00000797</b></span><span>", "</span><span><b>thedid=""NodePhone"<<a href="mailto:sip%3ACompany2@sip.internode.on.net" target="_blank">sip:Company2@sip.internode.on.net</a>>"</b></span><span>") in new stack<br></span><span>    -- Executing [s@incoming:2] </span><span><b>Set</b></span><span>("</span><span><b>SIP/</b><b>Company1</b><b>-00000797</b></span><span>", "</span><span><b>pseudodid="NodePhone"<sip:</b><b> sip:Company2</b><b>@<a href="http://sip.internode.on.net" target="_blank">sip.internode.on.net</a>></b></span><span>") in new stack<br></span><span>    -- Executing [s@incoming:3] </span><span><b>Set</b></span><span>("</span><span><b>SIP/</b><b>Company1</b><b>-00000797</b></span><span>", "</span><span><b>pseudodid="NodePhone"<sip:</b></span><span><b> sip:Company2</b>") in new stack<br></span><span>    -- Executing [s@incoming:4] </span><span><b>Set</b></span><span>("</span><span><b>SIP/</b><b>Company1</b><b>-00000797</b></span><span>", "</span><span><b>pseudodid=</b></span><span><b> sip:Company2</b>") in new stack<br></span><span>    -- Executing [s@incoming:5] </span><span><b>GotoIf</b></span><span>("</span><span><b>SIP/</b><b>Company1</b><b>-00000797</b></span><span>", "</span><span><b>0?internal,33,1:6</b></span><span>") in new stack<br></span><span>    -- Goto (incoming,s,6)<br></span><span>    -- Executing [s@incoming:6] </span><span><b>GotoIf</b></span><span>("</span><span><b>SIP/</b><b>Company1</b><b>-00000797</b></span><span>", "</span><span><b>0?internal,88,1:7</b></span><span>") in new stack<br></span><span>    -- Goto (incoming,s,7)<br></span><span>    -- Executing [s@incoming:7] </span><span><b>GotoIf</b></span><span>("</span><span><b>SIP/</b><b>Company1</b><b>-00000797</b></span><span>", "</span><span><b>0?internal,36,1:8</b></span><span>") in new stack<br></span><span>    -- Goto (incoming,s,8)<br></span><span>    -- Executing [s@incoming:8] </span><span><b>GotoIf</b></span><span>("</span><span><b>SIP/</b><b>Company1</b><b>-00000797</b></span><span>", "</span><span><b>1?internal,36,1:9</b></span><span>") in new stack<br></span><span>    -- Goto (internal,36,1)<br></span><span>    -- Executing [36@internal:1] </span><span><b>Set</b></span><span>("</span><span><b>SIP/</b><b>Company1</b><b>-00000797</b></span><span>", "</span><span><b>CALLERID(name)=SIP/</b><b>Company1</b><b>-00000797</b></span><span>") in new stack<br></span><span>    -- Executing [36@internal:2] </span><span><b>Dial</b></span><span>("</span><span><b>SIP/</b><b>Company1</b><b>-00000797</b></span><span>", "</span><span><b>SIP/36,20</b></span><span>") in new stack<br></span><span>  == Using SIP RTP CoS mark 5<br></span><span>    -- Called SIP/36<br></span><span>    -- SIP/36-00000798 is ringing<br></span><span>  == Spawn extension (internal, 36, 2) exited non-zero on 'SIP/Company1-00000797'<br></span><span>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>[general]<br></span><span>match_auth_username=yes<br></span><span>register=<a href="http://081...:...@sip.internode.on.net/s" target="_blank">081...:...@sip.internode.on.net/s</a><br></span><span>register=<a href="http://082...:...@sip.internode.on.net/s" target="_blank">082...:...@sip.internode.on.net/s</a><br></span><span>register=083...:...@sip.internode.on.net:/s<br></span><span>register=084...:...@sip.internode.on.net:/s<br></span><span>register=<a href="http://085...:...@sip.internode.on.net/s" target="_blank">085...:...@sip.internode.on.net/s</a><br></span><span>register=<a href="http://086...:...@sip.internode.on.net/s" target="_blank">086...:...@sip.internode.on.net/s</a><br></span><span>register=<a href="http://087...:...@sip.internode.on.net/s" target="_blank">087...:...@sip.internode.on.net/s</a><br></span><span>register=<a href="http://088...:...@sip.internode.on.net/s" target="_blank">088...:...@sip.internode.on.net/s</a></span><br><br><span>[Company1]<br></span><span>username=081...<br></span><span>fromuser=081...<br></span><span>secret=...<br></span><span>canreinvite=no<br></span><span>qualify=yes<br></span><span>context=incoming<br></span><span>type=friend<br></span><span>insecure=invite,port<br></span><span>fromdomain=<a href="http://sip.internode.on.net" target="_blank">sip.internode.on.net</a><br></span><span>host=<a href="http://sip.internode.on.net" target="_blank">sip.internode.on.net</a><br></span><span>dtmfmode=rfc2833<br></span><span>disallow=all<br></span><span>allow=alaw<br></span><span>allow=ulaw<br></span><span>allow=g729<br></span><span>bindport=5060<br></span><span>bindaddr=0.0.0.0<br></span><span>nat=yes<br></span><span>registertimeout=5<br></span><span>allowoverlap=no<br></span><span>srvlookup=no<br></span><span>ubscribecontext=from-sip<br></span><span>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>[Company2]<br></span>...<br>[Company3]<br>...<br>[Company4]<br>...</blockquote></div><div><p><span></span></p>
<p><span></span></p>
























<p><span></span></p>







</div><div class="gmail_extra"><div><div><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>[incoming]</span><br><span>; Get the DID number from the TO header.</span><br><span>exten => s,1,Set(thedid="${SIP_HEADER(TO)}")<br></span><span>exten => s,2,Set(pseudodid=${SIP_HEADER(To)})<br></span><span>exten => s,3,Set(pseudodid=${CUT(pseudodid,@,1)})<br></span><span>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>; Direct the DID accordingly.</span><br><span>exten => s,5,GotoIf($["${pseudodid}" = "081"]?internal,33,1:6)<br></span><span>exten => s,6,GotoIf($["${pseudodid}" = "082"]?internal,88,1:7) <br></span><span>exten => s,7,GotoIf($["${pseudodid}" = "083"]?internal,36,1:8)<br></span><span>exten => s,8,GotoIf($["${pseudodid}" = "084"]?internal,36,1:9)<br></span><span>exten => s,9,GotoIf($["${pseudodid}" = "085"]?internal,36,1:10)<br></span><span>exten => s,10,GotoIf($["${pseudodid}" = "086"]?internal,89,1:11)<br></span><span>exten => s,11,GotoIf($["${pseudodid}" = "087"]?internal,36,1:12)<br></span><span>exten => s,12,GotoIf($["${pseudodid}" = "088"]?internal,13,1:13)</span></blockquote>
<p><span></span></p>

<p><span></span></p>








<p><span></span></p>

<p><span></span></p>




<p><span></span></p>

<p><span></span></p>







</div><div><br></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 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 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><span class=""><font color="#888888">
  </font></span></div><span class=""><font color="#888888">

<br>--<br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a 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 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 href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></font></span></blockquote></div><br></div></div>
</blockquote></div><br></div></div>