-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathambient_sms_gateway.install
133 lines (123 loc) · 3.27 KB
/
ambient_sms_gateway.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<?php
// $Id$
/**
* @file ambient_sms_gateway.install
* Supporting ScrumyCamp schemas
*/
/**
* Implementation of hook_schema().
*/
function ambient_sms_gateway_schema() {
$schema['ambient_sms_gateway_outbox'] = array(
'description' => 'Stores information about sent sms messages',
'fields' => array(
'id' => array(
'description' => 'The record ID',
'type' => 'serial',
),
'destination' => array(
'description' => 'The destination number',
'type' => 'text',
),
'message' => array(
'description' => 'The message',
'type' => 'text',
),
'sent_at' => array(
'description' => 'The time the message was sent',
'type' => 'int',
),
'response_code' => array(
'description' => 'The time the message was sent',
'type' => 'int',
),
'response_message' => array(
'description' => 'The message',
'type' => 'text',
),
'response_message_id' => array(
'description' => 'The message id',
'type' => 'int',
),
),
'primary key' => array('id'),
);
$schema['ambient_sms_gateway_outbox_transaction'] = array(
'description' => 'Stores information about sent sms messages transactions',
'fields' => array(
'id' => array(
'description' => 'The record ID',
'type' => 'int',
),
'request' => array(
'type' => 'text',
),
'response' => array(
'type' => 'text',
),
),
);
// msisdn=27826941134&shortcode=2782007210000006&keyword=Hi&msg=Hi+dude&message_id=1
$schema['ambient_sms_gateway_inbox'] = array(
'description' => 'Stores information about received sms messages',
'fields' => array(
'id' => array(
'description' => 'The record ID',
'type' => 'serial',
),
'sender' => array(
'description' => 'The destination number',
'type' => 'text',
),
'destination' => array(
'description' => 'The destination number',
'type' => 'text',
),
'message' => array(
'description' => 'The message',
'type' => 'text',
),
'in_reply_to' => array(
'description' => 'Will be set to an outbox id if this is a reply',
'type' => 'int',
),
'received_at' => array(
'description' => 'The time the message was received',
'type' => 'int',
),
'processed_at' => array(
'description' => 'The time the message was processed',
'type' => 'int',
),
),
'primary key' => array('id'),
);
$schema['ambient_sms_gateway_inbox_transaction'] = array(
'description' => 'Stores information about received sms messages transactions',
'fields' => array(
'id' => array(
'description' => 'The record ID',
'type' => 'int',
),
'request' => array(
'type' => 'text',
),
'response' => array(
'type' => 'text',
),
),
);
return $schema;
}
/**
* Implementation of hook_install().
*/
function ambient_sms_gateway_install() {
drupal_install_schema("ambient_sms_gateway");
}
/**
* Implementation of hook_uninstall().
*/
function ambient_sms_gateway_uninstall() {
drupal_uninstall_schema("ambient_sms_gateway");
}