Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional feature for USSD #7

Open
wants to merge 23 commits into
base: master
Choose a base branch
from

Conversation

kosfango
Copy link

Hi guys,

I propose add next feature (I saw this in the Internet), example:

extension => ussd,1,DongleSendUSSD(dongle0,*100#)
or

[incoming] 
exten => ussd,1,System(/bin/echo '"${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)} ${USSD}"'|/usr/bin/mail -s "Balance ${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)}" [email protected]) 

[office] 
exten => _999,1,DongleSendUSSD(dongle0,*100#)

It required:

Add function to app.c:

static int app_send_ussd_exec (attribute_unused struct ast_channel* channel, const char* data) 
{ 
        char*   parse; 
        const char* msg; 
        int status; 
        void * msgid; 

        AST_DECLARE_APP_ARGS (args, 
                AST_APP_ARG (device); 
                AST_APP_ARG (ussd); 
        ); 

        if (ast_strlen_zero (data)) 
        { 
                return -1; 
        } 

        parse = ast_strdupa (data); 

        AST_STANDARD_APP_ARGS (args, parse); 

        if (ast_strlen_zero (args.device)) 
        { 
                ast_log (LOG_ERROR, "NULL device for ussd -- USSD will not be sent\n"); 
                return -1; 
        } 

        if (ast_strlen_zero (args.ussd)) 
        { 
                ast_log (LOG_ERROR, "NULL ussd command -- USSD will not be sent\n"); 
                return -1; 
        } 

        msg = send_ussd(args.device, args.ussd, &status, &msgid); 
        if(!status) 
                ast_log (LOG_ERROR, "[%s] %s with id %p\n", args.device, msg, msgid); 
        return !status; 
}

Next thing needed add to massive [dca]:

{ 
        "DongleSendUSSD", 
        app_send_ussd_exec, 
        "DongleSendUSSD(Device,USSD)", 
        "DongleSendUSSD(Device,USSD)\n"
        "  Device   - Id of device from dongle.conf\n"
        "  USSD     - ussd command\n"
} 

jstasiak and others added 23 commits October 29, 2012 23:35
The main changes are taken from http://uloz.to/xttriVxC/asterisk-chan-dongle-asterisk13-tested-tar-gz.
Work incoming and outgoing calls.
At initialization, try 'AT+CPMS="ME","ME","ME"', first.
If fails, switch to 'AT+CPMS="SM","SM","SM"'.

Signed-off-by: sstream <[email protected]>
Patch from wdoekes/asterisk-chan-dongle@afb8d70

Author: mio
Source: bg111#153

Not using full 3GPP version from https://code.google.com/p/
  asterisk-chan-dongle/issues/detail?id=140 because of the issues
described there.

This should simply fix that you don't get a truncated SMS because of an
@ sign.
Type of Address octet:
Bits:
7 - always 1
6,5,4 - TON - type of number (000 - unknown, 001 - international, 010 - natinal (no prefix or +), 011 - network specific number, 100 - subscriber number, 101 - alphanumeric (according to GSM TS 03.38 7-bit default alphabet), 110 - abbreviated number, 111 - reserved)
3,2,1,0 - NPI - number plan identification (0000 - unknown, 0001 - e.164/e.163, 0011 - x.121, 0100 - telex, 1000 - national, 1001 - private, 1010 - ETSI DE/PS 3 01-3, 1111 - reserved)

0xB1 - 1 011 0001
0x81 - 1 000 0001

from rusxakep/asterisk-chan-dongle@723abc4
Chan dongle support for alphabetical addresses (eg TS 03.38) (like Yandex SMS and etc.)

from rusxakep/asterisk-chan-dongle@9df7c47
# Conflicts:
#	at_command.c
#	at_response.c
…art from User Data Header. These values will be populated into channel variables REF, MSG_PARTS and MSG_PART.

Patch from this issue #141 https://code.google.com/archive/p/asterisk-chan-dongle/issues/141
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants