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(0317998...@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?

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

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

Reply via email to