Dear All<br><br>I want to integrate sugarcrm and asterisk , so when customer call the call center the agent or extension which answers the call , before pickup the phone and talk to customer , view his/her information if it is available.<br>
<br>I do this as described below :<br>1-Setup login username for sugarcrm for each extension<br>2-Extension Users will login to the sugarcrm.<br>3-Develop php script to handle new call ( this script will execute from asterisk )<br>
4-The path to the script is like this :<br><a href="http://sugarcrmIP/popup.php?number=CALLERID&extension=EXT">http://sugarcrmIP/popup.php?number=CALLERID&extension=EXT</a><br><br>i.e. consider the extension number is 105 and the callerid is 7891234.<br>
<br>so these numbers will replace the CALLERID and EXT as follows <br><br><a href="http://sugarcrmIP/popup?number=7891234&extension=105">http://sugarcrmIP/popup?number=7891234&extension=105</a><br><br>5-In asterisk in extensions.conf File I have edited the Macro named std-exten ( [macro-stdexten] )<br>
<br>Just before Dial I put the following :<br><br>[macro-stdexten]<br>;<br>; Standard extension macro:<br>; ${ARG1} - Extension (we could have used ${MACRO_EXTEN} here as well<br>; ${ARG2} - Device(s) to ring<br>;<br>
<br>exten => s,1,Gotoif($[{LEN(${CALLERID(num)})} > 3]?3)<br>exten => s,2,Goto(s,4)<br>exten => s,3,TrySystem(wget -qb -O /dev/null -o /dev/null "<a href="http://sugarcrmIP/popup.php?number=${CALLERID(num)}&extension=${ARG1}">http://sugarcrmIP/popup.php?number=${CALLERID(num)}&extension=${ARG1}</a>")<br>
exten => s,4,Dial(${ARG2},35,rt) ; Ring the interface, 20 seconds maximum<br>exten => s,5,Goto(s-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)<br>exten => s-NOANSWER,1,Voicemail(${ARG1},u) ; If unavailable, send to voicemail w/ unavail announce<br>
exten => s-NOANSWER,2,Goto(default,s,1) ; If they press #, return to start<br>;exten => s-BUSY,1,Voicemail(${ARG1},b) ; If busy, send to voicemail w/ busy announce<br>;exten => s-BUSY,2,Goto(default,s,1) ; If they press #, return to start<br>
exten => s-BUSY,1,Playtones(busy)<br>exten => _s-.,1,Goto(s-NOANSWER,1) ; Treat anything else as no answer<br>exten => a,1,VoicemailMain(${ARG1}) ; If they press *, send the user into VoicemailMain<br><br clear="all">
so when calls come in to asterisk before execute the dial in the macro it will execute the <br>TrySystem(wget -qb -O /dev/null -o /dev/null "<a href="http://sugarcrmIP/popup.php?number=${CALLERID(num)}&extension=${ARG1}">http://sugarcrmIP/popup.php?number=${CALLERID(num)}&extension=${ARG1}</a>")<br>
and replace ${CALLERID(num)} with the callerid of customer and ${ARG1} with user extension<br><br>as I stated in step 4 as an example the following will execute<br><br>TrySystem(wget -qb -O /dev/null -o /dev/null "<a href="http://sugarcrmIP/popup.php?number=7891234&extension=105">http://sugarcrmIP/popup.php?number=7891234&extension=105</a>")<br>
<br>and this will cause a screen popup on the user screen which is logged in the sugarcrm and his/her extension number is 105.<br><br><br>Everything work fine with this implementation but when it comes to Queue it fails , cause in the Queue the [macro-stdexten] will not be executed for dialing.<br>
<br><br>I have a Queue ( huntgroup ) which all the extensions are its member and with random algorithm the calls will be distributed to extensions.<br>I need the popup but don't know how to execute the URL with the replacement of the ${CALLERID(num)} and ${ARG1} with value.<br>
<br>Please someone help me.<br><br>Best Regards,<br><br>Mohsen<br><br><br>