PDA

Voir la version complète : Remontée de fiche SugarCrm avec Asterisk



DSTel
04/10/2013, 11h53
Bonjour,

J'essaie depuis un moment de mettre en place un système de popup qui ferais remontée la fiche client de l'application SugarCrm lors d'un appel arrivant sur Asterisk.

J'ai essayé le plug'in "YAAI", mais il représente de nombreuse inconvénient et dysfonctionnement (Un coup sa marche, un coup sa marche pas)
J'ai été voir coter 3CX avec leurs modules qui s'adapte à sugar, mais il fonctionne que en présence de leur ipbx et non avec Asterisk.

Est ce que quelqu'un connait un plug'in qui fonctionne très bien avec Astérisk ?

Merci par avance

fastm3
04/10/2013, 13h33
Tu peux aller voir du coté des dialer/remontee d'info "generique".
Tu ne verras pas l'historique des appels entrant dans sugar mais tu pourras dialer et faire monter la fiche de ton choix ( avec juste une page ou on peut passer le tel )
http://www.asterisk-france.org/showthread.php/2230-Quel-solution-de-CTI-Client-utilisez-vous?p=12905&viewfull=1#post12905
Ca marche plutot bien et est fiable.
Le client Xivo doit problement savoir faire ca aussi mais il faut utiliser xivo.

Pas regarder depuis tres tres longtemps mais le code pour gerer asterisk dans sugar etait une cata il y a quelques annees, sans compter les pbs de perf induites par une conso cpu trop importante.

Fastm3.

DSTel
04/01/2014, 23h54
Merci fastm3, donc vous me conseiller d'utiliser Asterisk Click2Dial, je suis en train de voir comment faire remonté la fiche client avec ce plug'in.

Sinon pour info, j'utilise Xivo, donc si cette solution permet de faire de la remonté de fiche je suis très preneur .

Cdlt

Damien

quintana
05/01/2014, 00h45
Oui tu peux faire cela après tout dépend comment tu veux le faire ?

DSTel
05/01/2014, 11h13
Je suis sous Xivo Skaro 13.10 en interne (derriere une freebox) et sugarcrm en 6.5 chez Ovh.
J'utilise le softphone 3cx, mais si faut obligatoirement changé avec Xivo client ca ne me posera pas de probleme.

Je souhaiterais avoir une interaction entre sugar et xivo comme :
-aller cherché l'annuaire dans sugar
-capable de remonté la fiche client quand un appel arrive.

J'ai parcouru la toile mais je n'arrive pas a trouver quelque chose de fiable..

Si vous pouviez me mettre sur une piste.

Merci

Damien

DSTel
07/01/2014, 16h45
Personne n'aurait une petite idée ou piste à creuser ?

quintana
07/01/2014, 23h11
Salut,

Laisse moi te répondre demain :)

quintana
08/01/2014, 17h49
Salut,

Alors je te laisse regarder ici : https://github.com/sboily/xivo-sugarcrm

Ça te donne un exemple :) j'ai testé que sur une 13.25 de XiVO.

++

DSTel
08/01/2014, 23h27
Merci Quintana, je vais essayé de le faire fonctionner...

DSTel
10/01/2014, 19h36
Bonjour Quintana,

Alors j'ai commencer à me creuser la tête :


Sur Xivo, j'ai bien passé les commandes suivantes :

apt-get install git
mkdir /usr/share/asterisk/agi-bin
cd /usr/share/asterisk/agi-bin
git config --global http.sslverify false
git clone https://github.com/sboily/xivo-sugarcrm.git
cd xivo-sugarcrm
cp sugarcrm.conf /etc/asterisk/extensions_extra.d
chown www-data.www-data /etc/asterisk/extensions_extra.d/sugarcrm.conf




J'ai ensuite editer les 2 fichiers (pour etre sur) de sugarcrm.conf, qui se trouve à " /usr/share/asterisk/agi-bin" et "/etc/asterisk/extensions_extra.d"

Je l'ai éditer de cette facon :

