[Asterisk-Users] SIP auth failed "wrong pw" but pw is correct

2006-06-12 Thread Mark Drayton

Hi

We've got an Asterisk 1.2.0 (planning to upgrade when I can) which is 
having trouble registering another Asterisk system as a client. We have 
the client in a realtime DB, our client has us configured as a friend and 
also has a register => username:[EMAIL PROTECTED]/username line in his 
sip.conf.

When he starts his system he gets an auth failed log line and we get:

Jun 12 14:42:21 NOTICE[1548]: chan_sip.c:10817 handle_request_register: 
Registration from '' failed for '81.187.x.x' - 
Wrong password

The client has the right username and password.

One difference I've noticed is that the log error says "Registration from 
'' failed for '81.187.x.x'" -- every other 
registration line quotes only the SIP account name, not the whole SIP URI.

This problem does look similar to bug #5103 but the fix should be 
incorporated in Asterisk 1.2.0, I think.

SIP trace:

Sending to 81.187.x.x : 5060 (non-NAT)
Transmitting (NAT) to 81.187.x.x:5060:
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 
81.187.x.x:5060;branch=z9hG4bK26bc6cc8;received=81.187.x.x;rport=5060
From: ;tag=as48322a50
To: 
Call-ID: [EMAIL PROTECTED]
CSeq: 102 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Max-Forwards: 70
Contact: 
Content-Length: 0


---
Transmitting (NAT) to 81.187.x.x:5060:
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 
81.187.x.x:5060;branch=z9hG4bK26bc6cc8;received=81.187.x.x;rport=5060
From: ;tag=as48322a50
To: ;tag=as7592c16c
Call-ID: [EMAIL PROTECTED]
CSeq: 102 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Max-Forwards: 70
Contact: 
WWW-Authenticate: Digest realm="asterisk", nonce="63563ef1"
Content-Length: 0


---
Scheduling destruction of call 
'[EMAIL PROTECTED]' in 15000 ms
sip2*CLI>
<-- SIP read from 81.187.x.x:5060:
REGISTER sip:fdqn.our.host SIP/2.0
Via: SIP/2.0/UDP 81.187.x.x:5060;branch=z9hG4bK06e5ad1f;rport
From: ;tag=as3c9883b7
To: 
Call-ID: [EMAIL PROTECTED]
CSeq: 103 REGISTER
User-Agent: Asterisk PBX
Max-Forwards: 70
Authorization: Digest username="username", realm="asterisk", 
algorithm=MD5, uri="sip:fdqn.our.host", nonce="63563ef1", 
response="d6daaafb77c11357bda9b912b8ce6e02", opaque=""
Expires: 18000
Contact: 
Event: registration
Content-Length: 0


--- (13 headers 0 lines)---
Using latest REGISTER request as basis request
Sending to 81.187.x.x : 5060 (NAT)
Transmitting (NAT) to 81.187.x.x:5060:
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 
81.187.x.x:5060;branch=z9hG4bK06e5ad1f;received=81.187.x.x;rport=5060
From: ;tag=as3c9883b7
To: 
Call-ID: [EMAIL PROTECTED]
CSeq: 103 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Max-Forwards: 70
Contact: 
Content-Length: 0


---
Transmitting (NAT) to 81.187.x.x:5060:
SIP/2.0 403 Forbidden (Bad auth)
Via: SIP/2.0/UDP 
81.187.x.x:5060;branch=z9hG4bK06e5ad1f;received=81.187.x.x;rport=5060
From: ;tag=as3c9883b7
To: ;tag=as7592c16c
Call-ID: [EMAIL PROTECTED]
CSeq: 103 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Max-Forwards: 70
Contact: 
Content-Length: 0

Any ideas?

Cheers,

Mark

This message and any attachment are confidential and may be privileged or
otherwise protected from disclosure.  If you are not the intended
recipient, please telephone or email the sender and delete this message
and any attachment(s) from your system and do not disclose its contents to any
third parties.
___
--Bandwidth and Colocation provided by Easynews.com --

Asterisk-Users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [Asterisk-Users] Duplicate CDRs

2006-06-05 Thread Mark Drayton






"Kevin P. Fleming"
<[EMAIL PROTECTED]> 
Sent by: [EMAIL PROTECTED]
05/06/2006 14:48



Please respond to
Asterisk Users Mailing List - Non-Commercial Discussion 





To
Asterisk Users Mailing List - Non-Commercial
Discussion 


cc



Subject
Re: [Asterisk-Users] Duplicate CDRs









----- Mark Drayton <[EMAIL PROTECTED]> wrote:

> > How can I configure asterisk not to log to .csv
at all
> > and 
> > only log the 18-field line (ie, with uniqueid and userfield)
to 
> > Master.csv? I just want everything in one file, one line per
record.

> You have both cdr_csv and cdr_custom loaded, with cdr_custom configured
to write into Master.csv. Asterisk is doing exactly what you told >
it to do... write the CDR twice into Master.csv.

> If you only want one of them, load the module for the one you want
and don't load the other one.

