Re: Send SMS with number of sender

From: Peter Foot [MVP] (feedback_at_no-spam.inthehand.com)
Date: 10/05/04


Date: Tue, 5 Oct 2004 10:09:47 +0100

By default the message should be sent with the settings defined by your
operator, therefore unless you change the settings on the phone your message
should be sent with your caller id. I'm not sure why the example below
places the result of the call to SmsGetPhoneNumber into the SMSC field -
this is for the Short Message Service Centre and should be left null to use
the default specified by your operator.

Have you tried the OpenNETCF.Phone.Sms functionality. All of the interop is
ready-wrapped for you - you could compare the sources to see how it is done
differently:-
http://www.opennetcf.org/sourcebrowse/view.aspx?f=d:/sites/OpenNETCF/InetPub/wwwroot/Source/OpenNETCF.Phone/Sms/Sms.cs

Peter

-- 
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org
Do have an opinion on the effectiveness of Microsoft Windows Mobile and
Embedded newsgroups?  Let us know!
https://www.windowsembeddedeval.com/community/newsgroups
"Uwe Gebhardt" <uwe.gebhardt@freenet.de> wrote in message 
news:534a6e6e.0410050018.4a13b59d@posting.google.com...
> Hello *,
>
> I created a class, which allows me to send a SMS.
> I used the sendSMS example from Microsoft
> (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetcomp/html/netcfSendSMS.asp)
>
> Okay, it works fine, I can send a SMS, but only without
> my own number. The receiver gets an anonymous message.
> I already tried to change some options in the code, but
> the SMS is still missing the number of the sender.
>
> My code:
>
> unsafe public bool sendSMS(string sPhoneNumber, string sMessage)
> {
>   System.IntPtr hSms = IntPtr.Zero;
>   IntPtr res = SmsOpen(SMS_MSGTYPE_TEXT, (IntPtr)SMS_MODE_SEND, ref
> hSms,
> IntPtr.Zero);
>   if (res != IntPtr.Zero)
>      return false;
>   Byte[] bDest = new Byte[516];
>   Byte[] bDest2 = new Byte[516];
>
>   fixed (byte* pAddr = bDest)
>   {
>     fixed (byte* pAddr2 = bDest2)
>     {
> byte *pCurrent = pAddr;
> IntPtr myNumb = SmsGetPhoneNumber((IntPtr)pAddr2);
>
> Marshal.WriteInt32((IntPtr)pCurrent, (int)AddressType.Unknown);
> pCurrent +=4;
> foreach (byte b in Encoding.Unicode.GetBytes(sPhoneNumber))
> {
>   Marshal.WriteByte((IntPtr)pCurrent, b);
>   pCurrent++;
> }
>
> Byte[] ProvData = new Byte[12];
> byte[] bMessage = Encoding.Unicode.GetBytes(sMessage);
> int nMsgSize = bMessage.Length;
>
> res = SmsSendMessage(hSms, myNumb, (IntPtr)pAddr, IntPtr.Zero,
> bMessage, (IntPtr)nMsgSize, ProvData, (IntPtr)ProvData.Length,
> SMS_DATA_ENCODING.SMSDE_GSM, (IntPtr)SMS_OPTION_DELIVERY_NONE,
> IntPtr.Zero);
> if (res != IntPtr.Zero)
>    return false;
>
> SmsClose(hSms);
> return true;
>      }
>   }
> }
>
> Any ideas, what I'm doing wrong? 


Relevant Pages

  • Re: WEB PAGE NOT SIZED TO MONITOR
    ... Some web pages are coded to display only for 800x600 res - like most of the news sites. ... settings, right click an empty spot on your desktop, choose Properties...Settings tab. ... I'll bet your monitor is set to something higher than 800x600, ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Desparetly seeking tech. info
    ... policy in Microsoft Server 2003" that if you restore a GPO ... >SMS 2003 does not change your domain security. ... We don't modify domain security. ... >> I am troubleshooting some settings in The default domain ...
    (microsoft.public.sms.setup)
  • Re: Creating new setting in userSettings section of app.config fi
    ... Settings.Default.Add(res); ... public class FormData // public is required for deserialization ... [DataMember] ... /// Factory method to create form settings. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Desperate seeking some tech. information
    ... policy in Microsoft Server 2003" that if you restore a GPO ... >SMS does not make any changes to domain group policy. ... >server you will be prompted before any rights are granted. ... >> I am troubleshooting some settings in The default domain ...
    (microsoft.public.sms.admin)
  • Re: Fresh software updates
    ... available to our users however due to caching issues. ... advertisement settings and the default HINV settings which are each set at ... Please see chapter 6 in the SMS 2003 Operations guide for detailed ... SUS has the updates just fine, ...
    (microsoft.public.sms.admin)

Quantcast