Re: [asterisk-users] Changing callerID in a context

2008-08-22 Thread Andy Dixon
On 21 Aug 2008, at 14:40, Philipp Kempgen wrote:

 Andy Dixon schrieb:

 I am trying to alter the outbound callerID for extensions within a
 context I have created.

 I wrote the following:

 exten = _9.,2,ExecIf($[$[${REALCALLERIDNUM} = 360] | $[$
 {REALCALLERIDNUM} = 670]]|Set|CALLERID(num)=581560)
 exten = _9.,3,ExecIf($[$[${REALCALLERIDNUM} = 361] | $[$
 {REALCALLERIDNUM} = 671]]|Set|CALLERID(num)=581561)
 exten = _9.,4,ExecIf($[$[${REALCALLERIDNUM} = 362] | $[$
 {REALCALLERIDNUM} = 672]]|Set|CALLERID(num)=581562)
 exten = _9.,5,ExecIf($[$[${REALCALLERIDNUM} = 363] | $[$
 {REALCALLERIDNUM} = 673]]|Set|CALLERID(num)=581563)
 exten = _9.,6,ExecIf($[$[${REALCALLERIDNUM} = 364] | $[$
 {REALCALLERIDNUM} = 674]]|Set|CALLERID(num)=581564)
 exten = _9.,7,ExecIf($[$[${REALCALLERIDNUM} = 365] | $[$
 {REALCALLERIDNUM} = 675]]|Set|CALLERID(num)=581565)
 exten = _9.,8,ExecIf($[$[${REALCALLERIDNUM} = 366] | $[$
 {REALCALLERIDNUM} = 676]]|Set|CALLERID(num)=581566)
 exten = _9.,9,ExecIf($[$[${REALCALLERIDNUM} = 367] | $[$
 {REALCALLERIDNUM} = 677]]|Set|CALLERID(num)=581567)
 exten = _9.,10,ExecIf($[$[${REALCALLERIDNUM} = 368] | $[$
 {REALCALLERIDNUM} = 678]]|Set|CALLERID(num)=581568)
 exten = _9.,11,ExecIf($[$[${REALCALLERIDNUM} = 369] | $[$
 {REALCALLERIDNUM} = 679]]|Set|CALLERID(num)=581569)
 exten = _9.,12,ExecIf($[$[${REALCALLERIDNUM} = 700] | $[$
 {REALCALLERIDNUM} = 701]]|Set|CALLERID(num)=581557)
 exten = _9.,13,ExecIf($[$[${REALCALLERIDNUM} = 100] | $[$
 {REALCALLERIDNUM} = 101]]|Set|CALLERID(num)=581500)


 This *should* change the callerID for (for example) 700 and 701 to be
 581557, and any extensions not listed above, it should leave them  
 alone.

 If I call from extension 666, I get the correct outbound number (as  
 it
 does exist), but the rules above are not being followed.

 I have tried to use Set(CALLERID(num)=581500) which works okay
 slightly further down.

 I am aiming for any numbers starting with a 9 to follow the rules
 above, and then to follow a further rule (eg if the number starts  
 901,
 or 907)

 I'm stuck.. If anyone could help, I would be eternally grateful..

 This would be much more readable in AEL.
 Or in an external script.
 But maybe all you really need is fromuser in sip.conf or similar.

Hi,

I'm not wanting the callerID to change internally - eg so extension  
700 will show as 700 internally, but as 581557 when it goes through  
our ZAP trunk, which I believe the fromuser would cause.

Sorry to sound dim, but whats AEL?

Thanks

Andy


___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2008 - September 22 - 25 Phoenix, Arizona
Register Now: http://www.astricon.net

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


Re: [asterisk-users] Changing callerID in a context

2008-08-22 Thread Doug Lytle
Andy Dixon wrote:
 On 21 Aug 2008, at 14:40, Philipp Kempgen wrote:
   
 This *should* change the callerID for (for example) 700 and 701 to be
 581557, and any extensions not listed above, it should leave them  
 alone.
   

Andy,

If you're not bound and determined to do it this way, you can use the 
MySQL addon to do a sql lookup for outbound CallerID. 

