Great examples Matthew, really appreciate it. This is exactly what I've been searching for!<br><br><div><span class="gmail_quote">On 6/26/07, <b class="gmail_sendername">Matthew Brothers</b> <<a href="mailto:matthew@brothersfamily.net">
matthew@brothersfamily.net</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">> Hi,<br>><br>> I have been looking for an example of accomplishing this, but
<br>> I've been unable to locate something similar to what I'm trying<br>> to do.<br>><br>> Here's the scenario:<br>><br>> Users caller ID is set to their internal extension (200-250).<br>> This is set in
sip.conf for each user. Each user has a local DID<br>> as well (hosted through Vitelity, for example (555)111-2222). The<br>> problem is that this extension was being passed to the outside<br>> world. I currently have a SetCallerID command changing the
<br>> CallerID to our main office number, but some users want their DID<br>> sent, not the general number.<br>><br>> The problem is that if their caller ID is set to their DID, when<br>> users hit redial on their phones internally they dial out and
<br>> back in. I corrected this by putting each DID in extensions.conf<br>> under their three digit extension, but that seems a bit like a<br>> kludge obviously.<br>><br>> I'm looking for a method of sending the internal three digit
<br>> extension only when a user is dialing another user internally,<br>> otherwise it will send their DID. Is their a method to do this in<br>> the dial plan? Anyone have an example of how to accomplish this?<br>
><br>><br>> Thanks in advance.<br><br><br>Mike,<br><br>I have a similar setup (I even use Vitel) and the easiest and<br>cleanest method that I have found to accomplish this is with the<br>AstDB. You can simply create a cross-reference of DIDs and Internal
<br>extensions similar to extdid/200 => 5551112222 ... extdid/250 =><br>5551112272 in the AstDB. Then you can change your outgoing dialplan<br>to change the caller id based upon this cross reference. Example:<br><br>
<br>exten => NXXNXXXXXX,n,Set(outgoingCID=<MAINNUMBER>)<br><br>exten => NXXNXXXXXX,n,<br>GotoIf($[ ${DB_EXISTS(extdid/${CALLERID(num)})} = 0 ]?makecall)<br><br>exten => NXXNXXXXXX,n,<br>Set(outgoingCID=${DB(extdid/${CALLERID(num)})})
<br><br>exten => NXXNXXXXXX,n(makecall),Set(CALLERID(num)=${outgoingCID})<br><br>...<br><br>You could even simplify your incoming context by cross-referencing<br>in the other direction. That is didext/5551112222 => 200 ...
<br>didext/5551112272 => 250.<br><br>exten => NXXNXXXXXX,n,<br>Goto(internal-extensions,${DB(didext/${EXTEN})},1)<br><br>OR you could do something similar with LOCAL channels or with a Dial<br>command.<br><br>-Matthew
<br></blockquote></div><br>