[sub-sugarcrm]
exten = s,1,NoOp("Get information from SUGARCRM")
same = n,Set(SUGARCRM_URL=http://37.187.41.114/service/v4_1/rest.php)
same = n,Set(SUGARCRM_USERNAME=admin)
same = n,Set(SUGARCRM_PASSWD=*****)
same = n,Agi(xivo-sugarcrm/for_xivo)
same = n,UserEvent(dialplan2cti,UNIQUEID: ${UNIQUEID},CHANNEL: ${CHANNEL},VARIABLE: sugarcrm-firstname,VALUE: ${SUGARCRM-FIRSTNAME})
same = n,UserEvent(dialplan2cti,UNIQUEID: ${UNIQUEID},CHANNEL: ${CHANNEL},VARIABLE: sugarcrm-lastname,VALUE: ${SUGARCRM-LASTNAME})
same = n,Return()




Jai ensuite taper :
asterisk -r
xivo*CLI> dialplan reload
xivo*CLI> dialplan show sub-sugarcrm

Comme résultat j'ai eu :

xivo*CLI> dialplan show sub-sugarcrm
[ Context 'sub-sugarcrm' created by 'pbx_config' ]
's' => 1. NoOp("Get information from SUGARCRM") [pbx_config]
2. Set(SUGARCRM_URL=http://37.187.41.114/service/v4_1/rest.php) [pbx_config]
3. Set(SUGARCRM_USERNAME=admin) [pbx_config]
4. Set(SUGARCRM_PASSWD=****) [pbx_config]
5. Agi(xivo-sugarcrm/for_xivo) [pbx_config]
6. UserEvent(dialplan2cti,UNIQUEID: ${UNIQUEID},CHANNEL: ${CHANNEL},VARIABLE: sugarcrm-firstname,VALUE: ${SUGARCRM-FIRSTNAME}) [pbx_config]
7. UserEvent(dialplan2cti,UNIQUEID: ${UNIQUEID},CHANNEL: ${CHANNEL},VARIABLE: sugarcrm-lastname,VALUE: ${SUGARCRM-LASTNAME}) [pbx_config]
8. Return() [pbx_config]

-= 1 extension (8 priorities) in 1 context. =-




You need to add this subroutine in your DID for exemple on the webi.
Pour cela (je pense que c'est bien ici), j'ai été dans Service - IPBX - Gestion des Appels - Appels Entrants
J'ai editer mon numéro et dans "Sous-routine de prétraitement " j'ai mis : sub-sugarcrm
321




CTI config
Adding on your sheet model the variables :
{dp-sugarcrm-lastname}
{dp-sugarcrm-firstname}
La (j'ai un petit doute), j'ai été dans Service - Serveur CTI - Fiche - Modele
J'ai éditer "XIVO" et dans l'onglet "Fiche" ajouter les variables {dp-sugarcrm-lastname} et {dp-sugarcrm-firstname}.
322




Adding on sheet model action the value :
http://crm/index.php?module=Contacts&action=DetailView&record={dp-sugarcrm-id}
La je bloque, je sais pas ou mettre cette URL...




And authorize the popup url in xivo client.
La je pense que c'est bon
323



Si l'ensemble est correct il me manque juste l'url à placer, mais je ne sais pas ou...

je voulais savoir quel est le résultat attendu, une fois l'ensemble des paramatres renté.
Je veux dire de quel manière la fiche va remonté ou s'affiché.

Merci encore et bon week end

quintana
10/01/2014, 19h48
Salut,

Pour l'ID il te manque un userevent dans ce que tu montres, j'ai mis à jour après le git.

Ajoutes le sugarcrm.conf le dialplan suivant :

same = n,UserEvent(dialplan2cti,UNIQUEID: ${UNIQUEID},CHANNEL: ${CHANNEL},VARIABLE: sugarcrm-id,VALUE: ${SUGARCRM-ID})

Ton tuto est top :)

quintana
10/01/2014, 19h51
Adding on sheet model action the value :
http://crm/index.php?module=Contacts&action=DetailView&record={dp-sugarcrm-id}
La je bloque, je sais pas ou mettre cette URL...



Ah oui j'ai oublié de te répondre tu le rajoutes là où tu as mis les variables {dp-sugarcrm-xx} mais dans l'onglet d'après :), celui d'action.

Plus d'infos par ici !

http://documentation.xivo.fr/production/administration/customerinfo/sheetconfiguration.html#actions

DSTel
11/01/2014, 01h38
J'étais vraiment pas loin pour L’URL :)

J'ai rajouter la troisième ligne du UserEvent et j'ai donc insérer l'url :
http://37.187.41.114/index.php?module=Contacts&action=DetailView&record={dp-sugarcrm-id}
Dans l'onglet "Action"

Et aussi (je sais pas si cetait nécessaire) ajouter {dp-sugarcrm-id} dans les variables

Quand je fais un test d' appel j'ai bien l'url qui monte (même 2) mais avec ce message d'erreur : Bad data passed in; Return to Home
324
325

J'ai l'impression qui reporte pas le numéro dans la variable...

326
327
328

quintana
11/01/2014, 02h06
Tu dois avoir une ancienne version de mon script ...

Vérifies si c'est le même.

https://github.com/sboily/xivo-sugarcrm/blob/master/for_xivo

quintana
11/01/2014, 02h09
Hum well ... j'avais commité n'importe quoi sur ma dernière modif ... je ne sais pas trop ce que j'ai foutu :)
Reprend le dernier.

quintana
11/01/2014, 02h48
En passant attention tu as tout mis tes variables d'affichage dans le titre (title) sur la bulle ;)

DSTel
11/01/2014, 12h37
J'ai pris le nouveau script avec la nouvelle ligne de l'ID.

agi.set_variable("SUGARCRM-ID", contact['id'])

Le problème est toujours présent, mais je commence à me demander si c'est pas parce que je suis en 13.10 et non en 13.25.
Pour sugarcrm je suis bien en 6.5.16 CE

Pense tu que cela pourrais venir de ça ? (parce que le CTI est aussi intégré dans 13.10..)

En tout cas, merci pour ton aide :)

DSTel
11/01/2014, 12h59
Ce qui est étrange c'est le type d'url renseigné dans Xivo est :

http://37.187.41.114/index.php?module=Contacts&action=DetailView&record=%7Bdp-sugarcrm-id%7D

Alors que quand j'ouvre une fiche dans Sugar il est de cette forme :

http://37.187.41.114/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodu le%3DContacts%26action%3DDetailView%26record%3D38e 00d3c-0b0f-2788-a10d-52d024c154bf

DSTel
11/01/2014, 13h27
Pour le dernier post, c'est résolu j'ai désactiver Ajax et l'url concorde avec Xivo :)

Reste à savoir pourquoi la variable {dp-sugarcrm-id} ne remonte pas l'id de la fiche

quintana
11/01/2014, 13h58
Ah oui il faut que tu upgrades, 13.10 devait avoir des soucis avec la réécriture des variables. On a fait un gros boulot depuis. Tu as juste a lancer xivo-upgrade. Par contre cela sera un peu long.

DSTel
13/01/2014, 21h12
Je te remercie Sylvain, pour tes explications.

En suivant ton tuto à la lettre avec les versions 13.25 de Xivo et 6.5.16 de sugar, la remonté de fiche marche parfaitement.

Enfin une solution CTI très stable :)

quintana
13/01/2014, 21h52
Super :), il y avait d'autre façon de faire aussi avec XiVO. C'est un peu la force de XiVO justement :)
Bon ok je ne suis pas vraiment la bonne personne pour le dire, mais je le dit quand même !
Hésites pas à partager ton expérience, ton tuto avec les captures d'écran est vraiment bien, si tu te sens de contribuer à faire un truc dans le wiki de XiVO ne te gène pas :)