It works great.  Just before the dial out, we do a query against the 
extension, if there is a match, we set the caller-id to whatever was 
returned on the query, if there isn't a match, we use the main number.

If you'd like more information, let me know,

Doug

-- 
 
Ben Franklin quote:

Those who would give up Essential Liberty to purchase a little Temporary 
Safety, deserve neither Liberty nor Safety.


___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2008 - September 22 - 25 Phoenix, Arizona
Register Now: http://www.astricon.net

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


Re: [asterisk-users] Changing callerID in a context

2008-08-22 Thread Atis Lezdins
On Thu, Aug 21, 2008 at 3:11 PM, Andy Dixon [EMAIL PROTECTED] wrote:
 Hello,

 I am trying to alter the outbound callerID for extensions within a
 context I have created.

 I wrote the following:

 exten = _9.,2,ExecIf($[$[${REALCALLERIDNUM} = 360] | $[$
 {REALCALLERIDNUM} = 670]]|Set|CALLERID(num)=581560)
 exten = _9.,3,ExecIf($[$[${REALCALLERIDNUM} = 361] | $[$
 {REALCALLERIDNUM} = 671]]|Set|CALLERID(num)=581561)
 exten = _9.,4,ExecIf($[$[${REALCALLERIDNUM} = 362] | $[$
 {REALCALLERIDNUM} = 672]]|Set|CALLERID(num)=581562)
 exten = _9.,5,ExecIf($[$[${REALCALLERIDNUM} = 363] | $[$
 {REALCALLERIDNUM} = 673]]|Set|CALLERID(num)=581563)
 exten = _9.,6,ExecIf($[$[${REALCALLERIDNUM} = 364] | $[$
 {REALCALLERIDNUM} = 674]]|Set|CALLERID(num)=581564)
 exten = _9.,7,ExecIf($[$[${REALCALLERIDNUM} = 365] | $[$
 {REALCALLERIDNUM} = 675]]|Set|CALLERID(num)=581565)
 exten = _9.,8,ExecIf($[$[${REALCALLERIDNUM} = 366] | $[$
 {REALCALLERIDNUM} = 676]]|Set|CALLERID(num)=581566)
 exten = _9.,9,ExecIf($[$[${REALCALLERIDNUM} = 367] | $[$
 {REALCALLERIDNUM} = 677]]|Set|CALLERID(num)=581567)
 exten = _9.,10,ExecIf($[$[${REALCALLERIDNUM} = 368] | $[$
 {REALCALLERIDNUM} = 678]]|Set|CALLERID(num)=581568)
 exten = _9.,11,ExecIf($[$[${REALCALLERIDNUM} = 369] | $[$
 {REALCALLERIDNUM} = 679]]|Set|CALLERID(num)=581569)
 exten = _9.,12,ExecIf($[$[${REALCALLERIDNUM} = 700] | $[$
 {REALCALLERIDNUM} = 701]]|Set|CALLERID(num)=581557)
 exten = _9.,13,ExecIf($[$[${REALCALLERIDNUM} = 100] | $[$
 {REALCALLERIDNUM} = 101]]|Set|CALLERID(num)=581500)


 This *should* change the callerID for (for example) 700 and 701 to be
 581557, and any extensions not listed above, it should leave them alone.

 If I call from extension 666, I get the correct outbound number (as it
 does exist), but the rules above are not being followed.

 I have tried to use Set(CALLERID(num)=581500) which works okay
 slightly further down.

 I am aiming for any numbers starting with a 9 to follow the rules
 above, and then to follow a further rule (eg if the number starts 901,
 or 907)

 I'm stuck.. If anyone could help, I would be eternally grateful..

Are you sure ${REALCALLERIDNUM} is set? Alternatively (to AEL) there's
a way how to simplify all this, by using Asterisk extension patterns:

[clid-mangle]
exten = 70[01],1,Set(CALLERID(num)=581557)
exten = 70[01],2,Return()
exten = 10[01],1,Set(CALLERID(num)=581500)
exten = 10[01],2,Return()
; and so on, just better reorganize your extensions so that this can
match patterns better.

[dial-out]
exten = _9.,1,GoSub(clid-mangle,${CALLERID(num)},1)
exten = _9.,2,Dial(SIP/provider)



Regards,
Atis

