dect
/
asterisk
Archived
13
0
Fork 0

Add an 'sms' option to mobile.conf to manually enable or disable SMS support.

(closes issue #15071)
Reported by: ughnz
Patches:
      optional-sms1.diff uploaded by mnicholson (license 96)
Tested by: ughnz, mnicholson


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@209993 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
mnicholson 2009-08-03 14:01:39 +00:00
parent e93e5da4a7
commit 572b8c9155
2 changed files with 14 additions and 3 deletions

View File

@ -3082,9 +3082,11 @@ static int handle_response_ok(struct mbl_pvt *pvt, char *buf)
ast_debug(1, "[%s] volume level synchronization successful\n", pvt->id);
/* set the SMS operating mode to text mode */
if (hfp_send_cmgf(pvt->hfp, 1) || msg_queue_push(pvt, AT_OK, AT_CMGF)) {
ast_debug(1, "[%s] error setting CMGF\n", pvt->id);
goto e_return;
if (pvt->has_sms) {
if (hfp_send_cmgf(pvt->hfp, 1) || msg_queue_push(pvt, AT_OK, AT_CMGF)) {
ast_debug(1, "[%s] error setting CMGF\n", pvt->id);
goto e_return;
}
}
break;
case AT_CMGF:
@ -3192,10 +3194,12 @@ static int handle_response_error(struct mbl_pvt *pvt, char *buf)
}
break;
case AT_CMGF:
pvt->has_sms = 0;
ast_debug(1, "[%s] error setting CMGF\n", pvt->id);
ast_debug(1, "[%s] no SMS support\n", pvt->id);
break;
case AT_CNMI:
pvt->has_sms = 0;
ast_debug(1, "[%s] error setting CNMI\n", pvt->id);
ast_debug(1, "[%s] no SMS support\n", pvt->id);
break;
@ -4157,6 +4161,7 @@ static struct mbl_pvt *mbl_load_device(struct ast_config *cfg, const char *cat)
pvt->sco_socket = -1;
pvt->monitor_thread = AST_PTHREADT_NULL;
pvt->ring_sched_id = -1;
pvt->has_sms = 1;
/* setup the smoother */
if (!(pvt->smoother = ast_smoother_new(DEVICE_FRAME_SIZE))) {
@ -4190,6 +4195,8 @@ static struct mbl_pvt *mbl_load_device(struct ast_config *cfg, const char *cat)
} else if (!strcasecmp(v->name, "group")) {
/* group is set to 0 if invalid */
pvt->group = atoi(v->value);
} else if (!strcasecmp(v->name, "sms")) {
pvt->has_sms = ast_true(v->value);
} else if (!strcasecmp(v->name, "nocallsetup")) {
pvt->no_callsetup = ast_true(v->value);
@ -4197,6 +4204,7 @@ static struct mbl_pvt *mbl_load_device(struct ast_config *cfg, const char *cat)
ast_debug(1, "Setting nocallsetup mode for device %s.\n", pvt->id);
} else if (!strcasecmp(v->name, "blackberry")) {
pvt->blackberry = ast_true(v->value);
pvt->has_sms = 0;
}
}
@ -4209,6 +4217,8 @@ static struct mbl_pvt *mbl_load_device(struct ast_config *cfg, const char *cat)
pvt->hfp->owner = pvt;
pvt->hfp->rport = pvt->rfcomm_port;
pvt->hfp->nocallsetup = pvt->no_callsetup;
} else {
pvt->has_sms = 0;
}
AST_RWLIST_WRLOCK(&devices);

View File

@ -38,6 +38,7 @@ port=4 ; the rfcomm port number (from mobile search)
context=incoming-mobile ; dialplan context for incoming calls
adapter=dlink ; adapter to use
group=1 ; this phone is in channel group 1
;sms=no ; support SMS, defaults to yes
;nocallsetup=yes ; set this only if your phone reports that it supports call progress notification, but does not do it. Motorola L6 for example.
[blackberry]