[asterisk-users] Changing callerID in a context

Andy Dixon ajd at malcol.org
Fri Aug 22 05:17:13 CDT 2008


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




More information about the asterisk-users mailing list