-- 
Atis Lezdins,
VoIP Project Manager / Developer,
[EMAIL PROTECTED]
Skype: atis.lezdins
Cell Phone: +371 28806004
Cell Phone: +1 800 7300689
Work phone: +1 800 7502835

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2008 - September 22 - 25 Phoenix, Arizona
Register Now: http://www.astricon.net

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


Re: [asterisk-users] Changing callerID in a context

2008-08-22 Thread Kevin P. Fleming
Atis Lezdins wrote:

 [clid-mangle]
 exten = 70[01],1,Set(CALLERID(num)=581557)
 exten = 70[01],2,Return()
 exten = 10[01],1,Set(CALLERID(num)=581500)
 exten = 10[01],2,Return()
 ; and so on, just better reorganize your extensions so that this can
 match patterns better.
 
 [dial-out]
 exten = _9.,1,GoSub(clid-mangle,${CALLERID(num)},1)
 exten = _9.,2,Dial(SIP/provider)

Actually, this can be even easier (although you didn't use the actual
CLID matching style):

[dial-out]
exten = _9./70[01],1,Set(CALLERID(num)=581557)
exten = _9./10[01],1,Set(CALLERID(num)=581500)
... more of the same 'priority 1' steps
exten = _9.,2,Dial(SIP/provider)

-- 
Kevin P. Fleming
Director of Software Technologies
Digium, Inc. - The Genuine Asterisk Experience (TM)

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2008 - September 22 - 25 Phoenix, Arizona
Register Now: http://www.astricon.net

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


[asterisk-users] Changing callerID in a context

2008-08-21 Thread Andy Dixon
Hello,

I am trying to alter the outbound callerID for extensions within a  
context I have created.

I wrote the following:

exten = _9.,2,ExecIf($[$[${REALCALLERIDNUM} = 360] | $[$ 
{REALCALLERIDNUM} = 670]]|Set|CALLERID(num)=581560)
exten = _9.,3,ExecIf($[$[${REALCALLERIDNUM} = 361] | $[$ 
{REALCALLERIDNUM} = 671]]|Set|CALLERID(num)=581561)
exten = _9.,4,ExecIf($[$[${REALCALLERIDNUM} = 362] | $[$ 
{REALCALLERIDNUM} = 672]]|Set|CALLERID(num)=581562)
exten = _9.,5,ExecIf($[$[${REALCALLERIDNUM} = 363] | $[$ 
{REALCALLERIDNUM} = 673]]|Set|CALLERID(num)=581563)
exten = _9.,6,ExecIf($[$[${REALCALLERIDNUM} = 364] | $[$ 
{REALCALLERIDNUM} = 674]]|Set|CALLERID(num)=581564)
exten = _9.,7,ExecIf($[$[${REALCALLERIDNUM} = 365] | $[$ 
{REALCALLERIDNUM} = 675]]|Set|CALLERID(num)=581565)
exten = _9.,8,ExecIf($[$[${REALCALLERIDNUM} = 366] | $[$ 
{REALCALLERIDNUM} = 676]]|Set|CALLERID(num)=581566)
exten = _9.,9,ExecIf($[$[${REALCALLERIDNUM} = 367] | $[$ 
{REALCALLERIDNUM} = 677]]|Set|CALLERID(num)=581567)
exten = _9.,10,ExecIf($[$[${REALCALLERIDNUM} = 368] | $[$ 
{REALCALLERIDNUM} = 678]]|Set|CALLERID(num)=581568)
exten = _9.,11,ExecIf($[$[${REALCALLERIDNUM} = 369] | $[$ 
{REALCALLERIDNUM} = 679]]|Set|CALLERID(num)=581569)
exten = _9.,12,ExecIf($[$[${REALCALLERIDNUM} = 700] | $[$ 
{REALCALLERIDNUM} = 701]]|Set|CALLERID(num)=581557)
exten = _9.,13,ExecIf($[$[${REALCALLERIDNUM} = 100] | $[$ 
{REALCALLERIDNUM} = 101]]|Set|CALLERID(num)=581500)


This *should* change the callerID for (for example) 700 and 701 to be  
581557, and any extensions not listed above, it should leave them alone.

