PauloTroguilho / php-sip

Automatically exported from code.google.com/p/php-sip
0 stars 0 forks source link

Regular expression error #3

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Comes from the server line:

SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 300.300.300.300:5065;rport;branch=z9hG4bK147927
From: <sip:123@voip.com>;tag=58663
To: <sip:321@voip.com>
Contact: sip:321@400.400.400.400:5060
Call-ID: 870af0acd92fa819239d74897b12d9d3@300.300.300.300
CSeq: 20 INVITE
Server: (Very nice Sip Registrar/Proxy Server)
Allow: ACK,BYE,CANCEL,INVITE,REGISTER,OPTIONS,INFO,MESSAGE
WWW-Authenticate: Digest realm="voip.com",nonce="4039256171",algorithm=MD5
Content-Length: 0

Regular expression does not work, because there is a gap between 
'realm="voip.com",' and 'nonce'

I removed the space, and it worked

Regular expression: preg_match('/^WWW-Authenticate: .* 
nonce="(.*)"/imU',$this->response, $result) in PhpSIP.class.php:1264

Original issue reported on code.google.com by ccc...@gmail.com on 9 Jan 2011 at 12:10