Do something after person picks up phone?

exten => 900,1,Read(NUMBER,4,3)
exten => 900,n,Dial(SIP/100,30,rt)
exten => 900,n,SayNumber(${NUMBER})

what this does, is if you dial 900 it will wait for you to enter a 4 digit number. If i did not have the DIAL line in it, it would then procede to say the number.
But I want it to dial SIP/100, once they answer it I want it to SayNumber.

What would even be better is to call SIP/100, then SayNumber, then connect the call with whoever dialed 900…

thanks for any help i have been reading on how to do this for 1hr 30min with no progress really…

Check out the M option of the dial command on voip-info - it’s what you want to do.

Yea I did, i messed with a little but didnt want to put too much time in it in case thier was a better solution.

Ill go ahead and research it tonite and see if I can get it to work.
Ill post my findings.

Thanks

Ok, if I dial 902, and i type in 1212, it should store that in variable ‘Number’.
Then it will proceed to Dial Sip/100, and on connection it goes to macro-test-macro passing NUMBER as ARG1.
It then tells the person who picked up the call ‘ZERO’

Im not sure why its not telling them 1212 instead.
Thanks

[LTS-DEMO]
exten => 902,1,Read(NUMBER,,4,3)
exten => 902,n,Dial(SIP/100|60|M(test-macro,NUMBER))

[macro-test-macro]
exten => s,1,SayNumber(${ARG1})

Here is what goes on at the CLI

-- Executing [902@internal:1] Read("SIP/101-b6511d88", "NUMBER||4|3") in new stack -- Accepting a maximum of 4 digits. -- User entered '1111' -- Executing [902@internal:2] Dial("SIP/101-b6511d88", "SIP/100|60|M(test-macro|NUMBER)") in new stack -- Called 100 -- SIP/100-081b89a8 is ringing -- SIP/100-081b89a8 answered SIP/101-b6511d88 -- Executing [s@macro-test-macro:1] SayNumber("SIP/100-081b89a8", "NUMBER") in new stack -- <SIP/100-081b89a8> Playing 'digits/0' (language 'en') -- Packet2Packet bridging SIP/101-b6511d88 and SIP/100-081b89a8

i got it!!

[LTS-DEMO]
exten => 902,1,Read(NUMBER,4,3)
exten => 902,n,Dial(SIP/100|60|M(test-macro,${NUMBER}))

[macro-test-macro]
exten => s,1,SayNumber(${ARG1})

I didnt have the ${} around NUMBER. Im surprised it still said 0 tho, thats why I did not think about that…sweet

Here is my finsished code. I was actually wanting for when someone to call in, it would ask them for thier account number, they would enter it, it would tell them thank you. It would then call me and tell me what thier account number is and connect the call.
After you hear thier account number you could accept or deny the call if you want, thier was some information in here to do that:
voip-info.org/wiki/index.php … +cmd+Macro

This could be modified very easily to ask thier name and present that to you. If anyone wants that I dont mind modifying it to work.

[code][LTS-DEMO]
;Please enter your 4 digit account number
exten => 902,1,Playback(custom/9)
exten => 902,n,Read(NUMBER,4,3)
;Thank you, your call will now be connected
exten => 902,n,Playback(custom/10)
exten => 902,n,Dial(SIP/100|60|M(test-macro,${NUMBER}))

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

lemens-ts.com