DSTel
14/01/2014, 19h09
Je le ferais :) car j'ai longtemps cherché à trouver une solution et je me focalisais trop sur le plug'in "YAAI" qui marchais aléatoirement.

DSTel
20/01/2014, 19h28
Bonjour Sylvain,

Je suis de retour :-) Bizarrement cela à fonctionné sur la machine de test mais pas sur la prod...
J'ai l'impression que quand il connait le numéro l'appel n'aboutit pas (message d’indisponibilité) et quand le numéro n'est pas renseigné l'appel arrive bien et la fiche remonte vierge.

Si ça te parle + rapidement que moi, j'aimerais bien comprendre d'ou ça vient

voici la trace CLI d'un appel connu dans le CRM mais d'ou l'appel n'a pas aboutit (aucun des postes n'a sonné)

Désolé de t’embêter avec ça, mais je comprend pas ce phénomène...

[Jan 20 17:46:52] -- Executing [097223XXXX@from-extern:1] Set("SIP/trunk_ovh-000000f2", "XIVO_BASE_CONTEXT=from-extern") in new stack
[Jan 20 17:46:52] -- Executing [097223XXXX@from-extern:2] Set("SIP/trunk_ovh-000000f2", "XIVO_BASE_EXTEN=097223XXXX") in new stack
[Jan 20 17:46:52] -- Executing [097223XXXX@from-extern:3] Gosub("SIP/trunk_ovh-000000f2", "did,s,1(3,)") in new stack
[Jan 20 17:46:52] -- Executing [s@did:1] Set("SIP/trunk_ovh-000000f2", "XIVO_DSTNUM=097223XXXX") in new stack
[Jan 20 17:46:52] -- Executing [s@did:2] Set("SIP/trunk_ovh-000000f2", "XIVO_CONTEXT=from-extern") in new stack
[Jan 20 17:46:52] -- Executing [s@did:3] Set("SIP/trunk_ovh-000000f2", "XIVO_PRESUBR_GLOBAL_NAME=DID") in new stack
[Jan 20 17:46:52] -- Executing [s@did:4] Set("SIP/trunk_ovh-000000f2", "XIVO_INCALL_ID=3") in new stack
[Jan 20 17:46:52] -- Executing [s@did:5] Set("SIP/trunk_ovh-000000f2", "__XIVO_CALLORIGIN=extern") in new stack
[Jan 20 17:46:52] -- Executing [s@did:6] AGI("SIP/trunk_ovh-000000f2", "agi://127.0.0.1/callerid_extend") in new stack
[Jan 20 17:46:52] agi://127.0.0.1/callerid_extend: AGI handler 'callerid_extend' successfully executed
[Jan 20 17:46:52] -- <SIP/trunk_ovh-000000f2>AGI Script agi://127.0.0.1/callerid_extend completed, returning 0
[Jan 20 17:46:52] -- Executing [s@did:7] AGI("SIP/trunk_ovh-000000f2", "agi://127.0.0.1/in_callerid") in new stack
[Jan 20 17:46:52] agi://127.0.0.1/in_callerid: AGI handler 'in_callerid' successfully executed
[Jan 20 17:46:52] -- <SIP/trunk_ovh-000000f2>AGI Script agi://127.0.0.1/in_callerid completed, returning 0
[Jan 20 17:46:52] -- Executing [s@did:8] AGI("SIP/trunk_ovh-000000f2", "agi://127.0.0.1/callerid_forphones") in new stack
[Jan 20 17:46:52] agi://127.0.0.1/callerid_forphones: AGI handler 'callerid_forphones' successfully executed
[Jan 20 17:46:52] -- <SIP/trunk_ovh-000000f2>AGI Script agi://127.0.0.1/callerid_forphones completed, returning 0
[Jan 20 17:46:52] -- Executing [s@did:9] UserEvent("SIP/trunk_ovh-000000f2", "ReverseLookup,CHANNEL: SIP/trunk_ovh-000000f2,") in new stack
[Jan 20 17:46:52] -- Executing [s@did:10] Set("SIP/trunk_ovh-000000f2", "XIVO_SRCNUM=095155XXXX") in new stack
[Jan 20 17:46:52] -- Executing [s@did:11] Gosub("SIP/trunk_ovh-000000f2", "xivo-did_rights_check,s,1") in new stack
[Jan 20 17:46:52] -- Executing [s@xivo-did_rights_check:1] AGI("SIP/trunk_ovh-000000f2", "agi://127.0.0.1/did_set_call_rights") in new stack
[Jan 20 17:46:52] agi://127.0.0.1/did_set_call_rights: AGI handler 'did_set_call_rights' successfully executed
[Jan 20 17:46:52] -- <SIP/trunk_ovh-000000f2>AGI Script agi://127.0.0.1/did_set_call_rights completed, returning 0
[Jan 20 17:46:52] -- Executing [s@xivo-did_rights_check:2] GotoIf("SIP/trunk_ovh-000000f2", "ALLOW?:error,1") in new stack
[Jan 20 17:46:52] -- Executing [s@xivo-did_rights_check:3] GotoIf("SIP/trunk_ovh-000000f2", "1?allow,1") in new stack
[Jan 20 17:46:52] -- Goto (xivo-did_rights_check,allow,1)
[Jan 20 17:46:52] -- Executing [allow@xivo-did_rights_check:1] NoOp("SIP/trunk_ovh-000000f2", "Caller allowed to make call") in new stack
[Jan 20 17:46:52] -- Executing [allow@xivo-did_rights_check:2] Return("SIP/trunk_ovh-000000f2", "") in new stack
[Jan 20 17:46:52] -- Executing [s@did:12] AGI("SIP/trunk_ovh-000000f2", "agi://127.0.0.1/incoming_did_set_features") in new stack
[Jan 20 17:46:52] agi://127.0.0.1/incoming_did_set_features: AGI handler 'incoming_did_set_features' successfully executed
[Jan 20 17:46:52] -- <SIP/trunk_ovh-000000f2>AGI Script agi://127.0.0.1/incoming_did_set_features completed, returning 0
[Jan 20 17:46:52] -- Executing [s@did:13] UserEvent("SIP/trunk_ovh-000000f2", "Did,XIVO_SRCNUM: 095155XXXX,XIVO_SRCNAME: ,XIVO_EXTENPATTERN: 097223XXXX,CHANNEL: SIP/trunk_ovh-000000f2,XIVO_SRCTON: 0,XIVO_SRCRDNIS: ") in new stack
[Jan 20 17:46:52] -- Executing [s@did:14] AGI("SIP/trunk_ovh-000000f2", "agi://127.0.0.1/check_schedule") in new stack
[Jan 20 17:46:52] agi://127.0.0.1/check_schedule: AGI handler 'check_schedule' successfully executed
[Jan 20 17:46:52] -- <SIP/trunk_ovh-000000f2>AGI Script agi://127.0.0.1/check_schedule completed, returning 0
[Jan 20 17:46:52] -- Executing [s@did:15] GotoIf("SIP/trunk_ovh-000000f2", "0?CLOSED,1") in new stack
[Jan 20 17:46:52] -- Executing [s@did:16] Gosub("SIP/trunk_ovh-000000f2", "xivo-subroutine,s,1(sub-sugarcrm)") in new stack
[Jan 20 17:46:52] -- Executing [s@xivo-subroutine:1] GotoIf("SIP/trunk_ovh-000000f2", "sub-sugarcrm?:nosubroutine") in new stack
[Jan 20 17:46:52] -- Executing [s@xivo-subroutine:2] GotoIf("SIP/trunk_ovh-000000f2", "1?:nosubroutine") in new stack
[Jan 20 17:46:52] -- Executing [s@xivo-subroutine:3] Gosub("SIP/trunk_ovh-000000f2", "sub-sugarcrm,s,1") in new stack
[Jan 20 17:46:52] -- Executing [s@sub-sugarcrm:1] NoOp("SIP/trunk_ovh-000000f2", ""Get information from SUGARCRM"") in new stack
[Jan 20 17:46:52] -- Executing [s@sub-sugarcrm:2] Set("SIP/trunk_ovh-000000f2", "SUGARCRM_URL=http://crm.XXXX.com/service/v4_1/rest.php") in new stack
[Jan 20 17:46:52] -- Executing [s@sub-sugarcrm:3] Set("SIP/trunk_ovh-000000f2", "SUGARCRM_USERNAME=XXXX") in new stack
[Jan 20 17:46:52] -- Executing [s@sub-sugarcrm:4] Set("SIP/trunk_ovh-000000f2", "SUGARCRM_PASSWD=XXXX") in new stack
[Jan 20 17:46:52] -- Executing [s@sub-sugarcrm:5] AGI("SIP/trunk_ovh-000000f2", "xivo-sugarcrm/for_xivo") in new stack
[Jan 20 17:46:52] -- Launched AGI Script /usr/share/asterisk/agi-bin/xivo-sugarcrm/for_xivo
[Jan 20 17:46:52] xivo-sugarcrm/for_xivo: Trying to connect http://crm.XXXX.com/service/v4_1/rest.php with Asterisk : XXXX
[Jan 20 17:46:57] xivo-sugarcrm/for_xivo: CONTACT : Damien Soulages
[Jan 20 17:46:57] -- <SIP/trunk_ovh-000000f2>AGI Script xivo-sugarcrm/for_xivo completed, returning 4
[Jan 20 17:46:57] == Spawn extension (sub-sugarcrm, s, 5) exited non-zero on 'SIP/trunk_ovh-000000f2'

DSTel
21/01/2014, 08h30
Le problème provient du serveur CRM en lui même et non de xivo, car quand je met mon crm de test, l'appel arrive sans problème qu'il soit reconnu ou non dans les fiches contact.
Mais avec le crm de prod, si la fiche est reconnu l'appel n'aboutit pas.
Pour le moment la seul différence que je vois c'est que mon crm de test à une URL de type http://37.187.XX.XXX et celui en prod c'est du style : http://crm.airXXXX.com/

DSTel
22/01/2014, 15h00
Je continu de chercher...
Ce n'est pas un probleme d'URL

La différence dans les log (CLI) que j'obtien est :

OK:
[Jan 21 07:20:18] xivo-sugarcrm/for_xivo: CONTACT : dams Sales
[Jan 21 07:20:18] -- <SIP/trunk_ovh-0000012d>AGI Script xivo-sugarcrm/for_xivo completed, returning 0
[Jan 21 07:20:18] -- Executing [s@sub-sugarcrm:6] UserEvent("SIP/trunk_ovh-0000012d", "dialplan2cti,UNIQUEID: 1390285216.301,CHANNEL: SIP/trunk_ovh-0000012d,VARIABLE: sugarcrm-firstname,VALUE: ") in new stack
[Jan 21 07:20:18] -- Executing [s@sub-sugarcrm:7] UserEvent("SIP/trunk_ovh-0000012d", "dialplan2cti,UNIQUEID: 1390285216.301,CHANNEL: SIP/trunk_ovh-0000012d,VARIABLE: sugarcrm-lastname,VALUE: dams Sales") in new stack
[Jan 21 07:20:18] -- Executing [s@sub-sugarcrm:8] UserEvent("SIP/trunk_ovh-0000012d", "dialplan2cti,UNIQUEID: 1390285216.301,CHANNEL: SIP/trunk_ovh-0000012d,VARIABLE: sugarcrm-id,VALUE: 38e00d3c-0b0f-2788-a10d-52d024c154bf") in new stack

NOK
[Jan 21 07:24:41] xivo-sugarcrm/for_xivo: CONTACT : Damien Soulages
[Jan 21 07:24:42] -- <SIP/trunk_ovh-00000133>AGI Script xivo-sugarcrm/for_xivo completed, returning 4
[Jan 21 07:24:42] == Spawn extension (sub-sugarcrm, s, 5) exited non-zero on 'SIP/trunk_ovh-00000133'
[Jan 21 07:24:43] == Using SIP RTP CoS mark 5
[Jan 21 07:24:43] -- Executing [097223XXXX@from-extern:1] Set("SIP/trunk_ovh-00000134", "XIVO_BASE_CONTEXT=from-extern") in new stack
[Jan 21 07:24:43] -- Executing [097223XXXX@from-extern:2] Set("SIP/trunk_ovh-00000134", "XIVO_BASE_EXTEN=097223XXXX") in new stack
[Jan 21 07:24:43] -- Executing [097223XXXX@from-extern:3] Gosub("SIP/trunk_ovh-00000134", "did,s,1(3,)") in new stack

...

quintana
23/01/2014, 08h45
Salut,

Je suis en déplacement, mais je regarde cela à mon retour. Je serai sur le salon itpartners en février si jamais y a des gens qui y seront aussi :)

