Notify a calling party(SIP client) about the call in advance

Hi all

Can Asterisk somehow notify a calling party about incoming call in advance before bridging it?
I’m sure there should be some logic to do this. I know that we can use SendText() to send some data on the channel but if you do it before bridging only a caller will receive it but if you do when the call is connected it is not what I’m looking for. Can we somehow send data to the calling party before the phone was picked up? Or at least can we make a delay for 1-2 seconds right before connecting 2 parties (I know that Wait() does not work during the call)

Thx a lot

;;;Please enter your 4 digit account number
exten => 902,1,Background(custom/call_with_acctno1)
exten => 902,n,Read(NUMBER,4,3)
;;;Thank you, your call will now be connected
exten => 902,n,Playback(custom/call_with_acctno2)
exten => 902,n,SetGlobalVar(NUMBERVAR=${NUMBER})
exten => 902,n,NoOp(AcctNo is ${NUMBER})
exten => 902,n,Dial(SIP/100|60|M(test-macro,${NUMBER}))

You can use this to get what you want to work. Instead of doing the 902,1, as backrgound, just have it capture thier callerID, or have it ask them thier name.

exten => 902,n,Dial(SIP/100|60|M(test-macro,${NUMBER}))
this line runs the test-macro before connecting you to SIP/100

[macro-test-macro]
;User account number is
;exten => s,1,Playback(custom/11)
exten => s,1,SayDigits(${ARG1})

This is the macro that it runs. It captures the ${NUMBER} variable as ${ARG1} and uses teh SayDigits cmd to tell you what they entered. It then goes ahead and bridges your call…

Let me know if this will work for you or if you need more help…

First of all big thanks for you reply.
Yes your code sure works. I also can call any agi scripts right before the connecting a call.
I made a code which allows a caller to call to an operator and when he pick up the phone some functionality applies and then if he/she press 1 then call is connected but still I dunno if there is a way to send data to SIP through Asterisk.

But can we send somehow a variable through SIP channel or sendtext through sip channel right before connecting?
I tried SendText but it always lends on the caller side but not a callee.
Maybe there is a way to send a variable through SIP channel?