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

Add Gammu notification #18

Closed
wants to merge 32 commits into from
Closed

Add Gammu notification #18

wants to merge 32 commits into from

Conversation

matriphe
Copy link

No description provided.

@casperboone casperboone mentioned this pull request Aug 21, 2016
@themsaid
Copy link
Member

Hello @matriphe, looks like @kristiandrucker is working on a Gammu channel as well, can you please see if you can work together on a single package?

@matriphe
Copy link
Author

@themsaid sure. I'd love to. I have looked at @kristiandrucker's gammuApi and it is a complete application.

mine were made by following the skeleton of this project. not sure how to start if me and @kristiandrucker will work on the same project.

any idea?

@kristiandrucker
Copy link

Hi you could make the api have multiphone support? And also have a default phone that a user may use. That way your app will be in my api and there will only be a notifications wrapper for that api.

@matriphe
Copy link
Author

@kristiandrucker I have experience with multiphone. it's basically an entry in phones table with ID we set in config with unique IMEI (generated by modem).

To use multiple phone, just use sender($phoneId) method like this, where the phoneId is the ID in the Gammu's phones table.

public function toGammu($notifiable)
{
    return (new GammuMessage())
        ->to($toPhoneNumber)
        ->sender($phoneId)
        ->content($message);
}

@matriphe
Copy link
Author

@kristiandrucker the default phone sender can be set in the config, inside the services.php and can be set via .env file. need a artisan vendor:publish command.

@matriphe
Copy link
Author

one more thing, I will add the queue capabilities, and since Gammu has scheduled sending feature, i think we can add this functionality.

will work on that.

@themsaid
Copy link
Member

So shall we start a new channel with the code in this PR?

@matriphe
Copy link
Author

oh, I could add method to send via API to your app by providing key just like yours, if we want to avoid inserting directly to database. in my assumption, it's used on the same server (or different server) where the Gammu installed.

I found Kalkun API can be used, but I think it need to be in separated channel.

@matriphe
Copy link
Author

@themsaid I think so. but let's wait @kristiandrucker response for this.

@kristiandrucker
Copy link

Hi sorry I was helping out my friend setting up his server. My gammu api already has queueing features.

@matriphe
Copy link
Author

Oh, I see.

@kristiandrucker's GammuAPI is a Gammu service/application so, if someone want to send SMS using Gammu, they should install GammuAPI and talk via API.

I created a notification package that send SMS by inserting data directly to Gammu (the default Gammu way), assuming the application is using Gammu natively.

I think we should have a same view here. It used different approach. I prefer using Gammu natively, since I used traditional Gammu way. If someone want to use it, they don't need to install other application, just use native Gammu way.

But if we want to use a Gammu API, I think we can make another notification channel that use @kristiandrucker's Gammu APIs.

So, @themsaid what's your opinion about it? Should we use the native way, or we use API and make separate channel?

@kristiandrucker
Copy link

Btw how are you planning to use gammu on a prod server? It would be harder to setup that configuration and its better to have an api directly on the gammu server that talks to gammu and then anyone with access key can use it.

@matriphe
Copy link
Author

I use separate Gammu server, with separate database. In my app, we can add the config in the config file to point to this database server. The Gammu can be isolated from public network. If you read the readme, there's a config setup that must be set, assuming the Gammu is running and working.

Based on my experience, the problem is taking Gammu up, running, and working with the modem. Once it's run, it's easy to send SMS by inserting to outbox table. I also manage "long SMS" in Gammu.

@kristiandrucker
Copy link

@themsaid Whats your opinion on this?

@kristiandrucker
Copy link

kristiandrucker commented Aug 25, 2016

@matriphe Or we could make the Gammu api that can use mysql db or directly interact with gammu. So the users can choose what to use.

@matriphe
Copy link
Author

@kristiandrucker probably by separating the channel? GammuNative and GammuAPI?

@matriphe
Copy link
Author

@kristiandrucker if we want to make one channel, we can provide some "switch" in config file, so user can select, probably like this in config

// gammu.php
return [
    'method' => 'api', // selection: api or native    

    'api_url' => '', // URL to GammuAPI if use API

    'database' => [ // if use native/database
        'host' => '',
        'user' => '',
        'password' => '',
        'database' => '',
    ]
];

what do you think?

@matriphe
Copy link
Author

@kristiandrucker btw, does your GammuAPI support sending a long SMS text (message is more than 160 characters)?

if does, we can directly pass the long message to the API without manually chopping message into chunks before sending it

@kristiandrucker
Copy link

@matriphe it should but they will be chunked down into 160 char messages by gammu or only sliced down to 160 chars. Haven't tested it.

@kristiandrucker
Copy link

We could do that.

@matriphe
Copy link
Author

@kristiandrucker yes, in my experience, for Long SMS can be done by splitting it to chunks and then insert the first chunk to outbox and then insert the rest chunks into outbox_multipart and set the right UDH.

@themsaid
Copy link
Member

I'm not familiar with Gammu :)
I can create a new repo from the PR and give 1 or the 2 of you admin access, that way you can have better way of discussion through different PRs and issues.

@kristiandrucker
Copy link

Ok. Its up to you. Also Im planning to improve on my api.

@matriphe
Copy link
Author

@themsaid I'm willing to work with @kristiandrucker for this channel

@kristiandrucker
Copy link

@themsaid When are you ready to start?

@themsaid
Copy link
Member

themsaid commented Sep 1, 2016

Will install the repo today and add both of you as Admins :)

@kristiandrucker
Copy link

@themsaid thanks

@themsaid
Copy link
Member

themsaid commented Sep 1, 2016

Repo created and both of you were added as admins :)

@themsaid themsaid closed this Sep 1, 2016
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.

7 participants