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&amp;extension=EXT">http://sugarcrmIP/popup.php?number=CALLERID&amp;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&amp;extension=105">http://sugarcrmIP/popup?number=7891234&amp;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 =&gt; s,1,Gotoif($[{LEN(${CALLERID(num)})} &gt; 3]?3)<br>exten =&gt; s,2,Goto(s,4)<br>exten =&gt; s,3,TrySystem(wget -qb -O /dev/null -o /dev/null &quot;<a href="http://sugarcrmIP/popup.php?number=${CALLERID(num)}&amp;extension=${ARG1}">http://sugarcrmIP/popup.php?number=${CALLERID(num)}&amp;extension=${ARG1}</a>&quot;)<br>
exten =&gt; s,4,Dial(${ARG2},35,rt)  ; Ring the interface, 20 seconds maximum<br>exten =&gt; s,5,Goto(s-${DIALSTATUS},1)  ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)<br>exten =&gt; s-NOANSWER,1,Voicemail(${ARG1},u)  ; If unavailable, send to voicemail w/ unavail announce<br>
exten =&gt; s-NOANSWER,2,Goto(default,s,1)  ; If they press #, return to start<br>;exten =&gt; s-BUSY,1,Voicemail(${ARG1},b)  ; If busy, send to voicemail w/ busy announce<br>;exten =&gt; s-BUSY,2,Goto(default,s,1)  ; If they press #, return to start<br>
exten =&gt; s-BUSY,1,Playtones(busy)<br>exten =&gt; _s-.,1,Goto(s-NOANSWER,1)  ; Treat anything else as no answer<br>exten =&gt; 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 &quot;<a href="http://sugarcrmIP/popup.php?number=${CALLERID(num)}&amp;extension=${ARG1}">http://sugarcrmIP/popup.php?number=${CALLERID(num)}&amp;extension=${ARG1}</a>&quot;)<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 &quot;<a href="http://sugarcrmIP/popup.php?number=7891234&amp;extension=105">http://sugarcrmIP/popup.php?number=7891234&amp;extension=105</a>&quot;)<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&#39;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>