Thanks.  I will just use the asterisk database.

This brought up a new question though.

This is what I am using to dial out.  If a key for the phone exist in
the db it will assign it the did specified.  If not, just assign the
main incoming operator number.

I have a new family in the astdb named external_did.  Some entries
look like this:

external_did/2503/9195551212
external_did/2505/9195551213

[macro-dialoutpstn]
exten => s,1,Set(curextension=${CALLERID(num)})
exten => s,2,Set(dbdid="${DB(external_did/${curextension})}")
exten => s,3,NoOp(${curextension})
exten => s,4,NoOp(${dbdid})
exten => s,4,GoToIf($["${dbdid}" = ""]?5:8)
exten => s,5,Set(CALLERID(num)=9195559595)
exten => s,6,Dial(SIP/mspri/${MACRO_EXTEN:1},300)
exten => s,7,Hanup()
exten => s,8,Set(CALLERID(num)=${DB(external_did/${curextension})})
exten => s,9,NoOp(${CALLERID(num)})
exten => s,10,Dial(SIP/mspri/${MACRO_EXTEN:1},300)
exten => s,11,Hangup()

This works just fine.

Now what about my incoming calls.  My incoming calls will be sent from
the telco to asterisk as the seven digit number that was dialed.  So
if I have _X. in my context it will be processed as extension
9195551212.

So is there a way to lookup in the asterisk database a value and
return the key it belongs to?  Because I already have the phone number
in the asterisk database set to each extension.

I know I could just create a new family and add the keys there, like so

incoming_did/9195551212/2503
incoming_did/9195551213/2504

I was just looking to see if I could save myself a step.

This may be where I will need to switch to MySQL.



On 4/19/07, Alex Balashov <[EMAIL PROTECTED]> wrote:

On Thu, 19 Apr 2007, Forrest Beck said something to this effect:

> I thought of maybe adding a key for each extension to the astdb and
> have a Macro query the astdb.  Any other ideas?

   That would work, and is certainly the easiest, since you can bulk-load
the DID -> extension maps via external CLI commands with a simple script.

   You could also have Asterisk do MySQL dips for this information, if the
desire is to administer it from a web-based front-end.  Or if there is
some sort of mathematical relationship between the extension and the DID
range, the dialplan interpreter itself is capable of fairly sophisticated
mathematical extrapolations.

-- Alex

--
Alex Balashov <[EMAIL PROTECTED]>
_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users



--
***
Forrest Beck
IAXTEL: 17002871718
[EMAIL PROTECTED]
_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to