py_pjsua error when registering an account

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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







[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux