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

The Future of VoIP Reselling: Trends and Opportunities

The Future of VoIP Reselling: Trends and OpportunitiesVoIP is a communication technology that allows voice communication over the internet instead of traditional phone lines. In recent years, VoIP has become increasingly popular due to its cost-effectiveness,...

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

The Future of VoIP Reselling: Trends and Opportunities

The Future of VoIP Reselling: Trends and OpportunitiesVoIP is a communication technology that allows voice communication over the internet instead of traditional phone lines. In recent years, VoIP has become increasingly popular due to its cost-effectiveness,...

read more

The Future of Contact Centers: A Look at VoIP Technology

The Future of Contact Centers: A Look at VoIP Technology The contact center industry is rapidly evolving, and new communication technologies are playing a significant role in shaping its future. One of the most transformative technologies is Voice over Internet...

read more

A Beginner’s Guide to SIP Trunking Setup and Configuration

A Beginner's Guide to SIP Trunking Setup and Configuration Introduction  SIP trunking is a modern technology that allows businesses to make and receive phone calls over the internet, instead of relying on traditional phone lines. This technology can offer numerous...

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

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

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.