DSTel
04/02/2014, 16h11
J'attend ton retour,

Pour résumer mes recherches (parce que c'est assez étrange) :

Quand un appel arrivant sur Xivo et qui est répertorier dans une fiche CRM, Xivo nous retourne une erreur : AGI Script xivo-sugarcrm/for_xivo completed, returning 4
Il stop l’exécution du script

Par contre quand un appel arrive et n'est pas enregistré dans une fiche CRM, tout se déroule correctement : AGI Script xivo-sugarcrm/for_xivo completed, returning 0

Comme sur mon CRM de test je n'ai pas ce problème, j'ai donc comparer les paramètres avec celui de PROD :
-Encodage par défaut des imports/Exports défini sur UTF-8 = OK
-Paramètre Locaux = OK

Impossible de comprendre pourquoi le script s’arrête quand il identifie une fiche CRM avec le numéro appelant...

J'ai même essayé de désinstaller et recommencer l'installation de GIT mais rien y fait...

quintana
09/02/2014, 12h42
Désolé j'ai pas eu le temps encore car je voyage trop, mais j'ai pas oublié :) ça doit venir surement de l'Agi le souci.

DSTel
11/02/2014, 21h20
C'est pas pressé :)

j'ai essayé de débugué.

asterisk -r
agi set debug on
core set verbose 4

