Hello I would like to know how can I manage to implement a table which translates an extension number into a phone number. Let see an example: If I dial an extension like 3021, Asterisk has to Dial an agent (our employees) located at San Francisco using the following telephone number: 415 541 XXXX. If it does not work we can also use his/her mobile number. We need to manage more than 180 agents nationwide so I would like to use a table or data base to translate a large number of agent's telephones. The table looks like this: EXT PHONE1 PHONE2 PHONE3 3021 4155XXXX 415YYYYY 510XXXXX 2130 415ZZZZZ 510LLLLL 3060 510XXXXX XXXXXXX nnnn . . xxxx XXXXXXX XXXXXXX Thanks in advance for your help. Ypek _________________________________________________________________ Sadece sohbet ile yetinmeyin - eglneceye de doymak için Messenger'i tercih edin! http://messenger.msn.com/?mkt=tr&DI=3490&XAPID=2584
Ypek,> I would like to know how can I manage to implement a table which translates > an extension number into a phone number. Let see an example:There are many ways of doing this. You could map the extensions to phones in extensions.conf, via the internal database or via an external database, or via an AGI script. Example: 1) Make database entries: AGENTS/3201 = 4155551212,4251113131 AGENTS/3202 = 4251110011,8881114545,7871114545 2) Define dial plan entry: exten => _XXXX,1,Macro(dialagent,${EXTEN}) [macro-dialagent] exten => s,1,Set(DEST=${DB(AGENTS/${ARG1})}) exten => s,n,Set(N=1) exten => s,n(loop),Cut(D=DEST,\,,${N}) exten => s,n,GotoIf($["${DEST}" : ""]?done) exten => s,n,Dial(SIP/${D}@outgoingtrunk,15) exten => s,n,GotoIf($["${DIALSTATUS}" = "ANSWER"]?done) exten => s,n,Set(N=$[${N} + 1]) exten => s,n,Goto(loop) exten => s,n(done),NoOp(Dial Agent ${ARG1} at ${DEST} done) This is somewhat paraphrased from my config, but I didn't test this particular example. You certainly need to adapt it to your setup (like define how to handle outgoing calls, etc.). This should get your started. I believe CVS-HEAD is required for this, though. --Luki
Two approaches come to mind -- 1) Using DBPut/DBGet to associate a fixed amount of phone-numbers with a given extension and dial, all from extensions.conf, or 2) Using a small mySQL table and a short agi script to accomplish the same thing. The former solution has the advantage that it's rather easy to implement and won't require any additional components; the latter is more flexible and could allow maintenance of the forward numbers by, say, a website.> -----Original Message----- > From: Ipek Zivane [mailto:ipekziv@hotmail.com] > Sent: Wednesday, June 22, 2005 6:50 PM > To: asterisk-users@lists.digium.com > Subject: [Asterisk-Users] indexing tables for dialing > > > Hello > > I would like to know how can I manage to implement a table > which translates > an extension number into a phone number. Let see an example: > > If I dial an extension like 3021, Asterisk has to Dial an > agent (our > employees) located at San Francisco using the following > telephone number: > 415 541 XXXX. If it does not work we can also use his/her > mobile number. > > We need to manage more than 180 agents nationwide so I would > like to use a > table or data base to translate a large number of agent's telephones. > > The table looks like this: > > EXT PHONE1 PHONE2 PHONE3 > > 3021 4155XXXX 415YYYYY 510XXXXX > 2130 415ZZZZZ 510LLLLL > 3060 510XXXXX XXXXXXX > nnnn > . > . > xxxx XXXXXXX XXXXXXX > > Thanks in advance for your help. > > Ypek > > _________________________________________________________________ > Sadece sohbet ile yetinmeyin - eglneceye de doymak i?in > Messenger'i tercih > edin! http://messenger.msn.com/?mkt=tr&DI=3490&XAPID=2584 > > _______________________________________________ > Asterisk-Users mailing list > Asterisk-Users@lists.digium.com > http://lists.digium.com/mailman/listinfo/aster> isk-users > To > UNSUBSCRIBE or update options visit: >http://lists.digium.com/mailman/listinfo/asterisk-users