Simple SMS API in PHP

SIMPLE SMS API IN PHP

SMS API to forward SMS to an email address

DIDForSale SMS API lets you handle incoming SMS in your application. You can configure the SMS to forward to your URL. Once you set the SMS to your web URL, all the incoming messages will be forwarded to your web URL. From there your application can do further routing or take actions depending on your further requirements and configurations.

How to configure the SMS to forward to web URL?

  • Login your DIDForSale customer portal.
  • Click on Manage Products
    • SMS.
    • Select the DID number you want to forward to your web URL.
      Please note the DID number you choose should have SMS Enabled on it. 
    • Choose DID action to “Update SMS Forwarding” 
    • Click on Apply

Below are the screenshots from DIDForSale customer portal to manage SMS Service.

sms-api-configuration

Figure1. Manage SMS service on a phone number.

Once you Choose the DID number that you want to update SMS forwarding on and click Apply you will then be taken to Manage SMS Forwarding. Please See Figure 2. Manage SMS Forwarding.
On this screen you will update the URL. You can choose from one of the three available options.

  • Forward SMS to phone number
  • Forward SMS to email
  • Select HTTP URL for SMS Forwarding to your API.
  • Select the 3rd option Select HTTP URL for SMS Forwarding to your API.
    Here you will type in the SMS API URL where you want to forward the SMS.

Screenshot of Manage SMS Forwarding screen from customer portal

sms-api-forward-to-url

Figure 2. Manage SMS Forwarding

All the future incoming SMS will be forwarded to this new SMS API URL you just configured. You might be using incoming SMS for update/order from customer or may be using SMS for Authentication purpose.

SMS API example!

Here in this simple SMS API example, we will forward the SMS to email address.
When we send the request to your SMS API URL we send following parameters in JSON FORMAT:-

  • “From”,
  • “To”
  • “Text”

Syntax:

{“text”:”This is a text message to sms api”,”from”:”19499300360″,”to”:[“19495354600”]}

Here is PHP Code snippet.

This is just a simple example to demonstrate how the system works. Based on your needs you can build a system that meets your unique and comprehensive requirements. You can do anything you want with it. You can easily build a complicated SMS or Voice Application using our Developer Kit

New Posts

Understand the difference between MMS and SMS

Understand the difference between MMS and SMS

It’s important to understand what SMS & MMS are? And how they are different?  Understanding the difference between two will give you an ability to choose which messaging form is best to connect with your customers.  

read more
7 Bulk SMS Marketing Tips

7 Bulk SMS Marketing Tips

Bulk SMS marketing is extremely valuable in advancing business exercises and expanding sales volume altogether. SMS is preferred customer communication medium and is also popular businesses choice for customer interaction, notification, alerts and business campaigns.

read more
Which messaging option is right for you?

Which messaging option is right for you?

Special Intro Offer FREE First Month Which messaging option is right for you? Toll free phone number, local phone number or short code? A major question in the corporate world arises when it comes to questioning the means of contacting with the customers in a specific...

read more
CTIA Updated 2019 Messaging Principles and Best Practices

CTIA Updated 2019 Messaging Principles and Best Practices

In its latest update for Messaging Best Practices and Guidelines CTIA has laid down regulations to protect consumers and text messaging platform from fraudulent activity and other form of system abuse. By building up clear parameters and rules, these Principles and Best Practices urge Message Senders to keep up Customer trust, confidence, and certainty.

read more

Learn more about our Products

SIP TRUNKING

PHONE NUMBERS

Visit SIP Trunking Pricing to see which plan suits your business!

With so many options to pick from it can often be hard to decide what’s best.
Our plans have been packaged together to give you optimum output.

Our SIP Trunks are Compatible with wide range of PBX & Platforms.

 

Configure GrandStream SIP Trunk.

CONFIGURE GRANDSTREAM SIP TRUNK.

Configure Grand Stream 502 SIP Trunk with DIDFOrSale SIP Trunking Service. Before you start configuring the Device, lets create a SIP Account at DIDForSale for this device to register.

Creating a SIP Account in your DIDForSale Account.

Log in your account. Click on Manage End Points, Click on SIP Accounts. Click on Add SIP Account.

SIP Acocunt Creation

Create a Free SIP Account with DIDForSale SIP Trunking

 

NOTE: Don’t try this username and password, this SIP account is only for demo purpose and is already deleted when you are reading this document.

