Thank you for your answer.<br>
<br>
First of all: I didn't name my sip accounts the same as my extension
numbers. So I cannot just Dial SIP/${EXTEN} in my case. Also this 100
number block is mapped to extensions for our primary location, but we
will be connection other locations where extension numbers are not
mapped directly to DID's. So for those locations, this technique will
not work.<div><br></div><div>So I came up with this dialplan:</div><div><br></div><div><div>exten => _00Z.,1,NoOp(Call received from ${CALLERID(num)} context ${CONTEXT} to ${EXTEN:1})</div><div> same => n,Set(CID=${DID_BYSIP(SIP/${CALLERID(num)},${CONTEXT})})</div>
<div> same => n,GotoIf(${CID}?setCid:setDef)</div><div> same => n(setDef),Set(CALLERID(num)=31229253131)</div><div> same => n,Goto(setRoute)</div><div> same => n(setCid),Set(CALLERID(num)=${CID})</div><div>
same => n(setRoute),GotoIf($[${CALLERID(num)}=31852013900]?otconnect:voys)</div><div> same => n(otconnect),Set(OUT=999210485)</div><div> same => n,Goto(dodial)</div><div> same => n(voys),Set(OUT=143810001)</div>
<div> same => n(dodial),Dial(SIP/${EXTEN:1}@${OUT})</div><div> same => n,Hangup()</div></div><div><br></div><div>This seems to work. The only thing that worries me, is that ${CALLERID(num)} can easily be overwritten. On the other hand the configuration is in my hands, so I guess I just have to be carefull, and not mess around with callerid(num) too much.</div>
<div><br></div><div><br></div><div><br><div class="gmail_quote">On Tue, Mar 27, 2012 at 11:51 AM, A J Stiles <span dir="ltr"><<a href="mailto:asterisk_list@earthshod.co.uk">asterisk_list@earthshod.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Tuesday 27 March 2012, Roland wrote:<br>
> I am setting up my dialplan with quite some outbound numbers. We have a<br>
> block of 100 DID's, for which some of them will go direct to specific<br>
> phones. I am struggling how to solve this, so I am searching for a little<br>
> advice. These are my concerns.<br>
><br>
> I could set the DID in the sip.conf using something like:<br>
><br>
> callerid="137-Roland" <31229253137><br>
><br>
> 137 would be my extention number here.<br>
</div>> .....<br>
<div class="im">> Any suggestions would be appreciated! Am I missing any options here?<br>
<br>
</div>Assuming there is a reasonable mapping from "outside" numbers to "inside"<br>
numbers (your example shows the external number as being 31229253 followed by<br>
the internal number; note also you can do simple integer maths within a<br>
dialplan, as unlike some languages + hasn't been appropriated for string<br>
concatenation), it shouldn't be that difficult.<br>
<br>
If an internal extension wants to call an internal extension, its caller ID<br>
ought already to be set to its "inside" extension number in sip.conf. If it<br>
wants to call an external number, then it needs to set its caller ID to the<br>
appropriate inbound number. If it's as simple as adding a prefix, then you<br>
need something in your dialplan like:<br>
<br>
[management]<br>
; 3 digits is internal<br>
exten => XXX,1,Dial(SIP/${EXTEN},90)<br>
exten => XXX,2,Hangup()<br>
; 5 digits or more must be external -- ident as own DDI number<br>
exten => XXXX.,1,Set(CallerID(num)=${DDIPREFIX}${callerID(num)})<br>
exten => XXXX.,2,Dial(${POTS}/${EXTEN},90)<br>
exten => XXXX.,3,Hangup()<br>
<br>
Now, chances are, not every internal phone will want to ident as a unique<br>
external number -- perhaps you want all the phones in one office to ident as a<br>
single number, and all ring together (using something like<br>
Dial(TECH/ext&TECH/ext&TECH/ext ..... ) when called from outside. In this<br>
case, you just need to configure all these phones into their own context in<br>
your sip.conf and something like this in your dialplan:<br>
<br>
[sales-office]<br>
; 3 digits is internal<br>
exten => XXX,1,Dial(SIP/${EXTEN},90)<br>
exten => XXX,2,Hangup()<br>
; 5 digits or more must be external -- one ident for whole office<br>
exten => XXXX.,1,Set(CallerID(num)=${SALESOFFICE})<br>
exten => XXXX.,2,Dial(${POTS}/${EXTEN},90)<br>
exten => XXXX.,3,Hangup()<br>
<br>
<br>
--<br>
AJS<br>
<br>
Answers come *after* questions.<br>
<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>
</blockquote></div><br></div>