Difference between revisions of "Callback over Email"

From Kolmisoft Wiki
Jump to navigationJump to search
m
Line 76: Line 76:


<br><br>
<br><br>
=Email Callback Setup example=
In order Email Callback would work <u>you must</u>:
* Have a working Device in MOR
* Have a [[CLIs_(Incoming_CallerIDs)|CLI]]  set for that device with '''Use for Email Callback''' option selected
* Point your domain MX record to MOR system (required when you go to Production). During this example we will send an email from the MOR system itself so MX record setup is not needed to test this feature.
<br><br>
==Step 1. Configure MOR==
1. Create a new sip device for a user. In this example created new device has an extension 1003. We will use this extension number as '''Source''' phone number in this callback example.
2. Create a new CLI for that device
1) Go to device list: '''SETTINGS -> Users -> Devices'''
2) Click the [[File:Icon_clis.png]] button on the device you have just created.
3) Create a new CLI as described [[CLIs_(Incoming_CallerIDs)|here]], when creating be sure to select '''Use for Email Callback'''
<br><br>
==Step 2. Test Email Callback from MOR system itself==
For testing we will use Linux utility called mail. To make sure it is installed run this command:
yum -y install mailx
1. Go to MOR system's console (shell) and run this command:
mail -s callback callback@localhost 
'''P.S. when you will go to production @localhost will be @your_domain.com and email can be sent from any email client.'''
<br><br>
2. After launching command mentioned in 1. enter this text as email body:
MOR_PARAM1 1003
MOR_PARAM2 1003
MOR_PARAM3 1004
'''Explanation:'''
MOR_PARAM1 1003 - '''1003''' here is a CLI you have configured in '''Step 1.''' when configured MOR
MOR_PARAM2 1003 - source device where callback should call first
MOR_PARAM3 1004 - destination where callback should call to. Can be any valid phone number, for example 37067531060 or extension in MOR. In this example we used an extension 1003 in MOR.
<br><br>
3. Press CTRL+D to finally send an email.
If you will be asked any questions, just press enter.
4. Now you should receive the call.
<br><br>
==Troubleshooting==


= SMS Callback =
= SMS Callback =

Revision as of 08:53, 19 August 2011

Description

This function receives email and initiates callback using details in this email.

A device can have one CallerID from which it is able to initiate Callback.

Admin sets up the email box, which should be monitored for callback execution.

An SMS to initiate callback can look like:

For CallerID change: change*new_callerid

For callback inititation:

  • first_number#second_number
  • first_number - will ask destination

Then SMS gateway should send email to MOR to initiate callback in following format:

CallerID change:

  • Email subject: change
  • Email body: old callerid\nnew callerid, (\n) means new line

Callback inititation:

  • Email subject: callback
  • Email body:
MOR_PARAM1 auth_callerid
MOR_PARAM2 first_number
MOR_PARAM3 second_number


NOTE: email format should be plain, not html!



Inner mechanics

1. SMS gateway sends email to specified address (example callback@hostname.com) in the following format:

CallerID change:

  • Email subject: change
  • Email body: old callerid\nnew callerid, (\n) means new line

Callback inititation:

  • Email subject: callback
  • Email body:
MOR_PARAM1 auth_callerid
MOR_PARAM2 first_number
MOR_PARAM3 second_number


2. Postfix server gets email and sends to /usr/local/mor/mor_email2callback.sh script

(It is already configured for you)

This is configured in /etc/aliases file:

callback: "|/usr/local/mor/mor_email2callback.sh"


3. /usr/local/mor/mor_email2callback.sh script parses email and sends everything to MOR.

(It is already configured for you)

wget -o /dev/null -O /dev/null "http://localhost/billing/emails/email_callback?subject=$subject&param1=$param1&param2=$param2&param3=$param3"

4. MOR GUI initiates callback using AMI command Originate.




Email Callback Setup example

In order Email Callback would work you must:

  • Have a working Device in MOR
  • Have a CLI set for that device with Use for Email Callback option selected
  • Point your domain MX record to MOR system (required when you go to Production). During this example we will send an email from the MOR system itself so MX record setup is not needed to test this feature.



Step 1. Configure MOR

1. Create a new sip device for a user. In this example created new device has an extension 1003. We will use this extension number as Source phone number in this callback example.

2. Create a new CLI for that device

1) Go to device list: SETTINGS -> Users -> Devices

2) Click the Icon clis.png button on the device you have just created.

3) Create a new CLI as described here, when creating be sure to select Use for Email Callback

Step 2. Test Email Callback from MOR system itself

For testing we will use Linux utility called mail. To make sure it is installed run this command:

yum -y install mailx

1. Go to MOR system's console (shell) and run this command:

mail -s callback callback@localhost  

P.S. when you will go to production @localhost will be @your_domain.com and email can be sent from any email client.

2. After launching command mentioned in 1. enter this text as email body:

MOR_PARAM1 1003 
MOR_PARAM2 1003
MOR_PARAM3 1004


Explanation:

MOR_PARAM1 1003 - 1003 here is a CLI you have configured in Step 1. when configured MOR

MOR_PARAM2 1003 - source device where callback should call first

MOR_PARAM3 1004 - destination where callback should call to. Can be any valid phone number, for example 37067531060 or extension in MOR. In this example we used an extension 1003 in MOR.

3. Press CTRL+D to finally send an email.

If you will be asked any questions, just press enter.


4. Now you should receive the call.




Troubleshooting

SMS Callback

It is possible to setup SMS Callback using such provider as: https://www.aql.com/sms/sms-to-email/



See also