Click on Add. You will receive an email for the confirmation. Click on the link to confirm the activation of this SIP Account.

In the Manage DID, Select the DID you want to configure for this SIP Account.

Select Config_2. Registered as Trunk.

Select the account 1001898463 (Remember This is the account we created to register Grand Stream 502)

Configuring Grand Stream 502.

Connect the GS 502 with network cable and power and phone.

GS 502 Connections

Connecting Cables with GS 502

 From your Phone, dial

*** 02

This will give you the IP Address. I get the IP 192.168.0.203

By Default WAN access is disabled. To enable the WAN access,
From your Phone Dial

***
12 (Press 9 to enable and disable wan access)
If Disabled press 9/

Reboot the Device.

Here is complete list of Grand Stream 502 Menu options. (Page 17)

http://www.grandstream.com/sites/default/files/Resources/ht502_usermanual_english.pdf

Open the browser and Enter the IP.

GS 502 Login Screen

GS 502 Login, Default password is Admin

 Default Admin password is Admin. In this example we are configuring FXS Port 1. Enter the Domain, username and password.

FSX1 with DFS Sip Trunkin

Configure FXS1 with SIP Trunking

 Click on Update.

Now you should be able to receive and make calls from this account

New Posts

Understand the difference between MMS and SMS

Understand the difference between MMS and SMS

It’s important to understand what SMS & MMS are? And how they are different?  Understanding the difference between two will give you an ability to choose which messaging form is best to connect with your customers.  

read more
7 Bulk SMS Marketing Tips

7 Bulk SMS Marketing Tips

Bulk SMS marketing is extremely valuable in advancing business exercises and expanding sales volume altogether. SMS is preferred customer communication medium and is also popular businesses choice for customer interaction, notification, alerts and business campaigns.

read more
Which messaging option is right for you?

Which messaging option is right for you?

Special Intro Offer FREE First Month Which messaging option is right for you? Toll free phone number, local phone number or short code? A major question in the corporate world arises when it comes to questioning the means of contacting with the customers in a specific...

read more
CTIA Updated 2019 Messaging Principles and Best Practices

CTIA Updated 2019 Messaging Principles and Best Practices

In its latest update for Messaging Best Practices and Guidelines CTIA has laid down regulations to protect consumers and text messaging platform from fraudulent activity and other form of system abuse. By building up clear parameters and rules, these Principles and Best Practices urge Message Senders to keep up Customer trust, confidence, and certainty.

read more

What does Future of SIP Trunking Look like?

In its latest update for Messaging Best Practices and Guidelines CTIA has laid down regulations to protect consumers and text messaging platform from fraudulent activity and other form of system abuse. By building up clear parameters and rules, these Principles and Best Practices urge Message Senders to keep up Customer trust, confidence, and certainty.

read more

Learn more about our Products

SIP TRUNKING

PHONE NUMBERS

Visit SIP Trunking Pricing to see which plan suits your business!

With so many options to pick from it can often be hard to decide what’s best.
Our plans have been packaged together to give you optimum output.

Our SIP Trunks are Compatible with wide range of PBX & Platforms.

FreePBX SIP Trunk Configuration

FREEPBX SIP TRUNK CONFIGURATION

For creating a sip trunk between didforsale and your FreePBX system, first create a sip account from your didforsale account. For creating the sip account, log in to your didforsale dashboard, go to Interconnection > Manage SIP Accounts and then click Add New SIP Account button.  Fill the details and click add. This will create a sip account in your didforsale account and send you an email to activate. You can use this sip account to create the sip trunk between didforsale and your FreePBX system.

For adding the SIP account to your FreePBX system, log in to your FreePBX, go to Connectivity, click trunks, then click Add SIP Trunks

Inside the Outgoing Settings, add the below parameters in the PEER Details box

type=friend

secret=sip account password*

username=sip username*

qualify=no

host=sip.la1.didforsale.com*

dtmfmode=rfc2833

context=from-trunk

canreinvite=no

allow=ulaw

insecure=port,invite

fromdomain=sip.la1.didforsale.com*

Also, add the register string as shown below

username:password@sip.la1.didforsale.com*

Save and Apply Config

For making outgoing calls using this trunk, go to Outbound Routes and create a new route. Select the trunk for this route as the newly created sip trunk

* Note – Please use the username, password and domain received via email after creating SIP account.

New Posts

Why Are Businesses Switching to SIP?

