[Vtigercrm-developers] Asterisk Connector Proposed Solutions Outbound and Inbound

vtiger at camden.net vtiger at camden.net
Tue Aug 5 17:52:04 GMT 2014


Outbound Fix Solution

This is an easy fix

Currently Vtiger connector is sending the AMI the following

Action: Originate
Channel: {CRM Phone Extension from My Preferences}
Context: {Context from PBX Manager Settings}
Exten: {CRM Phone Extension from My Preferences}
CallerID: {Number Clicked On}

This should be changed to 

Action: Originate
Channel: {CRM Phone Extension from My Preferences}
Context: {Context from PBX Manager Settings}
Exten: {Number Clicked On}
CallerID: "Calling" & {Number Clicked On} & "from
Vtiger"
Priority: 1
Timeout: 30000
Variable: var1=23|var2=24|var3=25
ActionID: {optional for error handling}

*** actionID can be any unique ID so you can track the
response in AMI for error handling

 

Inbound Solution

This is a possible solution, modeled after how all the tapi drivers'
and other means of monitoring for incoming work, I am not sure why AGI was used
to attempt this while it certainly a feasible solution but vtiger is not making
IVR's or other "interactive" functions so the use of AGI is turning a hill into
a mountain if you ask me. with that said, I will start looking into AGI solutions
if vtiger does not take my advice here

 

1st Connector should open an open ended session
to the AMI, we already know from webapp.ah data stream that vtiger developers
have a working AMI parser so use it and start listening, always look for
anything starts with "Connection closed" and reconnect 

2nd Radio buttons should be added to my preferences
near CRM Phone Extension for {POP Prefrence}

1.   1.)    Do not pop incoming
2.)   
Pop on Ring
3.)   
Pop on Answer

 

Each vtiger user logged in should have open session to the vtiger
connector, {CRM Phone Extension} and {POP Preference} should be passed to the
vtiger connector 

The vtiger connector should look for "Event: Newstate"

Once a Newstate packet has been received we need to inspect
it

If "ChannelState: 5" then we need to check if "CallerIDNum:
XXX" is logged in and wants POP on Ring, if so send "ConnectedLineNum: XXXXXXXXX"
the calling phone number and "ConnectedLineName: XXXXXXXXXXX" the callerID Name
to the user session to POP

If "ChannelState: 6" then we need to check if "ConnectedLineNum:
XXX" is logged in and wants POP on Answer, if so send "CallerIDNum: XXXXXXXX"
the calling phone number and "CallerIDName: XXXXXXXXX" the caller ID name

**** the above is not a mistake, the inbound caller ID and
name and the Internal Extension are swapped depending on channel state

 

If you want to get fancy with it you could listen for "Event:
Hangup" pull "CallerIDNum: XXX" and if XXX is logged in send command to exit
the pop if currently poped. the was answered or has ended, you can further use "cause:
XX" find out the reason, I would stay away from 26 aka answered elsewhere, you
only get this response if Ext rang out of a queue and mark answered elsewhere
is enabled on that queue, just the fact that the call ended to the extension in
question should be enouph to kill the pop if it is displaying

Weather you do the above or not it would be a good idea to
add POP counter in the my preferences, on pop a timer should count down and
kill the pop when the user defined time has expired, there should also be a
close link on the pop window to manually kill the pop window

 

Why this is written is English quasi sudo code: well the
current vtiger connector is written in java, and although it's a open source
project, they did not include the .java source files, so I am affarid I am not
of any more assistance but given that the connector already has to ability to connect
to the AMI and parses the data stream this should be a relatively easy fix..

 

FYI. the Event "Event: FullyBooted" is always the first
packet you get after a success log in, In your parser you keep logging it as No
event class registered for event type

Examples of the events packets I talk about in this document
are 

 

Event: Newstate
Privilege: call,all
Channel: SIP/102-000004bd
ChannelState: 5
ChannelStateDesc: Ringing
CallerIDNum: 102
CallerIDName: Fred
ConnectedLineNum: 18032433300
ConnectedLineName: Job Matthew
Uniqueid: 1407251773.33281

 

Event: Hangup
Privilege: call,all
Channel: SIP/106-000004c1
Uniqueid: 1407251773.33285
CallerIDNum: 106
CallerIDName: WorK Room
ConnectedLineNum: 18032433300
ConnectedLineName: Job Matthew
AccountCode:
Cause: 26
Cause-txt: Answered elsewhere


Event: Newstate
Privilege: call,all
Channel: SIP/VoxisSIP-000004bb
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum: 18032433300
CallerIDName: Job Matthew
ConnectedLineNum: 103
ConnectedLineName: Matt
Uniqueid: 1407251772.33279

 

 

please let me know if you are going to try to implement this or if you are instant on a AGI method, in which case I will try to help you there as well



 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

----------------------------------------
From: "Zebra Hosting" <support at zebrahosting.eu>
Sent: Tuesday, August 05, 2014 5:05 AM
To: "vtigercrm-developers at lists.vtigercrm.com" <vtigercrm-developers at lists.vtigercrm.com>
Subject: Re: [Vtigercrm-developers] Asterisk Connector & Asterisk 11 

The new version 14176 does not seem to fix the issuesS.

Bastiaan Houtkooper
Zebra Hosting

_______________________________________________
http://www.vtiger.com/

 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20140805/ed74ef30/attachment.html>


More information about the vtigercrm-developers mailing list