[?!BUG!?] Callmonitor + PHP CGI

AcerExtensa

Neuer User
Mitglied seit
22 Mrz 2010
Beiträge
1
Punkte für Reaktionen
0
Punkte
0
Hallo Leute!
ich versuche verzweifelt seit einigen Tagen eingehende und abgehende Anrufe mit hilfe von Callmonitor(1.15.1) + PHP-CGI(5.2.13) per SOAP ins CRM einzutragen.

Script funktioniert wunderbar. Getestet mit Apache und unter Konsole.
Auch wenn ich getmsg in Listeners benutze, läuft alles einwandfrei.

Code:
in:dis ^ ^ getmsg localhost:85 '/logon.php?FROM_NUM=%s&TO_NUM=%s&IO=0&DURATION=%s' "$SOURCE" "$DEST" "$DURATION"
Testanruf:
Code:
including /usr/lib/callmonitor/actions.d/config.sh
including /usr/lib/callmonitor/actions.d/dboxlcd.sh
including /usr/lib/callmonitor/actions.d/dial.sh
including /usr/lib/callmonitor/actions.d/mail.sh
including /usr/lib/callmonitor/actions.d/messages.sh
including /usr/lib/callmonitor/actions.d/musicpal.sh
including /usr/lib/callmonitor/actions.d/rc.sh
including /usr/lib/callmonitor/actions.d/roku.sh
including /var/tmp/flash/callmonitor/actions.local.d/argv_test.sh
including /var/tmp/flash/callmonitor/actions.local.d/den_test.sh
>>> in:disconnect ID=1 TIMESTAMP=31.03.10 11:09 SOURCE=123456789 DEST=987654321 EXT=4 DURATION=16 PROVIDER=
[0] event detected:
  EVENT=in:disconnect
  SOURCE='123456789'
  DEST='987654321'
[0+] detailed event data:
  SOURCE_DISP='123456789'
  SOURCE_ENTRY='123456789; Erfurt'
    SOURCE_NAME='123456789'
    SOURCE_ADDRESS='Erfurt'
  DEST_DISP='987654321'
  DEST_ENTRY=''
    DEST_NAME=''
    DEST_ADDRESS=''
  ID=1
  EXT=4
  DURATION=16
  TIMESTAMP='31.03.10 11:09'
  PROVIDER=
[0:0] processing rule 'in:dis' '^' '^' 'getmsg localhost:85 '/logon.php?FROM_NUM=%s&TO_NUM=%s&IO=0&DURATION=%s' "$SOURCE" "$DEST" "$DURATION"'
[0:0] event 'in:disconnect' matches pattern 'in:dis'
[0:0] parameter SOURCE='123456789' matches pattern '^'
[0:0] parameter DEST='987654321' matches pattern '^'
[0:0] SUCCEEDED
[0:0] ACTION: 'getmsg localhost:85 '/logon.php?FROM_NUM=%s&TO_NUM=%s&IO=0&DURATION=%s' "$SOURCE" "$DEST" "$DURATION"'
HTTP/1.1 200 OK
Date: Wed, 31 Mar 2010 09:09:39 GMT
Server: Apache/1.3.41 (Unix)
X-Powered-By: PHP/5.2.13
Connection: close
Content-Type: text/html

Array
(
    [FROM_NUM] => 123456789
    [TO_NUM] => 987654321
    [IO] => 0
    [DURATION] => 16
)

a8627473e4b9cd520b46c79f065822541a

Und wenn folgendes in Listeners steht:
Code:
in:dis ^ ^ /bin/php /var/media/ftp/uStor01/apache/htdocs/logon.php FROM_NUM=$SOURCE TO_NUM=$DEST IO=0 DURATION=$DURATION

Dann sieht Testanruf so aus:
Code:
including /usr/lib/callmonitor/actions.d/config.sh
including /usr/lib/callmonitor/actions.d/dboxlcd.sh
including /usr/lib/callmonitor/actions.d/dial.sh
including /usr/lib/callmonitor/actions.d/mail.sh
including /usr/lib/callmonitor/actions.d/messages.sh
including /usr/lib/callmonitor/actions.d/musicpal.sh
including /usr/lib/callmonitor/actions.d/rc.sh
including /usr/lib/callmonitor/actions.d/roku.sh
including /var/tmp/flash/callmonitor/actions.local.d/argv_test.sh
including /var/tmp/flash/callmonitor/actions.local.d/den_test.sh
>>> in:disconnect ID=1 TIMESTAMP=31.03.10 11:13 SOURCE=123456789 DEST=987654321 EXT=4 DURATION=16 PROVIDER=
[0] event detected:
  EVENT=in:disconnect
  SOURCE='123456789'
  DEST='987654321'
[0+] detailed event data:
  SOURCE_DISP='123456789'
  SOURCE_ENTRY='123456789; Erfurt'
    SOURCE_NAME='123456789'
    SOURCE_ADDRESS='Erfurt'
  DEST_DISP='987654321'
  DEST_ENTRY=''
    DEST_NAME=''
    DEST_ADDRESS=''
  ID=1
  EXT=4
  DURATION=16
  TIMESTAMP='31.03.10 11:13'
  PROVIDER=