Okay. Which one writes the 18-field line (with uniqueid
and userfield)?cdr_custom.conf has fields for these two but the wiki docs
also say that cdr_csv will write uniqueid and userfield if configured.
Can I just unload whichever one I don't need to stop it writing or do I
need to reload the logging/cdr system? Presumably cdr_csv that writes accountcode.csv
as cdr_custom specifies Master.csv. 

Can I set enabled=no in cdr_manager.conf if I just
want plain CDRs? Can I unload that module?

Sorry for the questions; there's not a great deal
of documentation on how this hangs together.

Thanks,

-- 

Mark Drayton
Frontier Systems
0207 420 4242


This message and any attachment are confidential and may be privileged or
otherwise protected from disclosure.  If you are not the intended
recipient, please telephone or email the sender and delete this message
and any attachment(s) from your system and do not disclose its contents to any
third parties.
___
--Bandwidth and Colocation provided by Easynews.com --

Asterisk-Users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


[Asterisk-Users] Duplicate CDRs

2006-06-05 Thread Mark Drayton

Hi

For whatever reason we've getting 2 or 3 CDR lines logged for each call, 
often in different formats:

as1:~# grep test-89-1e2c /var/log/asterisk/cdr-csv/*.csv
/var/log/asterisk/cdr-csv/67.csv:"67","88","89","test-context","88","SIP/test-88-2dae","SIP/test-89-1e2c","Dial","SIP/test-89|20","2006-06-05
 
11:41:31",,"2006-06-05 11:41:35",4,0,"NO ANSWER","DOCUMENTATION"
/var/log/asterisk/cdr-csv/Master.csv:"88","88","89","test-context","SIP/test-88-2dae","SIP/test-89-1e2c","Dial","SIP/test-89|20","2006-06-05
 
11:41:31","","2006-06-05 11:41:35","4","0","NO 
ANSWER","DOCUMENTATION","67","1149504091.85534","INT_CALL"
/var/log/asterisk/cdr-csv/Master.csv:"67","88","89","test-context","88","SIP/test-88-2dae","SIP/test-89-1e2c","Dial","SIP/test-89|20","2006-06-05
 
11:41:31",,"2006-06-05 11:41:35",4,0,"NO ANSWER","DOCUMENTATION"

How can I configure asterisk not to log to .csv at all and 
only log the 18-field line (ie, with uniqueid and userfield) to 
Master.csv? I just want everything in one file, one line per record.

cdr.conf has only a '[general]' line -- nothing else.

cdr_custom.conf:

[mappings]
Master.csv => 
"${CDR(clid)}","${CDR(src)}","${CDR(dst)}","${CDR(dcontext)}","${CDR(channel)}","${CDR(dstchannel)}","${CDR(lastapp)}","${CDR(lastdata)}","${CDR(start)}","${CDR(answer)}","${CDR(end)}","${CDR(duration)}","${CDR(billsec)}","${CDR(disposition)}","${CDR(amaflags)}","${CDR(accountcode)}","${CDR(uniqueid)}","${CDR(userfield)}"

cdr_manager.conf

[general]
enabled = yes

as1*CLI> cdr status
CDR logging: enabled
CDR mode: simple
CDR registered backend: cdr-custom
CDR registered backend: cdr_manager
CDR registered backend: csv

Any ideas?

Thanks,

-- 

Mark Drayton
Frontier Systems
0207 420 4242


This message and any attachment are confidential and may be privileged or
otherwise protected from disclosure.  If you are not the intended
recipient, please telephone or email the sender and delete this message
and any attachment(s) from your system and do not disclose its contents to any
third parties.
___
--Bandwidth and Colocation provided by Easynews.com --

Asterisk-Users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


[Asterisk-Users] SQL update failing/long fullcontact

2006-04-25 Thread Mark Drayton

Hi

We have some users who are supplying
very long, broken contact details (from Cisco 7912 phones):

  Apr 25 11:29:46 WARNING[1480]
chan_sip.c: No closing bracket found in '1st Floor Scanner - 137 
  Apr 25 11:29:46 NOTICE[1480]
chan_sip.c: '1st Floor Scanner - 137 

Any ideas how to stop this? Most of
the time it's harmless but some make the SQL queries so long they overflows
sql in res_config.c:

static struct ast_variable *realtime_mysql(..)
{
  char sql[256];
  ..
  snprintf(sql, sizeof(sql), "SELECT
* FROM %s WHERE %s%s '%s'", table, newparam, op, newval);
  ..
}

then:

  Apr 25 11:29:46 DEBUG[1480] res_config_mysql.c:
MySQL RealTime: Update SQL: UPDATE sip SET ipaddr = 'yyy.yy.yyy.yyy', port
= '25766', regseconds = '1145963986', username = '1st Floor Scanner - 137


The query is 257 bytes so the last quote
is truncated and the update fails.

Should I submit a patch? If nothing
else it'd be nice to check that the query fits into sql and complain if
it doesn't.

Cheers,

Mark Drayton
This message and any attachment are confidential and may be privileged or
otherwise protected from disclosure.  If you are not the intended
recipient, please telephone or email the sender and delete this message
and any attachment(s) from your system and do not disclose its contents to any
third parties.
___
--Bandwidth and Colocation provided by Easynews.com --

Asterisk-Users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users