Voila ce que j'ai (au moment ou ca plante) sur le CRM qui pose problème :

------------------------------------------------------------------------------------------------------------------------------------------------------------
[Feb 11 19:40:17] <SIP/trunk_ovh-0000000a>AGI Rx << VERBOSE "CONTACT : Damien Soulages" 1
[Feb 11 19:40:17] xivo-sugarcrm/for_xivo: CONTACT : Damien Soulages
[Feb 11 19:40:17] <SIP/trunk_ovh-0000000a>AGI Tx >> 200 result=1
[Feb 11 19:40:17] <SIP/trunk_ovh-0000000a>AGI Rx << SET VARIABLE "SUGARCRM-ID" "970a01ac-7ce0-45e4-9776-51c5de4b3e99"
[Feb 11 19:40:17] <SIP/trunk_ovh-0000000a>AGI Tx >> 200 result=1
[Feb 11 19:40:17] <SIP/trunk_ovh-0000000a>AGI Rx << SET VARIABLE "SUGARCRM-FIRSTNAME" "Damien"
[Feb 11 19:40:17] <SIP/trunk_ovh-0000000a>AGI Tx >> 200 result=1
[Feb 11 19:40:17] <SIP/trunk_ovh-0000000a>AGI Rx << SET VARIABLE "SUGARCRM-LASTNAME" "Soulages"
[Feb 11 19:40:17] <SIP/trunk_ovh-0000000a>AGI Tx >> 200 result=1
[Feb 11 19:40:18] -- <SIP/trunk_ovh-0000000a>AGI Script xivo-sugarcrm/for_xivo completed, returning 4
[Feb 11 19:40:18] == Spawn extension (sub-sugarcrm, s, 5) exited non-zero on 'SIP/trunk_ovh-0000000a'
-----------------------------------------------------------------------------------------------------------------------------------------------------------