[0:0] processing rule 'in:dis' '^' '^' '/bin/php /var/media/ftp/uStor01/apache/htdocs/logon.php FROM_NUM=$SOURCE TO_NUM=$DEST IO=0 DURATION=$DURATION'
[0:0] event 'in:disconnect' matches pattern 'in:dis'
[0:0] parameter SOURCE='123456789' matches pattern '^'
[0:0] parameter DEST='987654321' matches pattern '^'
[0:0] SUCCEEDED
[0:0] ACTION: '/bin/php /var/media/ftp/uStor01/apache/htdocs/logon.php FROM_NUM=$SOURCE TO_NUM=$DEST IO=0 DURATION=$DURATION'
X-Powered-By: PHP/5.2.13
Content-type: text/html


PATH=/bin:/usr/bin:/sbin:/usr/sbin
. /usr/lib/libmodcgi.sh

[ -e "/mod/etc/reg/extra.reg" ] || touch /mod/etc/reg/extra.reg

if [ -z "$PATH_INFO" ]; then
	_cgi_extras() {
		if [ -s /mod/etc/reg/extra.reg ]; then
			[ -e /mod/etc/reg/cgi.reg ] || touch /mod/etc/reg/cgi.reg

			cat /mod/etc/reg/extra.reg | while IFS='|' read -r pkg title sec cgi; do
				if [ ! -z "$title" ]; then
					if [ "$cur_pkg" != "$pkg" ]; then
						[ -z "$cur_pkg" ] || echo '</ul>'

						if [ "$pkg" = "mod" ]; then
							echo '<h1>Mod Extras</h1>'
						else
							IFS='|'; set -- $(cat /mod/etc/reg/cgi.reg | grep "^$pkg")
							if [ -z "$2" ]; then echo "<h1>$pkg</h1>"; else echo "<h1>$2</h1>"; fi
						fi

						echo '<ul>'
						cur_pkg="$pkg"
					fi
					echo "<li><a href=\"/cgi-bin/extras.cgi/$pkg/$cgi\">$title</a></li>"
				fi
			done
			echo '</ul>'
		else
			echo '<p><i>keine Extras</i></p>'
		fi
	}

	cgi_begin 'Extras' 'extras'

	[ -e /mod/var/cache/extras ] || _cgi_extras > /mod/var/cache/extras
	cat /mod/var/cache/extras

	cgi_end
else
	OIFS="$IFS"
	IFS='/'
	set -- $(echo "$PATH_INFO" | sed -e 's/\.//g')
	pkg="$2"; cgi="$3"
	IFS='|'
	set -- $(cat /mod/etc/reg/extra.reg | grep "^$pkg|.*|$cgi\$")
	IFS="$OIFS"

	if [ "$sec_level" -gt "$3" ]; then
		cgi_begin 'Extras'
		echo '<h1>Zusatz-Skript</h1>'
		echo '<div style="color: #800000;">Dieses Zusatz-Skript in der aktuellen Sicherheitsstufe nicht verf&uuml;gbar!</div>'
		echo '</p><form action="/cgi-bin/extras.cgi"><input type="submit" value="Zu den Extras"></form></p>'
		cgi_end
	else
		if [ -x "/mod/usr/lib/cgi-bin/$pkg/$cgi.cgi" ]; then
			/mod/usr/lib/cgi-bin/$pkg/$cgi.cgi
		else
			cgi_begin 'Extras'
			echo "<p><b>Fehler:</b> Zusatz-Skript '$cgi.cgi' nicht gefunden.</p>"
			cgi_end
		fi
	fi
fi

Ich kann den Befehl unter Konsole(Telnet) ausführen, und es läuft ohne Probleme.
Code:
/bin/php /var/media/ftp/uStor01/apache/htdocs/lo
gon.php FROM_NUM=123456789 TO_NUM=987654321 IO=0 DURATION=20

X-Powered-By: PHP/5.2.13
Content-type: text/html

Array
(
    [/var/media/ftp/uStor01/apache/htdocs/logon_php] =>
    [FROM_NUM] => 123456789
    [TO_NUM] => 987654321
    [IO] => 0
    [DURATION] => 20
)

5ab7191d25f2e605d55ef57bb9145f6b1f

Ich hab versucht den Befehl auch als Shell Script unter /tmp/flash/callmonitor/actions.local.d/ zu Speichern, es geht aber trotzdem nicht.

Hat jemand Erfahrung damit? Was kann man dagegen tun?
P.S.: Das muss ohne Apache Server funktionieren.

Danke im Voraus!
 
Holen Sie sich 3CX - völlig kostenlos!
Verbinden Sie Ihr Team und Ihre Kunden Telefonie Livechat Videokonferenzen

Gehostet oder selbst-verwaltet. Für bis zu 10 Nutzer dauerhaft kostenlos. Keine Kreditkartendetails erforderlich. Ohne Risiko testen.

3CX
Für diese E-Mail-Adresse besteht bereits ein 3CX-Konto. Sie werden zum Kundenportal weitergeleitet, wo Sie sich anmelden oder Ihr Passwort zurücksetzen können, falls Sie dieses vergessen haben.