sms: Allow to specify the DCS for the SMS.
This commit is contained in:
parent
c464491b0b
commit
cdfcbee53b
|
@ -29,7 +29,7 @@ int gsm0411_rcv_sms(struct gsm_subscriber_connection *conn, struct msgb *msg);
|
||||||
|
|
||||||
struct gsm_sms *sms_alloc(void);
|
struct gsm_sms *sms_alloc(void);
|
||||||
void sms_free(struct gsm_sms *sms);
|
void sms_free(struct gsm_sms *sms);
|
||||||
struct gsm_sms *sms_from_text(struct gsm_subscriber *receiver, const char *text);
|
struct gsm_sms *sms_from_text(struct gsm_subscriber *receiver, int dcs, const char *text);
|
||||||
|
|
||||||
void _gsm411_sms_trans_free(struct gsm_trans *trans);
|
void _gsm411_sms_trans_free(struct gsm_trans *trans);
|
||||||
int gsm411_send_sms_subscr(struct gsm_subscriber *subscr,
|
int gsm411_send_sms_subscr(struct gsm_subscriber *subscr,
|
||||||
|
|
|
@ -117,7 +117,7 @@ void sms_free(struct gsm_sms *sms)
|
||||||
talloc_free(sms);
|
talloc_free(sms);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct gsm_sms *sms_from_text(struct gsm_subscriber *receiver, const char *text)
|
struct gsm_sms *sms_from_text(struct gsm_subscriber *receiver, int dcs, const char *text)
|
||||||
{
|
{
|
||||||
struct gsm_sms *sms = sms_alloc();
|
struct gsm_sms *sms = sms_alloc();
|
||||||
|
|
||||||
|
@ -133,7 +133,7 @@ struct gsm_sms *sms_from_text(struct gsm_subscriber *receiver, const char *text)
|
||||||
sms->status_rep_req = 0;
|
sms->status_rep_req = 0;
|
||||||
sms->ud_hdr_ind = 0;
|
sms->ud_hdr_ind = 0;
|
||||||
sms->protocol_id = 0; /* implicit */
|
sms->protocol_id = 0; /* implicit */
|
||||||
sms->data_coding_scheme = 0; /* default 7bit */
|
sms->data_coding_scheme = dcs;
|
||||||
strncpy(sms->dest_addr, receiver->extension, sizeof(sms->dest_addr)-1);
|
strncpy(sms->dest_addr, receiver->extension, sizeof(sms->dest_addr)-1);
|
||||||
/* Generate user_data */
|
/* Generate user_data */
|
||||||
sms->user_data_len = gsm_7bit_encode(sms->user_data, sms->text);
|
sms->user_data_len = gsm_7bit_encode(sms->user_data, sms->text);
|
||||||
|
|
|
@ -79,7 +79,7 @@ static int token_subscr_cb(unsigned int subsys, unsigned int signal,
|
||||||
goto unauth;
|
goto unauth;
|
||||||
}
|
}
|
||||||
|
|
||||||
sms = sms_from_text(subscr, sms_str);
|
sms = sms_from_text(subscr, 0, sms_str);
|
||||||
talloc_free(sms_str);
|
talloc_free(sms_str);
|
||||||
if (!sms) {
|
if (!sms) {
|
||||||
rc = -ENOMEM;
|
rc = -ENOMEM;
|
||||||
|
|
|
@ -146,7 +146,7 @@ static int _send_sms_str(struct gsm_subscriber *receiver, char *str,
|
||||||
{
|
{
|
||||||
struct gsm_sms *sms;
|
struct gsm_sms *sms;
|
||||||
|
|
||||||
sms = sms_from_text(receiver, str);
|
sms = sms_from_text(receiver, 0, str);
|
||||||
sms->protocol_id = tp_pid;
|
sms->protocol_id = tp_pid;
|
||||||
|
|
||||||
/* store in database for the queue */
|
/* store in database for the queue */
|
||||||
|
|
Loading…
Reference in New Issue