marcelog / PAMI

PHP Asterisk Manager Interface ( AMI ) supports synchronous command ( action )/ responses and asynchronous events using the pattern observer-listener. Supports commands with responses with multiple events. Very suitable for development of operator consoles and / or asterisk / channels / peers monitoring through SOA, etc
http://marcelog.github.com/PAMI
Apache License 2.0
401 stars 279 forks source link

how get response donglesendsms ?? #128

Closed flpmarcos closed 7 years ago

flpmarcos commented 7 years ago

I'm use your code in my system asterisk(chan_dongle) to send sms massive.

I'm use : $a = $pamiClient->send(new DongleSendSMSAction('dongle'.$i , '1234', $msg));

But how add event to monitoring response the action ?

Because sometimes the system gives as sent the message but a while later it returns me not sent because the number is incorrect, how do I get the result in that time frame? thank you

marcelog commented 7 years ago

Hello!

You are already saving the response of the action. Sending an action in PAMI is a synchronous operation, meaning that your code blocks until you get the result of that action.

On the other hand, sending an SMS is an asynchronous operation. You may even find out that the message was not delivery a few days after you sent it. So your action might return 'success' (meaning that you sent the message) and later on your delivery receipt might tell you that it couldn't be delivered.

Makes sense?

Best,

flpmarcos commented 7 years ago

Thank you for your response, very fast! I really enjoyed the library.

marcelog commented 7 years ago

Thank you, I'm glad you are enjoying it :) I will close this issue now.

Best regards,