[Home]

Summary:ASTERISK-24520: [patch]res_pjsip_phoneprov_provider.so has no realtime backend support
Reporter:John Kiniston (johnkiniston)Labels:
Date Opened:2014-11-13 18:17:11.000-0600Date Closed:2014-12-03 16:02:48.000-0600
Priority:MinorRegression?
Status:Closed/CompleteComponents:Resources/res_phoneprov
Versions:13.0.0 Frequency of
Occurrence
Related
Issues:
is duplicated byASTERISK-24519 res_pjsip_phoneprov_provider doesn't get config from realtime.
is related toASTERISK-24532 res_phoneprov should automatically pull new phones from providers
Environment:Attachments:
Description:There is no current way to configure res_pjsip_phoneprov_provider.so using realtime.
Comments:By: George Joseph (gjoseph) 2014-11-13 18:27:54.303-0600

Patch uploaded to review board.

By: George Joseph (gjoseph) 2014-11-14 10:03:21.367-0600

John,

One of the other developers pointed out that this should already work.  You just need to put a section in sorcery.conf for the module...

[res_pjsip_phoneprov_provider]
phoneprov=<your backend>
phoneprov=config,pjsip.conf,criteria=type=phoneprov

Give it a try and let me know.




By: John Kiniston (johnkiniston) 2014-11-14 10:49:39.358-0600

I applied the patch and added the config section you listed, Should I back out the patch and try it as it's not working?

sorcery.conf:
[res_pjsip_phoneprov_provider]
phoneprov=realtime,ps_phoneprov
phoneprov=config,pjsip.conf,criteria=type=phoneprov

extconfig.conf:
ps_phoneprov => odbc,asterisk

sb-wk-sales05*CLI> module load res_pjsip_phoneprov_provider.so
Unable to load module res_pjsip_phoneprov_provider.so
Command 'module load res_pjsip_phoneprov_provider.so' failed.
 == Parsing '/etc/asterisk/sorcery.conf': Found
 == Parsing '/etc/asterisk/sorcery.conf': Found
 == Parsing '/etc/asterisk/pjsip.conf': Found
 == Parsing '/etc/asterisk/pjsip.conf': Found
[Nov 14 09:49:07] ERROR[5596]: res_pjsip_phoneprov_provider.c:298 load_users: Unable to find any phoneprov users.
[Nov 14 09:49:07] ERROR[5596]: res_phoneprov.c:1549 ast_phoneprov_provider_register: Unable to load provider 'res_pjsip_phoneprov_provider' users. Register aborted.
Unegistered phoneprov provider 'res_pjsip_phoneprov_provider'.
[Nov 14 09:49:07] ERROR[5596]: res_pjsip_phoneprov_provider.c:391 load_module: Unable to register pjsip phoneprov provider.



By: George Joseph (gjoseph) 2014-11-14 10:56:45.859-0600

The patch just duplicates something but back it out to be safe.  
Leave the config section in sorcery.conf and add 1 dummy phoneprov in pjsip.conf and see if it at least picks that up.

Can you share the layout of ps_phoneprov so I can try it?





By: John Kiniston (johnkiniston) 2014-11-14 11:17:43.399-0600

It doesn't create the entry I have added in pjsip.conf by hand:
[0004f21d19b1]
type=phoneprov
endpoint=7003
MAC=0004f21d19b1
PROFILE=polycom
LINE=1
LABEL=7003

Command 'module load res_pjsip_phoneprov_provider.so ' failed.
 == Parsing '/etc/asterisk/sorcery.conf': Found
[Nov 14 10:17:11] ERROR[10658]: res_pjsip_phoneprov_provider.c:382 load_module: Unable to register object phoneprov.

mysql> describe ps_phoneprov;
+----------+-------------+------+-----+-----------+-------+
| Field    | Type        | Null | Key | Default   | Extra |
+----------+-------------+------+-----+-----------+-------+
| type     | varchar(9)  | NO   |     | phoneprov |       |
| endpoint | varchar(14) | NO   |     | NULL      |       |
| MAC      | varchar(12) | NO   |     | NULL      |       |
| PROFILE  | varchar(20) | NO   |     | polycom   |       |
| LINE     | int(1)      | NO   |     | 1         |       |
| LABEL    | varchar(12) | NO   |     | NULL      |       |
+----------+-------------+------+-----+-----------+-------+
6 rows in set

mysql> select * from ps_phoneprov;
+-----------+----------+--------------+---------+------+-------+
| type      | endpoint | MAC          | PROFILE | LINE | LABEL |
+-----------+----------+--------------+---------+------+-------+
| phoneprov | 7001     | 0004f21cb497 | polycom |    1 | 7001  |
| phoneprov | 7000     | 0004f21d19b0 | polycom |    1 | 7000  |
+-----------+----------+--------------+---------+------+-------+
2 rows in set


By: George Joseph (gjoseph) 2014-11-14 11:21:28.539-0600

Ok, I'm investigating.


By: George Joseph (gjoseph) 2014-11-14 19:00:36.258-0600

New patch posted in https://reviewboard.asterisk.org/r/4185/

John,  you also have an issue in the table definition...  The 'type' field needs to be replaced with 'id' and set to the unique id of the phoneprov object.  I.E. what would normally be in the [id] in pjsip.conf.



By: John Kiniston (johnkiniston) 2014-11-14 19:10:02.280-0600

I'll check it Monday when I'm back with my VM, Didin't think to transfer it to my laptop for the weekend.

Thanks for the tip, I wasn't sure what my table needed to be defined as so I winged it.

By: John Kiniston (johnkiniston) 2014-11-17 10:31:40.237-0600

I modified my table to add the ID field as a unique int and applied the latest patch.

I'm now seeing phones get created when I reload res_phoneprov.so

sb-wk-sales05*CLI> module reload res_phoneprov.so
Module 'res_phoneprov.so' reloaded successfully.
   -- Reloading module 'res_phoneprov.so' (HTTP Phone Provisioning)
 == Parsing '/etc/asterisk/phoneprov.conf': Found
Reloading provider 'res_pjsip_phoneprov_provider' users.
Created 7001/0004f21cb497 for provider 'res_pjsip_phoneprov_provider'.
Created 7000/0004f21d19b0 for provider 'res_pjsip_phoneprov_provider'.
Created 7002/0004f21d19b1 for provider 'res_pjsip_phoneprov_provider'.
Created 7003/0004F2261726 for provider 'res_pjsip_phoneprov_provider'.
Reloading provider 'sipusers' users.
 == Parsing '/etc/asterisk/phoneprov.conf': Found
 == Parsing '/etc/asterisk/sip.conf': Found
 == Parsing '/etc/asterisk/users.conf': Found
 == Parsing '/etc/asterisk/users.conf': Found

Should it pick up new phones automatically or will I still need to do a reload every time I add/modify one?

By: George Joseph (gjoseph) 2014-11-17 10:44:17.977-0600

For now you have to reload res_phoneprov because nothing tells it to ask res_pjsip_phoneprov_provider for new phones.   Open a new issue with a title like "Have res_phoneprov automatically pull new phones from providers" and post the issue number.  I'll work on it over the next week or so.




By: Rusty Newton (rnewton) 2014-12-03 15:54:23.402-0600

Linking to ASTERISK-24532

By: Rusty Newton (rnewton) 2014-12-03 16:02:48.441-0600

Fix committed in revision 428569 - by [~gtj]