Et le même test avec le CRM qui fonctionne :

[Feb 11 20:05:02] <SIP/trunk_ovh-0000000d>AGI Rx << VERBOSE "CONTACT : dams Sales" 1
[Feb 11 20:05:02] xivo-sugarcrm/for_xivo: CONTACT : dams Sales
[Feb 11 20:05:02] <SIP/trunk_ovh-0000000d>AGI Tx >> 200 result=1
[Feb 11 20:05:02] <SIP/trunk_ovh-0000000d>AGI Rx << SET VARIABLE "SUGARCRM-ID" "38e00d3c-0b0f-2788-a10d-52d024c154bf"
[Feb 11 20:05:02] <SIP/trunk_ovh-0000000d>AGI Tx >> 200 result=1
[Feb 11 20:05:02] <SIP/trunk_ovh-0000000d>AGI Rx << SET VARIABLE "SUGARCRM-FIRSTNAME" ""
[Feb 11 20:05:02] <SIP/trunk_ovh-0000000d>AGI Tx >> 200 result=1
[Feb 11 20:05:02] <SIP/trunk_ovh-0000000d>AGI Rx << SET VARIABLE "SUGARCRM-LASTNAME" "dams Sales"
[Feb 11 20:05:02] <SIP/trunk_ovh-0000000d>AGI Tx >> 200 result=1
[Feb 11 20:05:03] -- <SIP/trunk_ovh-0000000d>AGI Script xivo-sugarcrm/for_xivo completed, returning 0
[Feb 11 20:05:03] -- Executing [s@sub-sugarcrm:6] UserEvent("SIP/trunk_ovh-0000000d", "dialplan2cti,UNIQUEID: 1392145499.13,CHANNEL: SIP/trunk_ovh-0000000d,VARIABLE: sugarcrm-firstname,VALUE: ") in new stack
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


