Re: [asterisk-users] Extenxions Optimization

2013-06-09 Thread Daniel Tryba
On Sun, Jun 09, 2013 at 10:30:45AM +0200, Olivier CALVANO wrote:
> We want optimize my extensions file conf on asterisk 11.4.0 :
> 
> ; Destination: Gambia Type: Fixe
> exten => _00220X.,1,Set(CDR(CodeCom)=BUS-GMB)
[5 lines]
 
> ; Destination: Libya Type: Fixe
> exten => _00218X.,1,Set(CDR(CodeCom)=BUS-LBY)
[the same 5 lines]
 
> and into my Extensions.agi, i sent the other line. Do you think's that it's
> a good idea ?

AGI is perfect for this. Create a list of destinations and relate your
variables to it. Your free to use your favorite database and your
favorite script/language to replace those 8 with 1.

There is a drawback ofcourse, there is atleast one more program to fail
at calling time.

You may be in a position where you can do the magic later based on cdrs,
that way there is only asterisk to fail during the call.

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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


[asterisk-users] Extenxions Optimization

2013-06-09 Thread Olivier CALVANO
Hi

We want optimize my extensions file conf on asterisk 11.4.0 :


We have a big quantity of extensions, all are same "design":


; Destination: Gambia Type: Fixe
exten => _00220X.,1,Set(CDR(CodeCom)=BUS-GMB)
exten => _00220X.,2,AGI(Caller-ID.agi,${IAXVAR(ACCOUNTID)})
exten => _00220X.,3,Set(CALLERID(all)=${NUMID})
exten => _00220X.,4,Set(CALLERPRES()=${CALLPRES})
exten => _00220X.,5,Dial(SIP/Trunk-Telco/${EXTEN:2},180,rt)
exten => _00220X.,6,Hangup

; Destination: Libya Type: Fixe
exten => _00218X.,1,Set(CDR(CodeCom)=BUS-LBY)
exten => _00218X.,2,AGI(Caller-ID.agi,${IAXVAR(ACCOUNTID)})
exten => _00218X.,3,Set(CALLERID(all)=${NUMID})
exten => _00218X.,4,Set(CALLERPRES()=${CALLPRES})
exten => _00218X.,5,Dial(SIP/Trunk-Telco/${EXTEN:2},180,rt)
exten => _00218X.,6,Hangup

; Destination: Tunisia Type: Fixe
exten => _00216X.,1,Set(CDR(CodeCom)=BUS-TUN)
exten => _00216X.,2,AGI(Caller-ID.agi,${IAXVAR(ACCOUNTID)})
exten => _00216X.,3,Set(CALLERID(all)=${NUMID})
exten => _00216X.,4,Set(CALLERPRES()=${CALLPRES})
exten => _00216X.,5,Dial(SIP/Trunk-Telco/${EXTEN:2},180,rt)
exten => _00216X.,6,Hangup

; Destination: Algeria Type: Fixe
exten => _00213X.,1,Set(CDR(CodeCom)=BUS-DZA)
exten => _00213X.,2,AGI(Caller-ID.agi,${IAXVAR(ACCOUNTID)})
exten => _00213X.,3,Set(CALLERID(all)=${NUMID})
exten => _00213X.,4,Set(CALLERPRES()=${CALLPRES})
exten => _00213X.,5,Dial(SIP/Trunk-Telco/${EXTEN:2},180,rt)
exten => _00213X.,6,Hangup


My .conf file is ~8 line

He have a solution for reduc this ? because a lot of line if "same"

I think's use a AGI style:

; Destination: Libya Type: Fixe
exten => _00218X.,1,AGI(Extensions.agi,${IAXVAR(ACCOUNTID)})
; Destination: Tunisia Type: Fixe
exten => _00216X.,1,AGI(Extensions.agi,${IAXVAR(ACCOUNTID)})
; Destination: Algeria Type: Fixe
exten => _00213X.,1,AGI(Extensions.agi,${IAXVAR(ACCOUNTID)})

and into my Extensions.agi, i sent the other line. Do you think's that it's
a good idea ?

Best regards
Olivier
--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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