pchero / jade Goto Github PK
View Code? Open in Web Editor NEWAsterisk based call center solution
License: BSD 2-Clause "Simplified" License
Asterisk based call center solution
License: BSD 2-Clause "Simplified" License
Support registry monitoring.
Event: Registry
Privilege: system,all
ChannelType: SIP
Username: 3456
Domain: mysipprovider.com
Status: Request Sent
When the user send POST: /ob/dls with data, the jade backend doesn't verify the dlma uuid.
Need to fix it.
There's memory leak report when the terminate the process.
The memory leak is not increasing and critical. But annoying. :(
Support below events.
- Newchannel - Hangup
Currently, the jade uses asterisk database and outbound database together.
But, if the jade uses the database in separate, it would be good to manage it.
Asterisk : Always recreate the database when the server is up.
Outboud : Clean up some of table when the server is up.
- Add outbound database file path.
- Add the database handler with context.
rb_* functions are not in used anymore..
Let's clean up.
It's too much big file the ob_dl_handler.
Need to make it separate ob_dl_handler and ob_dlma_handler.
Need to support the dialings monitoring apis.
Add sighup handler.
As a tradition, when the jade-backend received SIGHUP signal, it will reload the configuration file.
Daemon programs sometimes use SIGHUP as a signal to restart themselves, the most common reason for this being to re-read a configuration file that has been changed.
Affect to the channel table.
Add the column variables.
"variables": {
"key1": "val1",
"key2": "val2",
...
}
Event: VarSet Example
Event: VarSet
Privilege: dialplan,all
Channel: SIP/agent-01-0000002b
ChannelState: 0
ChannelStateDesc: Down
CallerIDNum: agent-01
CallerIDName: <unknown>
ConnectedLineNum: <unknown>
ConnectedLineName: <unknown>
Language: en
AccountCode:
Context: public
Exten: 4000
Priority: 1
Uniqueid: 1481278514.79
Linkedid: 1481278514.79
Variable: SIPURI
Value: sip:[email protected]:5060
Add the installation manual
Dlma
- Set to null related campaign's dlma info.
Plan
- Set to null related campaign's plan info.
Destination
- Set to null related campaign's destination info.
Should not affect to the dialing.
Once the dialing has created, the only status/result can be changed.
Currently, the jade-backend has strange categories in the configuration file.
And it could be possible to having different value of settings between configuration value and actually running process value. Because the jade-backend doesn't show the real(actually using) value to the configuration file.
So, need to do 2 things.
Categorize
AS-IS
{
"serv_addr": "127.0.0.1",
"serv_port": "5038",
"username": "",
"password": "",
"loglevel": "7",
"general" : {
"result_filename" : "./outbound_result.json"
},
"database" : {
"name": "./database.db"
}
}
TO-BE
{
"general": {
"serv_addr": "127.0.0.1",
"serv_port": "5038",
"username": "",
"password": "",
"loglevel": "7",
"database_name": "./database.db"
},
"ob": {
"result_filename" : "./outbound_result.json"
}
}
Update configuration file
When the asterisk is starting, the jade_backend caused core dump.
Need to fix it to reconnect to the asterisk after second.
Need to support rename ami event.
Event: Rename
Channel: <value>
Newname: <value>
Uniqueid: <value>
Currently, main module uses the db_handler.
But db_handler is not designed for context switching...
Need to be changed to db_ctx_handler.
Need to distinguish the outbound apis with normal api.
Because the outbound is some kind of plug-in/extra module.
Add the "/ob" prefix to the all outbound apis.
as-is
/campaigns
/campaigns/<uuid>
to-be
/ob/campaigns
/ob/campaigns/<uuid>
Currently, the jade_backend used account as a primary key. And the account is combination of below information.
<username>@<hostname>
But if more than 2 accounts are use the same username and hostname, but different port number, it makes crash. Need to change to like the below.
<username>@<hostname>:<port>
Caching the asterisk database.
Send request for initial asterisk database info
Keep update the asterisk database
The ob http handler consuming the space of the file too much.
It would be good idea make new file for them. :)
Implement the /peers, /peers/ api.
/peers
- Returns list of peers name.
/peers/ with peer name
- Returns given peer's detail info.
documentation for below item first.
- /plans
- /plans/<uuid>
Import the res_outbound module to jade backend.
So, we could control the outbound dial list from the jade.
Implement API.
/status
Returns status of the server.
Need to describe possible device_state's state.
"state": "UNAVAILABLE",
Currently, the jade_backend does not handle the Reponse fo the OriginateResponse Event.
But need to check the Response, because it cause wrong ob_dialing status update.
Event: OriginateResponse
Privilege: call,all
ActionID: 1113
Response: Failure
Channel: sip/agent-02sssdf
Application: park
Data:
Reason: 0
Uniqueid: test 12 123 1236
CallerIDNum: <unknown>
CallerIDName: <unknown>
Support asterisk-outbound AMI is not good idea.
Because of, the asterisk-outbound module keeps the all the campaign/plan/.. info into module itself.
This makes duplicated outbound objects.
So, the jade can not handle the asterisk-outbound module.
Currently, there's code for support asterisk-outbound ami message. But need to be removed.
Dials to the Agent first and, if the agent answer it, dials to the customer.
force=0
- Return false if there is referenced item to this.
- Delete given item.
force=1
- Set to null all the items which referenced to this(Make reference count to 0).
- Return false if there is referenced item to this.
- Delete given item.
It's not an easy to keeping the ast-database info from the jade-backend.
Because there's no way to check the all database info and hard to recognize when the new database key and value set/deleted it.
It's better to deprecate the api.
Add the pjsip AMI event handlers.
Currently, the jade_backend doesn't support variables.
Need to support it.
Make simple destination test script and automatic test script.
Need to add the invalid dialing record checker.
In somehow, the jade_backend could missing the channel hangup/dial end event.
If that, the jade_backend keeps the dialing info forever...
So the jade_backend needs to do something to prevent that.
It would be good, if the jade_backend send a below action request for every specified seconds.
And if the failed continued more than 3 times, then consider the dialing channel has missing.
List channel status.
Will return the status information of each channel along with the value for the specified channel variables.
Action: Status
ActionID: <value>
[Channel:] <value>
Variables: <value>
AllVariables: <value>
ActionID
Channel : The name of the channel to query for status.
Variables : Comma(,) separated list of variable to include.
AllVariables : If set to "true", the Status event will include all channel variables for the requested channel(s).
true
false
Need to separate the outbound resource document.
Need to add the more detail description
early_media codecs variables
Dlma
Dial List
Need to check invalid status of dls, and fix it.
- Get the all dialing/reserved status of dls.
- Validate dl info. (if there's no corresponding dl info in the dialing, update the status to idle.
It's hard to know when the api call has been called.
Need to increase the log level for recognize the api has been called.
Requirement
- libbsd
- libjansson
- libevent
- libevhtp
- libsqlite3
- libssl
Action: Parkinglosts
Event: Parkinglot
/parking_lots
Returns all parking lot key info.
/parking_lots/ with key
Returns detail parking lot info of given key.
Action: ParkedCalls
Event: ParkedCall
Event: UnParkedCall
Event: ParkedCallGiveUp
Event: ParkedCallSwap
/parked_calls
Returns all parked call key info.
/parked_calls/
Returns detail parked call info of given key.
Need to make test scripts.
- Create plan
- Update plan
- Delete plan
Currently, all the list result of /ob/* apis return result as like the below.
{
$defhdr,
"reuslt": {
"list": [
"<uuid string>",
...
]
}
}
But it should be changed like the below.
{
$defhdr,
"reuslt": {
"list": [
{"uuid": "<uuid string>"},
...
]
}
}
Support those AMI events.
- QueueParams - QueueMember - QueueEntry - QueueCallerAbandon - QueueCallerJoin - QueueCallerLeave - QueueMemberAdded - QueueMemberPause - QueueMemberPenalty - QueueMemberRemoved - QueueMemberRinginuse - QueueMemberStatus
Send Action at the beginning.
Action: QueueStatus
Normal case
In normal case, the status code would be 200.
{
"api_ver": "<version string>",
"timestamp": "<UTC timestamp string>",
"statuscode": <status code integer>,
"result": {
....
}
}
Error case
{
"api_ver": "<version string>",
"timestamp": "<UTC timestamp string>",
"statuscode": <status code integer>,
"error": {
"code": <error code integer>,
"message": "<detail error code message string>"
}
}
Currently, there are lots of wrong description in the Resources api description.
For example, in the queue_params description, Data parameters description was wrong.
Call
GET /queue_params/
{
"name": "<string>"
}
Data parameters
account: account info.
Need to fix it.
Support devices info monitoring
Event: DeviceStateChange
Device: confbridge:1926527208
State: NOT_INUSE
...
- Send Action: DeviceStateList request at the beginning.
- Keep insert/update information using Event: DeviceStateChange event.
AS-IS
#define DEF_PLAN_DIMAL_MODE E_DIAL_MODE_NONE
TO-BE
#define DEF_PLAN_DIMAL_MODE E_DIAL_MODE_PREDICTIVE
Currently, there's no rules when deleting the dlma.
But, it should be changed like below.
- It can't be delete if there's dl in the dlma without force option.
- If force option sets, delete all the dl info as well.
- If dlma has been deleted, should be deleted from the referenced campaign info also.
Add the force method parameter for the api call
DELETE /ob/dlmas/<uuid>?force=1
Support security request monitoring
Event: AuthMethodNotAllowed
Event: ChallengeResponseFailed
Event: ChallengeSent
Event: InvalidAccountID
Event: InvalidPassword
Event: InvalidTransport
Event: LoadAverageLimit
Event: MemoryLimit
Event: RequestBadFormat
Event: RequestNotAllowed
Event: SuccessfulAuth
/securities
columns
Event:
EventTV :
Severity :
Service :
EventVersion :
AccountID :
SessionID :
LocalAddress :
RemoteAddress :
AttemptedTransfer :
Module :
SessionTV :
Challenge :
ReceivedChallenge :
RecievedHash :
RequestType
RequestParams
There's no description about 0 value of hangup result.
Need to add it.
Result : Detail
0 : Could not received hangup event yet.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.