@@ -27,6 +27,19 @@ class flood
27
27
*/
28
28
const TWILIO_XML_PAYLOAD = 'https://twimlets.com/holdmusic?Bucket=com.twilio.music.ambient ' ;
29
29
30
+ /**
31
+ * This property is use full for detecting answaring machines and possible avoiding a honey pot.
32
+ * when using this property, you'd have to have logic on your XML payload on how to handle the call
33
+ * it is not intuitive to just hang up the CALL on what it detects.
34
+ * https://www.twilio.com/docs/api/rest/answering-machine-detection
35
+ * https://support.twilio.com/hc/en-us/articles/223132567-Can-Twilio-tell-whether-a-call-was-answered-by-a-human-or-machine-
36
+ *
37
+ * By enabling this you are spending $0.0075 but could be saying alot more if your creating 15min voice mails...
38
+ *
39
+ * @var bool;
40
+ */
41
+ const TWILIO_AMD_ENABLED = false ;
42
+
30
43
/**
31
44
* Twilio Account SID
32
45
* Twiilo Auth Token
@@ -101,7 +114,7 @@ public function __construct($args)
101
114
} else {
102
115
print ("The First Argument must be a phone number to flood. (make sure you add +1 or country code to the number). \n" );
103
116
}
104
-
117
+
105
118
}
106
119
107
120
/**
@@ -118,8 +131,9 @@ private function call($fromNumber)
118
131
$ this ->numberToCall , // Call this number
119
132
$ fromNumber , // From a valid Twilio number
120
133
array (
121
- 'Record ' => true ,
122
- 'url ' => self ::TWILIO_XML_PAYLOAD
134
+ 'Record ' => true ,
135
+ 'url ' => self ::TWILIO_XML_PAYLOAD ,
136
+ 'MachineDetection ' => self ::TWILIO_AMD_ENABLED
123
137
)
124
138
);
125
139
@@ -192,4 +206,4 @@ protected function showLogo()
192
206
193
207
//include the composer autoloader
194
208
require_once ('vendor/autoload.php ' );
195
- new flood ($ argv );
209
+ new flood ($ argv );
0 commit comments