Switching to SIP?Special Intro Offer FREE First MonthWhy Are Businesses Switching to SIP? You must be trying to find out the business telephony system. Your checklist should come down to selecting between two core options, SIP and PRI. Which one is best for your...

read more

Free SIPTrunks, Pay as You Go!

Pay As You GoSpecial Intro Offer FREE First MonthFree SIPTrunks, Pay as You Go!. No matter your existing PBX service, it is upgradable to receive voice calls over the internet or VoIP using a SIP trunk gateway. We provide compatibility with all leading PBX providers...

read more
How to become a VoIP Reseller?

How to become a VoIP Reseller?

How can you be one?Start RESELLING With US Step by step guide to become a VoIP Reseller. With the recent shift in how businesses are carrying their day to day business, telecom has become an integral part of any organization. Traditional landline systems are not only...

read more

Learn more about our Products

SIP TRUNKING

PHONE NUMBERS

Visit SIP Trunking Pricing to see which plan suits your business!

With so many options to pick from it can often be hard to decide what’s best.
Our plans have been packaged together to give you optimum output.

Our SIP Trunks are Compatible with wide range of PBX & Platforms.

Free Phone Conferencing

DIDForSale offer free conference call service to all registered users and active customer. Using conferencing is very easy. Here are simple steps.

  • Login in your account at https://www.didforsale.com/customer/index.php
  • If you dont have an account register for free. No Credit Card required. https://www.didforsale.com/customer/signup/index.php
  • Once you are logged in.
  • Click on My Conferences. Here you can see the list of active Conference. Click on Add Conference to create a new Conference bridge.
    Screen Shot 2016-03-28 at 3.24.12 PM
  • Click on Add Conference to create a new Conference. You can create a separate pin for the moderator. With a separate moderator pin people can join the conference but can not talk to each other unless moderator join the conference.Screen Shot 2016-03-28 at 3.27.10 PM
  • To invite people to join the conference. Click on Invite. Here you and select the time, enter email address of people you want to invite. You can also add a special message.
    Screen Shot 2016-03-28 at 3.31.45 PM

Free Conferencing is a courtesy service to DIDForSale customers.

 

 

 

Changing Default SIP Port in Asterisk

*Try Risk Free for first month and know the DIDforSale SIP Trunking difference*

Best asterisk sip provider

Some of our key SIP Trunking features:-

Special Intro Offer

FREE First Month

Scale as per your need
Flexible Pricing options to choose
 Reliable service & support
 Easy account management
 Multiple compatible platforms

Largest Phone Number inventory
SMS/MMS enabled Phone Numbers
 Number Portability
 Easy Integration
 30-day money back guarantee

Changing Default SIP Port in Asterisk

Asterisk by default use 5060 as its SIP signaling port. It is a good idea to change the default SIP port as most of the SIP vulnerable attacks occurs on it’s default port 5060.

To change the SIP port, open /etc/asterisk/sip.conf in your favorite text editor, look for the entry bindport and change the value of it to your new port number. If you didn’t find the bindport entry in your sip.conf file, add the below line under the [general] section inside sip.conf

bindport=portnumber

i.e., if you want to change the port number to 5080, add the line as

bindport = 5080

Reload your asterisk configuration to make the changes active. Use the below command to check if the changes are active and SIP listens on the new port number

netstat -ntulp | grep portnumber

example : netstat -ntulp | grep 5080

If you see an output for the above command, then the changes are active and SIP now listens on new port number.

Why to manage a phone system

when you can get for free.

New Posts

Benefits of Using Bulk SMS Service

Special Intro Offer FREE First MonthBenefits of Using Bulk SMS ServiceYou want to get the word out on your exciting new offers? How do you achieve that with certainty? You need an assurance that your customers would follow up with you. Working it up with a bulk SMS...

read more

Why Are Businesses Switching to SIP?

Switching to SIP?Special Intro Offer FREE First MonthWhy Are Businesses Switching to SIP? You must be trying to find out the business telephony system. Your checklist should come down to selecting between two core options, SIP and PRI. Which one is best for your...

read more

Learn more about our Products

SIP TRUNKING

PHONE NUMBERS

Visit SIP Trunking Pricing to see which plan best suits your business!

With so many options to pick from it can often be hard to decide what’s best.
Our plans have been packaged together to give you optimum output.

Our SIP Trunks are Compatible with wide range of PBX & Platforms.