كيفية إنشاء الرسائل القصيرة OTA لتكوين Syncml

StackOverflow https://stackoverflow.com/questions/546074

  •  23-08-2019
  •  | 
  •  

سؤال

أحتاج إلى توليد وإرسال Syncml OTA SMS. لدي مزود الرسائل القصيرة التي يمكن أن ترسل الرسائل القصيرة الثنائية. لكنني عالق في OTA المواصفات، وسوف أكون سعيدا حقا إذا أشرتني إلى أي من هذه:

  1. أداة مفتوحة المصدر التي يمكن أن تولد الرسائل القصيرة OTA من بعض الخصائص المقدمة.
  2. نظرة عامة جيدة أو برنامج تعليمي حول كيفية جعل OTA SMS (WOTA SPOS يبدو غير قابلة للقراءة على الإطلاق)

شكرا مقدما!

هل كانت مفيدة؟

المحلول

تحتاج إلى إنتاج مستند OMA-DP XML وإرساله إلى بوابة مزود الخدمة الخاصة بك. يجب أن تتبع بدقة تنسيق الرسالة المراد تحديدها كرسالة تكوين عن طريق الهاتف. اتصل أيضا بمزود الخدمة الخاص بك واسألهم عما إذا كان بإمكانهم تحويل إرسال XML إلى الرسائل القصيرة على الطاير. سيحتاجون إلى تشفير 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>

إليك الوظيفة في C # لإنتاج مستند XML المذكور أعلاه.

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 أيضا!

شكرا.

روتشيت س

نصائح أخرى

الق نظرة هنا. وبعد انها قديمة جدا ولكنني أعتقد مصدر الرمز يجب أن تظهر قليلا كيفية إنشاء وإرسال ota الرسائل القصيرة.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top