Caller ID and Dial Conf

Hello All,

I want to define a dial rule in asterisk.

Two different types of code can work independently. How can I use both of these at the same time?

exten => s,1,noop(Entering context ${CONTEXT} defined in extensions_custom.conf)
exten => s,2,Set(foo=${RAND(1,200)})
exten => s,n,noop(choosing random CID #${foo})
exten => s,n,goto(${foo},1)


exten => _x…,1,Dial(SIP/${EXTEN:0:12},D(w${EXTEN:12:1}w${EXTEN:13:12}w${EXTEN:25}))

This appears to be a FreePBX question.

Can you please pose it in a form that doesn’t assume FreePBX macros and file inclusions.

At the moment, I don’t understand the question.

I use number truncation on Asterisk. ‘Dial’ code.
In addition, I need to change the caller id. How can I do that ?


also, the following code works successfully. All I want is to add extra numbers.

For Exp,

9989700103 …


exten => _x.,1,Answer()
exten => _x.,2,NoOp(${CALLERID(all)})
exten => _x.,3,Set(CALLERID(all)=<9989700100>)
exten => _x.,4,NoOp(${CALLERID(all)})
exten => _x.,5,Dial(SIP/${EXTEN:0:12},D(w${EXTEN:12:1}w${EXTEN:13:12}w${EXTEN:25}))

There is no need to use a macro, and macros are deprecated.

In the extension handler just put the Set(CALLERID(… line before the Dial line.

1 Like

Hi dear problem fixed. thanks.