Action after timeout in FreeSwitch - voip

By default, when we create a new IVR in FreeSwitch and the timeout expires, the call is closed. But i want to redirect the caller to a specific extension. Which XML file has this information?

after you call the application ivr in your dialplan, the next application after it would be executed on timeout. It's also executed if IVR has finished correctly. So what I usually do is that the IVR always uses transfer on valid input. Then the next application after ivr is guaranteed to be called only on failure.

Related

Telegram cli bot with pyrogram limits

I use the pyrogram library to develop the client robot, I set it up so that the robot connects to 15 phone numbers and sends messages in order with its proxies.
These 15 accounts are members in 300 joint groups! , every 15 accounts will be activated, respectively, and the text they have to send will be sent to these 300 groups.
In the form of the following process :
The first account is responsible for sending messages to the first 20 groups and the second account is responsible for sending messages to the second 20 groups, respectively ....
The question is, are pyrograms or telethons or these libraries restricted by the telegram? And the accounts get baned??
Is there a way to prevent this from happening?
Yes, you will get a flood wait if you try to send too many messages using a account.
Here is code to avoid flood wait https://docs.pyrogram.org/faq/how-to-avoid-flood-waits#how-to-avoid-flood-waits
to prevent flood wait you can add a delay for sending messages
asyncio.sleep(3)
Don't forget to import the asyncio library
Don't use time.sleep() because it is blocking, prefer to use asyncio.sleep() instead.

Is polling a folder the same as polling envelopes?

Reading the Docusign API rules and limits (https://developers.docusign.com/docs/esign-rest-api/esign101/rules-and-limits/) they state a restriction of not polling an envelope more than once every 15 minutes. They provide this API call as an example:
GET /accounts/12345/envelopes/AAA/documents/1
My script is set to look at two folders:
/accounts/12345/folders/AAA
/accounts/12345/folders/BBB
Now both these folders may have the same envelope in each. If I'm polling those two folders in my script every 15 minutes, does that violate the Docusign polling rule since each folder may contain the same envelope?
If you're trying to create an effective polling rate of 7.5 minutes by polling each folder once every 15 minutes? Yes, that's against the rules.
But your case sounds like polling every 15 minutes and, in some cases not under your control, an envelope may be polled more often than once per 15 minutes. That's fine.
But use a webhook instead, and we'll all be much happier.
See my post on using aws (free usage tier) and we have code examples too.
For your use case, investigate Recipient connect webhooks since you're not the sender.

How to run cronjobs on local files on cloudControl PaaS?

On cloudControl, I can either run a local task via a worker or I can run a cronjob.
What if I want to perform a local task on a regular basis (I don't want to call a publicly accessible website).
I see possible solutions:
According to the documentation,
"cronjobs on cloudControl are periodical calls to a URL you specify."
So calling the file locally is not possible(?). So I'd have to create a page I can call via URL. And I have to perform checks, if the client is on localhost (=the server) -- I would like to avoid this way.
I make the worker sleep() for the desired amount of time and then make it re-run.
// do some arbitrary action
Foo::doSomeAction();
// e.g. sleep 1 day
sleep(86400);
// restart worker
exit(2);
Which one is recommended?
(Or: Can I simply call a local file via cron?)
The first option is not possible, because the url request is made from a seperate webservice.
You could either use HTTP authentication in the cron task, but the worker solution is also completely valid.
Just keep in mind that the worker can get migrated to a different server (in case of software updates or hardware failure), so do SomeAction() may get executed more often than once per day from time to time.

Asterisk dynamic user agents on PSTN

I'm creating small system as prove concept.
I need to configure few 5-10 call queues that will have mix of softphones (SIP) and normal gsm mobiles (PSTN) agents that can login and logout of queue.
I'm new to asterisk and whole voip. So after some research I think it is possible but not sure how to do it.
You can make login/logout for any user using asterisk applications AddQueueMember() and RemoveQueueMember(). For example PSTN user can be added in queue in such way:
exten => s,n,AddQueueMember(100,DAHDI/g0/1234567)
Also in queues for PSTN users most possibly you need to use custom device states, to make queue know if PSTN user already in queue call. It is done by function DEVICE_STATE() and stateinterface option of AddQueueMember().

can we make an application to hang up the dialed call for x amount of second from our application iphone sdk

I want to develop an iPhone application whose main function is to hang up an outgoing phone call after X amount of seconds/minutes have passed since the call was placed, not from when the call was connected. After hanging up, the application will automatically redial to continue the phone call without any user intervention. The application will only redial in the case the same application has hanged up the call. If any of the parties hang up the call, the application will not redial.
Expected features to be developed are:
Add and update a list of phone numbers to monitor
The user must be able to type in directly a phone number or select it from the address book. The list will show the name and phone number monitored like “Roberto Ibarra: 33 5555 5555”. This list will serve as the database of phone numbers the application will identify as outgoing calls that must be hanged up and redialed automatically after X amount of minutes have passed. The application must not affect incoming calls or outgoing calls to numbers other than the ones on this list.
If possible, the application must fully integrate with the OS dialing system so that calls placed from any part of the phone will be monitored. For example, if a call is dialed with voice commands it should be monitored by this application.
Alert and hang up
The application must send a BEEP 5 seconds before hanging up, so as to both parties in the call can hear it and be aware the call will be about to end. This will not be configurable by the user, it will always happen 5 seconds before ending the monitored call. If the call is an outgoing call and the number is part of the list of numbers to monitor, the application will then hangup the call once the X amount of minutes/seconds have been reached. This beep can be a DTMF tone.
Automatically redial a monitored call that was ended by the application
The application will automatically redial the number that was being called to continue the call ONLY if the call was automatically ended by the application because the time limit was reached. If the call was ended by the user, then the call must NOT be redialed.
Copy protection mechanism
The application must have a copy protection mechanism based on the phone's IMEI. The application must ask the first time for a code and show the phone's IMEI. The code will be generated by a third party website by entering the IMEI and if correctly entered in the phone, then the application will work.
The algorithm will be based on a hash from the IMEI and some seed to be determined. The crypt function should be something like MD5 or some other function available in the OS in the majority of the phones using the OS.
You cannot do this. You have no access to calls made from the device and certainly can't hangup any in process calls. The closest you can come is asking the phone application to dial a number.

Resources