KANNEL経由で特殊文字と改行文字を送信する

KANNEL経由で特殊文字と改行文字を送信する

メッセージをどのように送信できますか?カーネルセリフと特殊文字が特徴です。たとえば、次のテキストを含む message.txt ファイルがある場合

line1 with few special characters like @ " / :
line 2 spaces words etc
line 3 "special characters like @ " / :
line 4 end

CURLを使用してbashを介してKANNELにどのように渡すことができますか?カール root@radius:/temp# 猫テストと同じです。

#!/bin/bash
MSG=`cat /temp/message.txt`
curl "http://127.0.0.1:13013/cgi-bin/sendsms?username=kannel&password=kannelpassword&to=03333333333&text=$MSG"

しかし、それは言う"curl: (3) Illegal characters found in URL"

使えましたガンマムしかし、私は(teltonika g / 10 comシリアルモデムを検出しませんが、チャンネルではモデムが正常に動作します。

上記のテキストでシリアルモデムを使用してテキストメッセージを送信する方法に関する他の提案はありますか?

ベストアンサー1

努力する--data-urlencodeそして-G

curl "http://127.0.0.1:13013/cgi-bin/sendsms?username=kannel&password=kannelpassword&to=03333333333" -G --data-urlencode text@/temp/message.txt

標準入力からデータを提供できます。

ls -l | curl "http://127.0.0.1:13013/..." -G --data-urlencode text@-

または、コマンドラインから直接指定します。

curl "http://127.0.0.1:13013/..." -G --data-urlencode text='!@#$%^&*()'

おすすめ記事