La seul différence que je voit est sur "SUGARCRM-FIRSTNAME" ...

quintana
12/02/2014, 03h28
ok j'ai modifié le script pour ajouter du debug. Pourrais tu le remettre à jour et le lancer à la main, donc pas dans Asterisk en activant le debug et en mettant les bonnes informations. Il doit sûrement avoir un bug, dans le script mais j'aimerai bien le voir :).
Sinon c'est exactement la même version de sugarcrm ? Moi j'ai tenté avec le mien et j'ai aucun souci même si c'est vide.

DSTel
12/02/2014, 19h01
Oui c'est exactement la même version et le problème est uniquement quand le numéro fait partit d'une fiche CRM = L'appel se coupe
Si le numéro ne fait pas partit d'une fiche CRM, l'appel aboutit bien et le pop'up se lance bien (vide)


Sur CRM qui pose problème (prod) :

Numéro reconnu :
Trying to connect http://91.121.XXX.34/AIRNATUREL/crm/service/v4_1/rest.php with Asterisk : ipbxXXX
Searching information for caller 0951555895
CONTACT : Damien Soulages
SUGARCRM-ID 970a01ac-7ce0-45e4-9776-51c5de4b3e99
SUGARCRM-FIRSTNAME Damien
SUGARCRM-LASTNAME Soulages
root@xivo:/usr/share/asterisk/agi-bin/xivo-sugarcrm#


