[pjsip] py_pjsua error when registering an account

Gideon Klompje gideonk at bizcall.co.za
Tue Sep 18 02:43:56 EDT 2007


No problems, at least you know there is at least one person interested
in the Python section.  I really appreciate all your help so far, Benny.
Thanks for the quick responses.  I can now do what I set out to do,
which is to monitor the status of phones registered to an Asterisk
server from within my existing Python PBX management framework.

_____________ 
Gideon Klompje
Engineer
BizCall 
Subsidiary of Vox Telecom Limited
Block B, Rutherford Estate
1 Scott Street
Waverley
tel: +27 800 BIZCALL
direct: +27 11 809 1656
mobile: +27 84 560 0200
fax: +27 86 524 2014
email: gideonk at bizcall.co.za
http://www.bizcall.co.za 

Disclaimer: BizCall does not accept responsibility or liability for the
unauthorised use of its e-mail facility and/or opinions relating to bona
fide company matters.  Save for statements and/or opinions relating to
bona fide company matters, Bizcall denies responsibility or liability
for the contents of this communication.

-----Original Message-----
From: pjsip-bounces at lists.pjsip.org
[mailto:pjsip-bounces at lists.pjsip.org] On Behalf Of Benny Prijono
Sent: 17 September 2007 05:46 PM
To: pjsip embedded/DSP SIP discussion
Subject: Re: [pjsip] py_pjsua error when registering an account

Gideon Klompje wrote:
> Hi,
> 
> It seems there's a problem when adding a new SIP account.  The code 
> snippet (from "pjsua_app.py", which is pretty much what I use as a 
> template for registration purposes) is:
> 
> # Configure account configuration
> acc_cfg = py_pjsua.acc_config_default()
> acc_cfg.id = "sip:" + acc_username + "@" + acc_domain
> acc_cfg.reg_uri = "sip:" + acc_domain
> acc_cfg.cred_count = 1
> 
>  
> 
> This gives the following error:
> 
>             AttributeError: 'py_pjsua.Acc_Config' object has no 
> attribute 'cred_count'
> 
> My code follows pretty much the same layout as "pjsua_app.py", which 
> gives the above error.  Is this a bug in the "py_pjsua" module, or
does 
> "pjsua_app.py" just not reflect some change in the source?


It's kind of both; I did made major change to the Python module to
make it more Python-ish, but I've got to admit I didn't do that much
QA (hey, I didn't know anybody is interested with it!).

Anyway, it's fixed now in r1438. So now most of the "xx_count"
fields are gone, since that's sooo not Python. The way to add
credential to account config is by using something like this:

	cred_info = py_pjsua.Pjsip_Cred_Info()
	cred_info.realm = "*"
	cred_info.scheme = "digest"
	cred_info.username = acc_username
	cred_info.data_type = 0
	cred_info.data = acc_passwd

	acc_cfg.cred_info.append(1)
	acc_cfg.cred_info[0] = cred_info

Sorry again.

  -benny





_______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip at lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org




More information about the pjsip mailing list