[asterisk-users] Rewrite of calling number for all extensions

Magnus Benngård magnus.b at inputinterior.se
Sun Dec 20 05:14:30 CST 2009



Did found a way to do it: 

exten =>
975,1,ExecIf($[${DB_EXISTS(CFIM/0317998975)}]?Goto(${DB(CFIM/0317998975)},1)
exten => 975,2,Goto(set-caller-id,s,1)
exten => 975,3,Goto(975-${DEVICE_STATE(SIP/0317998975)},1)
exten => 975-INUSE,1,VoiceMail(0317998975 at inputinterior.se,bs) 

...... 

[set-caller-id]
;
exten =>
s,1,ExecIf($[${CALLERID(num)}=702221448]?Set(CALLERID(all)=Cecilia
Benngard))
exten => s,1,ExecIf($[${CALLERID(num)}=705886363]?Set(CALLERID(all)=Magnus
Benngard))
exten => s,2,Goto(inputinterior.se,${CALLERID(dnid)},3) 

    Hi!

I am trying to figure out how to rewrite calling number for all
extensions.
What I am trying to do is:

1) Have a "block" of rewriting rules that will apply to all calls:
 Something like...
 (???),ExecIf($[${CALLERID(num)}=702221448]?Set(CALLERID(all)=Cecilia
Benngard))
 (???),ExecIf($[${CALLERID(num)}=705886363]?Set(CALLERID(all)=Magnus
Benngard))
 ...

2) Standard dialing rules...
 971,1,Dial(SIP/0317998971)
 975,1,Dial(SIP/0317998975)
 ...

I
know hot to do it per extension...
 971,1,ExecIf($[${CALLERID(num)}=702221448]?Set(CALLERID(all)=Cecilia
Benngard)
 971,2,Dial(SIP/0317998971)

But there must be a better way to do it, or?

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20091220/27a0931e/attachment.htm 


More information about the asterisk-users mailing list