Numéro non reconnu :
Trying to connect http://91.121.XXX.34/AIRNATUREL/crm/service/v4_1/rest.php with Asterisk : ipbxXXX
Searching information for caller 0951555890
root@xivo:/usr/share/asterisk/agi-bin/xivo-sugarcrm#


Crm ok (test) :


Numéro reconnu :
Trying to connect http://37.187.41.114/service/v4_1/rest.php with admin : sugar
Searching information for caller 0951555895
CONTACT : dams Sales
SUGARCRM-ID 38e00d3c-0b0f-2788-a10d-52d024c154bf
SUGARCRM-FIRSTNAME
SUGARCRM-LASTNAME dams Sales



Numéro non reconnu :
Trying to connect http://37.187.41.114/service/v4_1/rest.php with admin : sugar
Searching information for caller 0951555890
root@xivo:/usr/share/asterisk/agi-bin/xivo-sugarcrm#


Le debug n'a pas l'air d'être bavard...
J'ai essayé de recrée une fiche et c'est pareil.

Je me demande si c'est pas les différents modules installés qui poserais problème. (qui modifierais l'origine d'une fiche contact..)
je vais essayer hors prod de désactiver l'ensemble des modules et de refaire des tests, pour votre si le problème persiste.

quintana
13/02/2014, 02h04
En fait le souci c'est que l'appel se coupe c'est ça ?
Du coup je ne suis pas sur de chercher au bon endroit. Tu peux juste me dire ce qui ne marche pas fonctionnellement. En te relisant je me dis que je ne suis pas sur d'avoir pigé le souci :-).

quintana
13/02/2014, 02h37
Je me suis amusé à faire buggy le script mais cela ne me coupe pas l'appel. J'attends tes précisions :)

quintana
13/02/2014, 02h59
ok en cherchant un peu j'ai trouvé qu'avec les accents l'agi buggy ... Du coup fais un git pull j'ai modifié cette partie pour que cela fonctionne correctement.

DSTel
13/02/2014, 19h59
Désoler j'ai du mal m'exprimer, le phénomène est assez étrange...

quand un appel rentre, le script se lance et :

-Si le numéro ne fait pas partit d'une fiche Crm, l'appel fait sonner les postes et l'url se lance avec aucune fiche.
<SIP/trunk_ovh-0000012d>AGI Script xivo-sugarcrm/for_xivo completed, returning 0

-Si le numéro fait partit d'une fiche CRM, à ce moment la, le script se lance, identifie bien la fiche mais Asterisk coupe l'appel et les postes ne sonnent pas.
SIP/trunk_ovh-00000133>AGI Script xivo-sugarcrm/for_xivo completed, returning 4

J'ai cru comprendre que le Returning 4 est un message d'erreur comme quoi le script à été subitement arête

Donc tous les appels, dont le numéro est enregistré dans une fiche CRM, n'aboutisse pas, l'appel est rejeter et on tombe sur un message d'indisponibilité de la ligne sip.

Les 2 CRM ont la même version, mais il y'a tout de même quelque chose de différent... C'est pourquoi je vais essayer de tester en désactivant ses modules installés.

quintana
13/02/2014, 21h42
Return 0 est une erreur. OK je regarderai toit a l'heure dans ce sens.