SCRL_MODE_OUT=0&DATEALLOCATED=2011-11-16&EMAIL=XXX&LOCALIZATIONTYPE=30&LISTEN=0&RPCID=320339&H_OUTPROFILID=2&CTID=6&FWD_UNC_NAT=3&H_ABOPROFILID=3&CAWONESHOT=1&MFWD_TIMER1=5&FWD_NRPTIMEOUT=5&RPCALLINGNAT=3&RANGEID=10&FWD_BUSY_NAT=255&MUSICONWAIT=0&FWD_UNC_ON=0&ACR_ON=0&NAT_CARRIER_ON=0&COMPID=3&EXPIRY_TIME_DST=0&NRPORIGNAT=255&RINGBACKTONE=0&SITEID=-1&LOCATION_NUM=XXX&LOCATION_NAT=255&MFWD_MODE=0&FWD_NRP_NUM=XXX&SWITCHID=1&MFWD_NUM2=XXX&RPCALLINGDATE=2014-10-15&FWD_NRP_ON=0&ACCESSPARID=21&NRPCALLEDNAT=3&ICBPROFILID=-1&H_FWDPROFILID=2&MFWD_NUM1=XXX&NAME=lab_number&FWD_BUSY_ON=0&BUILDINGNUMBER=11&H_SUSPEND=0&LATF_TIMER=0&RPORIGNAT=0&NRPRGCALLEDNUM=XXX&AAB_ON=0&H_INPROFILID=2&H_SPECNUMZONEID=9999&RPCALLINGTIME=10.41.48&NETWORK_NUM=XXX&CIVIL=0&NRPRGCALLEDNAT=255&MFWD_TIMER2=5&NETWORK_NAME=XXX&NRPCALLINGNUM=15141858665&IN_APPLICAB=0&BUILDINGCHAR=&MFWD_TIMER3=5&EXPIRY_DATE=2014-10-28&NRPCID=0&SCRL_MODE_IN=0&H_CFBACKUP_ON=0&MOBILENUM=XXX&DOMAIN=sip.berlin.registrar.de&COLR_ON=0&ICAC=0&NRPCALLEDNUM=11833&MWI_IND=0&FWD_BUSY_NUM=XXX&IPAD_ON=0&LATF_NAT=255&LATF_NUM=XXX&MFWD_NAT2=255&BIS_NAT=3&NRPORIGNUM=XXX&LISTEN_TRUNK=XXX&RPCALLINGNUM=3066765110&RPCLIR=0&LOG=493092038888&SIP_PREF_ON=0&MFWD_NAT4=255&MUSICONHOLD=0&CADRINGING=0&H_CFBACKUP_NUM=XXX&PATH=XXX&ADMINLEVEL=0&LISTEN_NUM=XXX&LISTEN_NAT=255&LOCK_ON=0&NRPCALLINGNAT=3&ACCESSNAME=SIP&MFWD_NUM3=XXX&FWD_UNC_NUM=15114534613&NRPCALLING_IND=149&MOBILENAT=255&SERVICES_LOCK=0&MFWD_TIMER4=5&NRPCALLINGTIME=11.40.25&GIVENNAME=XXX&LOCK_CODE=0000&NRPCLIR=0&SCRL_CODE_OUT=0000&BIS_NUM=1719500359&STREETNAME=Checkpoint&FWD_NRP_NAT=255&CONNECTINBAND=0&DATACALL_ON=1&NRPCALLINGDATE=2014-10-17&EXTENSIONNUM=3092038888&MFWD_NAT1=255&GROUPID=2&EXTENSIONNAT=3&ADMIN_STATE=0&SWITCHID_BCKUP=-1&NETWORK_NAT=255&MFWD_NAT3=255&CAW_ON=0&VENDORID=D167&POSTALCODE=10409&ACCESSTYPE=3&CLIR_ON=0&USERNAME=schneiderLogin&MFWD_NUM4=XXX&H_ACCOUNTID=1&H_CFBACKUP_NAT=255&H_LANGUAGE=DE&FPAD_ON=0&OCBPROFILID=-1&INTERCOM_AUTH=0&RPCALLINGDUR=4&EXPIRY_TIME=11.29.29&INT_CARRIER_ON=0&RPORIGNUM=XXX&PWD=GBWoZcT9o1bIwKotyxz083FA&NCAC=0&DND_ON=0
my %DB_data = split(/&/,$DB_Resp);
1
2
3
4
5
6
7
my $sipPW;
foreach my $key ( keys %DB_data){
if ($key =~ /PWD/){
$sipPW = $_;
}
}
print "PWD: $sipPW\n";
$sipPW = $_;
split(/&|=/,$DB_Resp)
my %DB_data = split(/&|=/,$DB_Resp);
my %DB_data = map {split /=/} split(/&/,$DB_Resp);
SCRL_MODE_OUT=0&CONTACT=<sip:493092035000@192.168.2.100:5060;uniq=54E80A53007C28E6E3E0F09601A01>&DATEALLOCATED=2014-05-07&EMAIL=user1@berlin.de&LOCALIZATIONTYPE=30&LISTEN=0&RPCID=132969&H_OUTPROFILID=2&CTID=6&FWD_UNC_NAT=255&H_ABOPROFILID=3&CAWONESHOT=1&MFWD_TIMER1=5&FWD_NRPTIMEOUT=5&RPCALLINGNAT=3&RANGEID=184731&FWD_BUSY_NAT=255&MUSICONWAIT=0&FWD_UNC_ON=0&ACR_ON=0&NAT_CARRIER_ON=0&COMPID=3&EXPIRY_TIME_DST=0&NRPORIGNAT=255&RINGBACKTONE=0&SITEID=-1&LOCATION_NUM=XXX&LOCATION_NAT=255&MFWD_MODE=0&FWD_NRP_NUM=XXX&SWITCHID=1&MFWD_NUM2=XXX&RPCALLINGDATE=2014-10-27&FWD_NRP_ON=0&ACCESSPARID=12&NRPCALLEDNAT=3&ICBPROFILID=-1&H_FWDPROFILID=2&MFWD_NUM1=XXX&NAME=Schneider,Christian&FWD_BUSY_ON=0&BUILDINGNUMBER=23&H_SUSPEND=0&LATF_TIMER=0&RPORIGNAT=0&NRPRGCALLEDNUM=XXX&AAB_ON=0&H_INPROFILID=2&H_SPECNUMZONEID=11&RPCALLINGTIME=13.10.48&NETWORK_NUM=XXX&CIVIL=0&NRPRGCALLEDNAT=255&MFWD_TIMER2=5&NETWORK_NAME=XXX&NRPCALLINGNUM=1736011533&IN_APPLICAB=0&BUILDINGCHAR=&MFWD_TIMER3=5&EXPIRY_DATE=2014-10-28&NRPCID=0&SCRL_MODE_IN=0&H_CFBACKUP_ON=0&MOBILENUM=01727501030&DOMAIN=sip.berlin.registrar.de&COLR_ON=0&ICAC=0&NRPCALLEDNUM=1756333085&MWI_IND=0&FWD_BUSY_NUM=XXX&IPAD_ON=0&LATF_NAT=255&LATF_NUM=XXX&MFWD_NAT2=255&BIS_NAT=3&NRPORIGNUM=XXX&LISTEN_TRUNK=XXX&RPCALLINGNUM=303935399&RPCLIR=0&LOG=49tmpuser&SIP_PREF_ON=0&MFWD_NAT4=255&MUSICONHOLD=0&CADRINGING=0&H_CFBACKUP_NUM=XXX&PATH=XXX&ADMINLEVEL=0&LISTEN_NUM=XXX&LISTEN_NAT=255&LOCK_ON=0&NRPCALLINGNAT=3&ACCESSNAME=SIP&MFWD_NUM3=XXX&FWD_UNC_NUM=XXX&NRPCALLING_IND=8&MOBILENAT=3&SERVICES_LOCK=0&MFWD_TIMER4=5&NRPCALLINGTIME=14.58.12&GIVENNAME=XXX&LOCK_CODE=0000&NRPCLIR=0&SCRL_CODE_OUT=0000&BIS_NUM=8002666111&STREETNAME=Emdner Str.&FWD_NRP_NAT=255&CONNECTINBAND=0&DATACALL_ON=1&NRPCALLINGDATE=2014-09-01&EXTENSIONNUM=3092036010&MFWD_NAT1=255&GROUPID=2&EXTENSIONNAT=3&ADMIN_STATE=0&SWITCHID_BCKUP=-1&NETWORK_NAT=255&MFWD_NAT3=255&CAW_ON=0&VENDORID=D167&POSTALCODE=10551&ACCESSTYPE=3&CLIR_ON=0&USERNAME=tmpuser&MFWD_NUM4=XXX&H_ACCOUNTID=4711&H_CFBACKUP_NAT=255&H_LANGUAGE=DE&FPAD_ON=0&OCBPROFILID=-1&INTERCOM_AUTH=0&RPCALLINGDUR=170&EXPIRY_TIME=14.00.05&INT_CARRIER_ON=0&RPORIGNUM=XXX&PWD=zSn75jZUUsDKXDLN123dsvre&NCAC=0&DND_ON=0
%hash = map{split /=/, $_, 2} split/&/, $dbresult;
1 2 3 4 5 6 7 8 9 10 11 12 13
use strict; use warnings; use Data::Dumper; use CGI; my $str = q(SCRL_MODE_OUT=0&DATEALLOCATED=2011-11-16&EMAIL=XXX&LOCALIZATIONTYPE=30&LISTEN=0&RPCID=320339&H_OUTPROFILID=2&CTID=6&FWD_UNC_NAT=3&H_ABOPROFILID=3&CAWONESHOT=1&MFWD_TIMER1=5&FWD_NRPTIMEOUT=5&RPCALLINGNAT=3&RANGEID=10&FWD_BUSY_NAT=255&MUSICONWAIT=0&FWD_UNC_ON=0&ACR_ON=0&NAT_CARRIER_ON=0&COMPID=3&EXPIRY_TIME_DST=0&NRPORIGNAT=255&RINGBACKTONE=0&SITEID=-1&LOCATION_NUM=XXX&LOCATION_NAT=255&MFWD_MODE=0&FWD_NRP_NUM=XXX&SWITCHID=1&MFWD_NUM2=XXX&RPCALLINGDATE=2014-10-15&FWD_NRP_ON=0&ACCESSPARID=21&NRPCALLEDNAT=3&ICBPROFILID=-1&H_FWDPROFILID=2&MFWD_NUM1=XXX&NAME=lab_number&FWD_BUSY_ON=0&BUILDINGNUMBER=11&H_SUSPEND=0&LATF_TIMER=0&RPORIGNAT=0&NRPRGCALLEDNUM=XXX&AAB_ON=0&H_INPROFILID=2&H_SPECNUMZONEID=9999&RPCALLINGTIME=10.41.48&NETWORK_NUM=XXX&CIVIL=0&NRPRGCALLEDNAT=255&MFWD_TIMER2=5&NETWORK_NAME=XXX&NRPCALLINGNUM=15141858665&IN_APPLICAB=0&BUILDINGCHAR=&MFWD_TIMER3=5&EXPIRY_DATE=2014-10-28&NRPCID=0&SCRL_MODE_IN=0&H_CFBACKUP_ON=0&MOBILENUM=XXX&DOMAIN=sip.berlin.registrar.de&COLR_ON=0&ICAC=0&NRPCALLEDNUM=11833&MWI_IND=0&FWD_BUSY_NUM=XXX&IPAD_ON=0&LATF_NAT=255&LATF_NUM=XXX&MFWD_NAT2=255&BIS_NAT=3&NRPORIGNUM=XXX&LISTEN_TRUNK=XXX&RPCALLINGNUM=3066765110&RPCLIR=0&LOG=493092038888&SIP_PREF_ON=0&MFWD_NAT4=255&MUSICONHOLD=0&CADRINGING=0&H_CFBACKUP_NUM=XXX&PATH=XXX&ADMINLEVEL=0&LISTEN_NUM=XXX&LISTEN_NAT=255&LOCK_ON=0&NRPCALLINGNAT=3&ACCESSNAME=SIP&MFWD_NUM3=XXX&FWD_UNC_NUM=15114534613&NRPCALLING_IND=149&MOBILENAT=255&SERVICES_LOCK=0&MFWD_TIMER4=5&NRPCALLINGTIME=11.40.25&GIVENNAME=XXX&LOCK_CODE=0000&NRPCLIR=0&SCRL_CODE_OUT=0000&BIS_NUM=1719500359&STREETNAME=Checkpoint&FWD_NRP_NAT=255&CONNECTINBAND=0&DATACALL_ON=1&NRPCALLINGDATE=2014-10-17&EXTENSIONNUM=3092038888&MFWD_NAT1=255&GROUPID=2&EXTENSIONNAT=3&ADMIN_STATE=0&SWITCHID_BCKUP=-1&NETWORK_NAT=255&MFWD_NAT3=255&CAW_ON=0&VENDORID=D167&POSTALCODE=10409&ACCESSTYPE=3&CLIR_ON=0&USERNAME=schneiderLogin&MFWD_NUM4=XXX&H_ACCOUNTID=1&H_CFBACKUP_NAT=255&H_LANGUAGE=DE&FPAD_ON=0&OCBPROFILID=-1&INTERCOM_AUTH=0&RPCALLINGDUR=4&EXPIRY_TIME=11.29.29&INT_CARRIER_ON=0&RPORIGNUM=XXX&PWD=GBWoZcT9o1bIwKotyxz083FA&NCAC=0&DND_ON=0); my $p = CGI->new($str); print Dumper $p->param('PWD'); # das gibt aus: $VAR1 = 'GBWoZcT9o1bIwKotyxz083FA';
2014-10-28T14:12:36 RaubtierPasst hier aber nicht 100% richtig. Dein Code liefert bei dem Key CONTACT nicht den gesamten String zurück (mehrfache =-Zeichen).
2014-10-28T16:38:11 clmsRaubtier bezog sich auf den zweiten Beispielstring (aus cohamas Message von 13:41 Uhr). Da gibt es CONTACT.
2014-10-28T17:07:51 rostiHä? Ich verwende Perl-Programme und -Scripte, um wiederkehrende Aufgaben zu automatisieren. :-) Wenn ich für jeden Eingabestring erst den Parser umschreiben muss, kann ich den String auch gleich per Hand zerlegen. :-(Wenn Du einen anderen String hast, musst Du einen anderen Parser verwenden.