3

SyncMLOTASMSを生成して送信する必要があります。私はバイナリSMSを送信できるSMSプロバイダーを持っています。しかし、私はOTA仕様に固執しているので、次のいずれかを指摘していただければ幸いです。

  1. 提供されているいくつかのプロパティからOTASMSを生成できるオープンソースツール。
  2. OTA SMSの作成方法に関する優れた概要またはチュートリアル(OTA仕様はまったく読めないようです)

前もって感謝します!

4

2 に答える 2

2

次の OMA-DP XML ドキュメントを生成し、サービス プロバイダー ゲートウェイに送信する必要があります。メッセージが電話機によって設定メッセージとして識別されるには、形式に厳密に従う必要があります。また、サービス プロバイダーに連絡して、XML 送信をオンザフライで SMS に変換できるかどうか尋ねてください。XML を WBXML にエンコードしてから、メッセージを PDU モードで転送する必要があります。

<?xml version="1.0" encoding="utf-8"?>
<wap-provisioningdoc>
  <characteristic type="BOOTSTRAP">
    <parm name="NAME" value="SYNCSETTINGS" />
  </characteristic>
  <characteristic type="APPLICATION">
    <parm name="APPID" value="w5" />
    <parm name="TO-NAPID" value="INTERNET" />
    <parm name="NAME" value="SYNCSETTINGS" />
    <parm name="ADDR" value="http://syncserver/sync" />
    <characteristic type="RESOURCE">
      <parm name="URI" value="pb" />
      <parm name="NAME" value="Contacts DB" />
      <parm name="AACCEPT" value="text/x-vcard" />
    </characteristic>
    <characteristic type="RESOURCE">
      <parm name="URI" value="cal" />
      <parm name="NAME" value="Calendar DB" />
      <parm name="AACCEPT" value="text/x-vcalendar" />
    </characteristic>
    <characteristic type="RESOURCE">
      <parm name="URI" value="notes" />
      <parm name="NAME" value="Notes DB" />
      <parm name="AACCEPT" value="text/plain" />
    </characteristic>
    <characteristic type="APPAUTH">
      <parm name="AAUTHNAME" value="username" />
      <parm name="AAUTHSECRET" value="password" />
    </characteristic>
  </characteristic>
</wap-provisioningdoc>

上記の XML ドキュメントを生成する C# の関数を次に示します。

public string CreateOTAXmlFile(string Username, string Password)
    {
        var ota = new XDocument(
                    new XElement("wap-provisioningdoc",
                        new XElement("characteristic", new XAttribute("type", "BOOTSTRAP"),
                            new XElement("parm", new XAttribute("name", "NAME"), new XAttribute("value", "SYNCSETTINGS"))
                                    ),
                        new XElement("characteristic", new XAttribute("type", "APPLICATION"),
                            new XElement("parm", new XAttribute("name", "APPID"), new XAttribute("value", "w5")),
                            new XElement("parm", new XAttribute("name", "TO-NAPID"), new XAttribute("value", "INTERNET")),
                            new XElement("parm", new XAttribute("name", "NAME"), new XAttribute("value", "SYNCSETTINGS")),
                            new XElement("parm", new XAttribute("name", "ADDR"), new XAttribute("value", "http://syncserver/sync")),
                            new XElement("characteristic", new XAttribute("type", "RESOURCE"),
                                new XElement("parm", new XAttribute("name", "URI"), new XAttribute("value", "pb")),
                                new XElement("parm", new XAttribute("name", "NAME"), new XAttribute("value", "Contacts DB")),
                                new XElement("parm", new XAttribute("name", "AACCEPT"), new XAttribute("value", "text/x-vcard"))
                                        ),
                            new XElement("characteristic", new XAttribute("type", "RESOURCE"),
                                new XElement("parm", new XAttribute("name", "URI"), new XAttribute("value", "cal")),
                                new XElement("parm", new XAttribute("name", "NAME"), new XAttribute("value", "Calendar DB")),
                                new XElement("parm", new XAttribute("name", "AACCEPT"), new XAttribute("value", "text/x-vcalendar"))
                                        ),
                            new XElement("characteristic", new XAttribute("type", "RESOURCE"),
                                new XElement("parm", new XAttribute("name", "URI"), new XAttribute("value", "notes")),
                                new XElement("parm", new XAttribute("name", "NAME"), new XAttribute("value", "Notes DB")),
                                new XElement("parm", new XAttribute("name", "AACCEPT"), new XAttribute("value", "text/plain"))
                                        ),
                            new XElement("characteristic", new XAttribute("type", "APPAUTH"),
                                new XElement("parm", new XAttribute("name", "AAUTHNAME"), new XAttribute("value", Username)),
                                new XElement("parm", new XAttribute("name", "AAUTHSECRET"), new XAttribute("value", Password))
                                        )
                                    )
                                )
                            );
        
        ota.Save(Server.MapPath("~/OTA/") + Username + ".xml");
        return (ota.ToString());

    }

[PS: 信じてください、これは GSM モデムでも実行できます!]

于 2009-04-13T15:42:55.003 に答える
2

こちらをご覧ください。かなり古いですが、OTA SMS の作成方法と送信方法をソース コードで少し説明する必要があると思います。

于 2009-02-13T14:30:28.083 に答える