Store CallerId in outgoing call

Hi all,

how i can store the Callerid for outgoing call when asterisk system answer??

Thanks in advance.

I’m not sure I really understand. The incoming caller ID can be found from ${CALLERID(num)}. The outgoing one will be the same unless you override it (in which case you should know what you used, or an ITSP overrode it, in which case Asterisk has no visibility of the change.

Dear david

i used ${CALLERID(num)} for Incoming call and it is working fine.

but ,i want to make outgoing call when the user answer :

i want the asterisk system store his number .

I did this code :

exten => s,1,Set(Mob_No=${CALLERID(num)})

but this not work ,it appeared to me like this ( Mob_No = )

do You want to store number that You dialing?
If you do this

exten => s,1,Set(Mob_No=${CALLERID(num)})
for outgoing to EXTERNAL line call - your ${CALLERID(num)} wil be eq Your Local_Num/ Not num that you dialed.

If You want to save your Dialed number (or callee number) you must do this

exten => s,1,Set(Mob_No=${EXTEN})

Simple Note:

“s” exten may be wrong If you not use macro. Use for example “_X.” or other regular expresion (it depends of your dialplan)

for macro use ARG vs EXTEN

[quote=“ovoshlook”]do You want to store number that You dialing?
If you do this

exten => s,1,Set(Mob_No=${CALLERID(num)})
for outgoing to EXTERNAL line call - your ${CALLERID(num)} wil be eq Your Local_Num/ Not num that you dialed.

If You want to save your Dialed number (or callee number) you must do this

exten => s,1,Set(Mob_No=${EXTEN})

Simple Note:

“s” exten may be wrong If you not use macro. Use for example “_X.” or other regular expresion (it depends of your dialplan)

for macro use ARG vs EXTEN[/quote]

i tried this: exten => s,1,Set(Mob_No=${EXTEN})
but i got “s” exten.
how i can solve that ?

As I already say:

[quote]Simple Note:

“s” exten may be wrong If you not use macro. Use for example “_X.” or other regular expresion (it depends of your dialplan)

for macro use ARG vs EXTEN[/quote]

[quote=“ovoshlook”]As I already say:

[quote]Simple Note:

“s” exten may be wrong If you not use macro. Use for example “_X.” or other regular expresion (it depends of your dialplan)

for macro use ARG vs EXTEN[/quote][/quote]

Thank you dear ,

it is solved by set the Caller id in the file .call like this:

CallerId: 4545345311 <5343>

and i received it from Extenstion.conf

exten => s,1,Set(Mob=${CallerId(name)})

which CallerId(num)=4545345311