If I call from extension 666, I get the correct outbound number (as it  
does exist), but the rules above are not being followed.

I have tried to use Set(CALLERID(num)=581500) which works okay  
slightly further down.

I am aiming for any numbers starting with a 9 to follow the rules  
above, and then to follow a further rule (eg if the number starts 901,  
or 907)

I'm stuck.. If anyone could help, I would be eternally grateful..


Thanks!

Andy

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2008 - September 22 - 25 Phoenix, Arizona
Register Now: http://www.astricon.net

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


Re: [asterisk-users] Changing callerID in a context

2008-08-21 Thread Philipp Kempgen
Andy Dixon schrieb:

 I am trying to alter the outbound callerID for extensions within a  
 context I have created.
 
 I wrote the following:
 
 exten = _9.,2,ExecIf($[$[${REALCALLERIDNUM} = 360] | $[$ 
 {REALCALLERIDNUM} = 670]]|Set|CALLERID(num)=581560)
 exten = _9.,3,ExecIf($[$[${REALCALLERIDNUM} = 361] | $[$ 
 {REALCALLERIDNUM} = 671]]|Set|CALLERID(num)=581561)
 exten = _9.,4,ExecIf($[$[${REALCALLERIDNUM} = 362] | $[$ 
 {REALCALLERIDNUM} = 672]]|Set|CALLERID(num)=581562)
 exten = _9.,5,ExecIf($[$[${REALCALLERIDNUM} = 363] | $[$ 
 {REALCALLERIDNUM} = 673]]|Set|CALLERID(num)=581563)
 exten = _9.,6,ExecIf($[$[${REALCALLERIDNUM} = 364] | $[$ 
 {REALCALLERIDNUM} = 674]]|Set|CALLERID(num)=581564)
 exten = _9.,7,ExecIf($[$[${REALCALLERIDNUM} = 365] | $[$ 
 {REALCALLERIDNUM} = 675]]|Set|CALLERID(num)=581565)
 exten = _9.,8,ExecIf($[$[${REALCALLERIDNUM} = 366] | $[$ 
 {REALCALLERIDNUM} = 676]]|Set|CALLERID(num)=581566)
 exten = _9.,9,ExecIf($[$[${REALCALLERIDNUM} = 367] | $[$ 
 {REALCALLERIDNUM} = 677]]|Set|CALLERID(num)=581567)
 exten = _9.,10,ExecIf($[$[${REALCALLERIDNUM} = 368] | $[$ 
 {REALCALLERIDNUM} = 678]]|Set|CALLERID(num)=581568)
 exten = _9.,11,ExecIf($[$[${REALCALLERIDNUM} = 369] | $[$ 
 {REALCALLERIDNUM} = 679]]|Set|CALLERID(num)=581569)
 exten = _9.,12,ExecIf($[$[${REALCALLERIDNUM} = 700] | $[$ 
 {REALCALLERIDNUM} = 701]]|Set|CALLERID(num)=581557)
 exten = _9.,13,ExecIf($[$[${REALCALLERIDNUM} = 100] | $[$ 
 {REALCALLERIDNUM} = 101]]|Set|CALLERID(num)=581500)
 
 
 This *should* change the callerID for (for example) 700 and 701 to be  
 581557, and any extensions not listed above, it should leave them alone.
 
 If I call from extension 666, I get the correct outbound number (as it  
 does exist), but the rules above are not being followed.
 
 I have tried to use Set(CALLERID(num)=581500) which works okay  
 slightly further down.
 
 I am aiming for any numbers starting with a 9 to follow the rules  
 above, and then to follow a further rule (eg if the number starts 901,  
 or 907)
 
 I'm stuck.. If anyone could help, I would be eternally grateful..

This would be much more readable in AEL.
Or in an external script.
But maybe all you really need is fromuser in sip.conf or similar.

Grüße,
Philipp Kempgen
-- 
http://www.das-asterisk-buch.de  -  http://www.the-asterisk-book.com
Amooma GmbH - Bachstr. 126 - 56566 Neuwied  -  http://www.amooma.de
Geschäftsführer: Stefan Wintermeyer, Handelsregister: Neuwied B14998

___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2008 - September 22 - 25 Phoenix, Arizona
Register Now: http://www.astricon.net

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