International Prefix Conversion for SMS

Posted by on Sep 30, 2011 in Support Blog

Topic Keywords: , ,

There are many situations where end users submit messages using local number formats, but the upstream SMSC connection requires that the message be submitted using an international format (e.g., include a country code and possibly require TON=1 for SMPP connections).

For example, an end user in the UK might want to send an SMS message to 0777777777 using the local number format, but the upstream SMSC connection requires a country code to be specified, such as +44777777777.

An end user in the US might sometimes prefix a number with 1, and other times not.

Starting with the 2011.10.18 release of NowSMS, there are configuration settings that can be used to perform these types of phone number prefix conversions globally or only for specific SMSC connections a per SMSC basis.

To configure a global option for prefix number conversion to apply to all SMS messages, edit the SMSGW.INI file and under the [SMSGW] section add one or both of the following settings:

GlobalRecipPrefixConvert=???:???
GlobalSenderPrefixConvert=???:???

These settings provide a global option for prefix number conversion to apply to all SMS messages (for SMSC specific options search PrefixConvert in the SMSC specific section of SMSGW.INI). These settings apply to sender (source) and recipient (destination) addresses, as denoted in the settings name. Prefix conversions can be a comma delimited list, such as 00:+,0:+44 In this case, 0044777777777 is converted to +44777777777, and 0777777777 would be converted to +44777777777. This conversion is applied as messages are submitted.

To apply these conversions only for a specific SMSC connection, in the SMSC specific section of SMSGW.INI (e.g., [Modem – modem driver name] or [SMPP – server:port]) the following settings are now supported to apply number prefix conversions for inbound or outbound messages:

OutRecipPrefixConvert=???:???
OutSenderPrefixConvert=???:???
InRecipPrefixConvert=???:???
InSenderPrefixConvert=???:???

These settings provide support for prefix number conversion when submitting SMS messages to an SMSC connection, in order to deal with situations where a particular provider requires national or international number format. These settings apply to sender (source) and recipient (destination) addresses, as denoted in the settings name. Prefix conversions can be a comma delimited list, such as 00:+,0:+44 In this case, 0044777777777 is converted to +44777777777, and 0777777777 would be converted to +44777777777. For outbound messages, the conversion occurs before the message is submitted via this SMSC connection. For inbound messages, it is applied as the message is received from the SMSC connection.

In most cases, you would be applying conversions for the recipient phone number.

For example, a conversion that assumes UK local numbers being converted to international format would use one of the following examples (the first example is applied globally, the second only for a specific SMSC connection):

[SMSGW]
GlobalRecipPrefixConvert=00:+,0:+44

[SMPP – server:port]
OutRecipPrefixConvert=00:+,0:+44

With the above setting, 0044777777777 would be converted to +44777777777, and 0777777777 would be converted to +44777777777.

If the connection is an SMPP connection, the “+” is not actually included in the recipient address, but instead NowSMS uses this as a signal to indicate that the recipient TON (dest_addr_ton) value should be set to 1 to indicate an international number.

A similar conversion for USA local numbers would look like this (the first example is applied globally, the second only for a specific SMSC connection):

[SMSGW]
GlobalRecipPrefixConvert=011:+,1:+1,2:+12,3:+13,4:+14,5:+15,6:+16,7:+17,8:+18,9:+19

[SMPP – server:port]
OutRecipPrefixConvert=011:+,1:+1,2:+12,3:+13,4:+14,5:+15,6:+16,7:+17,8:+18,9:+19

With the above setting, 01144777777777 (011 being an old style prefix for an international phone number) would be converted to +44777777777.

15555551212 would be converted to +15555551212.

5555551212 would be converted to +15555551212.

 

For more complex and custom conversions of source/sender and destination/recipient addresses, it is also possible to apply dynamic conversions via accounting callbacks. Every time NowSMS routes a message, it can be configured to pass message details to an HTTP-based callback. This callback can be configured to have the ability to dynamically make changes to source and destination addresses. For more information on this capability, see Dynamic SMS Message Routing with HTTP Callbacks.

For comments and further discussion, please click here to visit the NowSMS Technical Forums (Discussion Board)...

One Response to “International Prefix Conversion for SMS”

  1. The above article discusses a prefix conversion option that is applied on a per-SMSC basis, not system wide.

    NowSMS 2011.10.18 and later now support global prefix conversion settings that can be used either instead of, or together with, the SMSC specific settings described in this article.

    Here are the details from the release notes:

    * SMS Gateway: Add a global option for prefix number conversion to apply to all SMS messages (previous solution was SMSC specific). In the [SMSGW] section of SMSGW.INI the following settings are now supported to apply number prefix conversions for submitted messages: GlobalRecipPrefixConvert and GlobalSenderPrefixConvert. These settings apply to sender (source) and recipient (destination) addresses, as denoted in the settings name. Prefix conversions can be a comma delimited list, such as 00:+,0:+44 In this case, 0044777777777 is converted to +44777777777, and 0777777777 would be converted to +44777777777. This conversion is applied as messages are submitted.