}
/* phone manufacturer */
+ tech_pvt->requesting_device_mfg = 1;
res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CGMI");
+ tech_pvt->requesting_device_mfg = 0;
if (res) {
DEBUGA_GSMOPEN("AT+CGMI failed\n", GSMOPEN_P_LOG);
}
/* phone model */
+ tech_pvt->requesting_device_model = 1;
res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CGMM");
+ tech_pvt->requesting_device_model = 0;
if (res) {
DEBUGA_GSMOPEN("AT+CGMM failed\n", GSMOPEN_P_LOG);
}
+ /* phone firmware */
+ tech_pvt->requesting_device_firmware = 1;
+ res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CGMR");
+ tech_pvt->requesting_device_firmware = 0;
+ if (res) {
+ DEBUGA_GSMOPEN("AT+CGMR failed\n", GSMOPEN_P_LOG);
+ }
+
/* signal network registration with a +CREG unsolicited msg */
res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CREG=1");
if (res) {
}
}
- /* if we are requesting IMSI, put the line into the imei buffer if the line is not "OK" or "ERROR" */
+ /* if we are requesting IMSI, put the line into the imsi buffer if the line is not "OK" or "ERROR" */
if (tech_pvt->requesting_imsi && at_ack == -1) {
if (strlen(tech_pvt->line_array.result[i])) { /* we are reading the IMSI */
strncpy(tech_pvt->imsi, tech_pvt->line_array.result[i], sizeof(tech_pvt->imsi));
}
}
+ /* if we are requesting device manufacturer, model or firmware version,
+ * put the line into the buffer if the line is not "OK" or "ERROR" */
+ if (tech_pvt->requesting_device_mfg && at_ack == -1) {
+ if (strlen(tech_pvt->line_array.result[i])) {
+ strncpy(tech_pvt->device_mfg, tech_pvt->line_array.result[i], sizeof(tech_pvt->device_mfg));
+ }
+ }
+
+ if (tech_pvt->requesting_device_model && at_ack == -1) {
+ if (strlen(tech_pvt->line_array.result[i])) {
+ strncpy(tech_pvt->device_model, tech_pvt->line_array.result[i], sizeof(tech_pvt->device_model));
+ }
+ }
+
+ if (tech_pvt->requesting_device_firmware && at_ack == -1) {
+ if (strlen(tech_pvt->line_array.result[i])) {
+ strncpy(tech_pvt->device_firmware, tech_pvt->line_array.result[i], sizeof(tech_pvt->device_firmware));
+ }
+ }
+
/* if we are reading an sms message from memory, put the line into the sms buffer if the line is not "OK" or "ERROR" */
if (tech_pvt->reading_sms_msg > 1 && at_ack == -1) {
snprintf(value, sizeof(value) - 1, "%d", tech_pvt->running);
stream->write_function(stream, "running = %s\n", value);
stream->write_function(stream, "subscriber_number = %s\n", tech_pvt->subscriber_number);
+ stream->write_function(stream, "device_manufacturer = %s\n", tech_pvt->device_mfg);
+ stream->write_function(stream, "device_model = %s\n", tech_pvt->device_model);
+ stream->write_function(stream, "device_firmware = %s\n", tech_pvt->device_firmware);
stream->write_function(stream, "operator = %s\n", tech_pvt->operator_name);
stream->write_function(stream, "imei = %s\n", tech_pvt->imei);
stream->write_function(stream, "imsi = %s\n", tech_pvt->imsi);
snprintf(value, sizeof(value) - 1, "%d", tech_pvt->running);
stream->write_function(stream, "running = %s\n", value);
stream->write_function(stream, "subscriber_number = %s\n", tech_pvt->subscriber_number);
+ stream->write_function(stream, "device_manufacturer = %s\n", tech_pvt->device_mfg);
+ stream->write_function(stream, "device_model = %s\n", tech_pvt->device_model);
+ stream->write_function(stream, "device_firmware = %s\n", tech_pvt->device_firmware);
stream->write_function(stream, "operator = %s\n", tech_pvt->operator_name);
stream->write_function(stream, "imei = %s\n", tech_pvt->imei);
stream->write_function(stream, "imsi = %s\n", tech_pvt->imsi);
snprintf(value, sizeof(value) - 1, "%d", tech_pvt->running);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "running", value);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "subscriber_number", tech_pvt->subscriber_number);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "device_manufacturer", tech_pvt->device_mfg);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "device_model", tech_pvt->device_model);
+ switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "device_firmware", tech_pvt->device_firmware);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "operator", tech_pvt->operator_name);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "imei", tech_pvt->imei);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "imsi", tech_pvt->imsi);