Re: [asterisk-dev] [Code Review] 3976: New module: res_pjsip_phoneprov_provider provides the integration between res_pjsip and res_phoneprov.

2014-10-09 Thread George Joseph

---
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3976/
---

(Updated Oct. 9, 2014, 3:34 p.m.)


Status
--

This change has been marked as submitted.


Review request for Asterisk Developers.


Changes
---

Committed in revision 425007


Repository: Asterisk


Description
---

This module allows res_pjsip to integrate with res_phoneprov and depends on the 
res_phoneprov refactor (r3970).

A new pjsip.conf object is defined by this module...

;EXAMPLE PHONEPROV CONFIGURATION

; Before configuring provisioning here, see the documentation for res_phoneprov
; and configure phoneprov.conf appropriately.

; For each user to be autoprovisioned, a [phoneprov] configuration section
; must be created.  At a minimum, the 'type', 'PROFILE' and 'MAC' variables must
; be set.  All other variables are optional.
; Example:

;[1000]
;type=phoneprov   ; must be specified as 'phoneprov'
;endpoint=1000; Required only if automatic setting of
  ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
  ; are needed.
;PROFILE=digium   ; required
;MAC=deadbeef4dad ; required
;SERVER=myserver.example.com  ; A standard variable
;TIMEZONE=America/Denver  ; A standard variable
;MYVAR=somevalue  ; A user confdigured variable

; If the phoneprov sections have common variables, it is best to create a
; phoneprov template.  The example below will produce the same configuration
; as the one specified above except that MYVAR will be overridden for
; the specific user.
; Example:

;[phoneprov_defaults](!)
;type=phoneprov   ; must be specified as 'phoneprov'
;PROFILE=digium   ; required
;SERVER=myserver.example.com  ; A standard variable
;TIMEZONE=America/Denver  ; A standard variable
;MYVAR=somevalue  ; A user configured variable

;[1000](phoneprov_defaults)
;endpoint=1000; Required only if automatic setting of
  ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
  ; are needed.
;MAC=deadbeef4dad ; required
;MYVAR=someOTHERvalue ; A user confdigured variable

; To have USERNAME and SECRET automatically set, the endpoint
; specified here must in turn have an outbound_auth section defined.

; Fuller example:

;[1000]
;type=endpoint
;outbound_auth=1000-auth
;callerid=My Name 8005551212
;transport=transport-udp-nat

;[1000-auth]
;type=auth
;auth_type=userpass
;username=myname
;password=mysecret

;[phoneprov_defaults](!)
;type=phoneprov   ; must be specified as 'phoneprov'
;PROFILE=someprofile  ; required
;SERVER=myserver.example.com  ; A standard variable
;TIMEZONE=America/Denver  ; A standard variable
;MYVAR=somevalue  ; A user configured variable

;[1000](phoneprov_defaults)
;endpoint=1000; Required only if automatic setting of
  ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
  ; are needed.
;MAC=deadbeef4dad ; required
;MYVAR=someUSERvalue  ; A user confdigured variable
;LABEL=1000   ; A standard variable
 
; The previous sections would produce a template substitution map as follows:

;MAC=deadbeef4dad   ;added by pp1000
;USERNAME=myname;automatically added by 1000-auth username
;SECRET=mysecret;automatically added by 1000-auth password
;PROFILE=someprofile;added by defaults
;SERVER=myserver.example.com;added by defaults
;SERVER_PORT=5060   ;added by defaults
;MYVAR=someUSERvalue;added by defaults but overdidden by user
;CALLERID=8005551212;automatically added by 1000 callerid
;DISPLAY_NAME=My Name   ;automatically added by 1000 callerid
;TIMEZONE=America/Denver;added by defaults
;TZOFFSET=252100;automatically calculated by res_phoneprov
;DST_ENABLE=1   ;automatically calculated by res_phoneprov
;DST_START_MONTH=3  ;automatically calculated by res_phoneprov
;DST_START_MDAY=9   ;automatically calculated by res_phoneprov
;DST_START_HOUR=3   ;automatically calculated by res_phoneprov
;DST_END_MONTH=11   ;automatically calculated by res_phoneprov
;DST_END_MDAY=2 ;automatically calculated by res_phoneprov
;DST_END_HOUR=1 ;automatically calculated by res_phoneprov
;ENDPOINT_ID=1000   ;automatically added by this module
;AUTH_ID=1000-auth  ;automatically added by this module
;TRANSPORT_ID=transport-udp-nat ;automatically added by this module
;LABEL=1000 ;added by user


Diffs
-

  

Re: [asterisk-dev] [Code Review] 3976: New module: res_pjsip_phoneprov_provider provides the integration between res_pjsip and res_phoneprov.

2014-09-30 Thread rmudgett

---
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3976/#review13408
---



branches/12/res/res_pjsip_phoneprov_provider.c
https://reviewboard.asterisk.org/r/3976/#comment23909

filenamepjsip.conf/filename



branches/12/res/res_pjsip_phoneprov_provider.c
https://reviewboard.asterisk.org/r/3976/#comment23908

Shouldn't this be static?



branches/12/res/res_pjsip_phoneprov_provider.c
https://reviewboard.asterisk.org/r/3976/#comment23907

var is not checked for NULL allocation failure



branches/12/res/res_pjsip_phoneprov_provider.c
https://reviewboard.asterisk.org/r/3976/#comment23905

auth doesn't need to be a RAII_VAR as there is only one place where the 
cleanup would have any effect.



branches/12/res/res_pjsip_phoneprov_provider.c
https://reviewboard.asterisk.org/r/3976/#comment23903

pp is ref leaked
i iterator is not destroyed



branches/12/res/res_pjsip_phoneprov_provider.c
https://reviewboard.asterisk.org/r/3976/#comment23904

stray blank line


- rmudgett


On Sept. 18, 2014, 7:55 p.m., George Joseph wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://reviewboard.asterisk.org/r/3976/
 ---
 
 (Updated Sept. 18, 2014, 7:55 p.m.)
 
 
 Review request for Asterisk Developers.
 
 
 Repository: Asterisk
 
 
 Description
 ---
 
 This module allows res_pjsip to integrate with res_phoneprov and depends on 
 the res_phoneprov refactor (r3970).
 
 A new pjsip.conf object is defined by this module...
 
 ;EXAMPLE PHONEPROV CONFIGURATION
 
 ; Before configuring provisioning here, see the documentation for 
 res_phoneprov
 ; and configure phoneprov.conf appropriately.
 
 ; For each user to be autoprovisioned, a [phoneprov] configuration section
 ; must be created.  At a minimum, the 'type', 'PROFILE' and 'MAC' variables 
 must
 ; be set.  All other variables are optional.
 ; Example:
 
 ;[1000]
 ;type=phoneprov   ; must be specified as 'phoneprov'
 ;endpoint=1000; Required only if automatic setting of
   ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
   ; are needed.
 ;PROFILE=digium   ; required
 ;MAC=deadbeef4dad ; required
 ;SERVER=myserver.example.com  ; A standard variable
 ;TIMEZONE=America/Denver  ; A standard variable
 ;MYVAR=somevalue  ; A user confdigured variable
 
 ; If the phoneprov sections have common variables, it is best to create a
 ; phoneprov template.  The example below will produce the same configuration
 ; as the one specified above except that MYVAR will be overridden for
 ; the specific user.
 ; Example:
 
 ;[phoneprov_defaults](!)
 ;type=phoneprov   ; must be specified as 'phoneprov'
 ;PROFILE=digium   ; required
 ;SERVER=myserver.example.com  ; A standard variable
 ;TIMEZONE=America/Denver  ; A standard variable
 ;MYVAR=somevalue  ; A user configured variable
 
 ;[1000](phoneprov_defaults)
 ;endpoint=1000; Required only if automatic setting of
   ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
   ; are needed.
 ;MAC=deadbeef4dad ; required
 ;MYVAR=someOTHERvalue ; A user confdigured variable
 
 ; To have USERNAME and SECRET automatically set, the endpoint
 ; specified here must in turn have an outbound_auth section defined.
 
 ; Fuller example:
 
 ;[1000]
 ;type=endpoint
 ;outbound_auth=1000-auth
 ;callerid=My Name 8005551212
 ;transport=transport-udp-nat
 
 ;[1000-auth]
 ;type=auth
 ;auth_type=userpass
 ;username=myname
 ;password=mysecret
 
 ;[phoneprov_defaults](!)
 ;type=phoneprov   ; must be specified as 'phoneprov'
 ;PROFILE=someprofile  ; required
 ;SERVER=myserver.example.com  ; A standard variable
 ;TIMEZONE=America/Denver  ; A standard variable
 ;MYVAR=somevalue  ; A user configured variable
 
 ;[1000](phoneprov_defaults)
 ;endpoint=1000; Required only if automatic setting of
   ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
   ; are needed.
 ;MAC=deadbeef4dad ; required
 ;MYVAR=someUSERvalue  ; A user confdigured variable
 ;LABEL=1000   ; A standard variable
  
 ; The previous sections would produce a template substitution map as follows:
 
 ;MAC=deadbeef4dad   ;added by pp1000
 ;USERNAME=myname;automatically added by 1000-auth username
 ;SECRET=mysecret;automatically added by 1000-auth password
 ;PROFILE=someprofile;added by defaults
 

Re: [asterisk-dev] [Code Review] 3976: New module: res_pjsip_phoneprov_provider provides the integration between res_pjsip and res_phoneprov.

2014-09-30 Thread George Joseph

---
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3976/
---

(Updated Sept. 30, 2014, 12:03 p.m.)


Review request for Asterisk Developers.


Changes
---

Addressed Richard's comments.


Repository: Asterisk


Description
---

This module allows res_pjsip to integrate with res_phoneprov and depends on the 
res_phoneprov refactor (r3970).

A new pjsip.conf object is defined by this module...

;EXAMPLE PHONEPROV CONFIGURATION

; Before configuring provisioning here, see the documentation for res_phoneprov
; and configure phoneprov.conf appropriately.

; For each user to be autoprovisioned, a [phoneprov] configuration section
; must be created.  At a minimum, the 'type', 'PROFILE' and 'MAC' variables must
; be set.  All other variables are optional.
; Example:

;[1000]
;type=phoneprov   ; must be specified as 'phoneprov'
;endpoint=1000; Required only if automatic setting of
  ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
  ; are needed.
;PROFILE=digium   ; required
;MAC=deadbeef4dad ; required
;SERVER=myserver.example.com  ; A standard variable
;TIMEZONE=America/Denver  ; A standard variable
;MYVAR=somevalue  ; A user confdigured variable

; If the phoneprov sections have common variables, it is best to create a
; phoneprov template.  The example below will produce the same configuration
; as the one specified above except that MYVAR will be overridden for
; the specific user.
; Example:

;[phoneprov_defaults](!)
;type=phoneprov   ; must be specified as 'phoneprov'
;PROFILE=digium   ; required
;SERVER=myserver.example.com  ; A standard variable
;TIMEZONE=America/Denver  ; A standard variable
;MYVAR=somevalue  ; A user configured variable

;[1000](phoneprov_defaults)
;endpoint=1000; Required only if automatic setting of
  ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
  ; are needed.
;MAC=deadbeef4dad ; required
;MYVAR=someOTHERvalue ; A user confdigured variable

; To have USERNAME and SECRET automatically set, the endpoint
; specified here must in turn have an outbound_auth section defined.

; Fuller example:

;[1000]
;type=endpoint
;outbound_auth=1000-auth
;callerid=My Name 8005551212
;transport=transport-udp-nat

;[1000-auth]
;type=auth
;auth_type=userpass
;username=myname
;password=mysecret

;[phoneprov_defaults](!)
;type=phoneprov   ; must be specified as 'phoneprov'
;PROFILE=someprofile  ; required
;SERVER=myserver.example.com  ; A standard variable
;TIMEZONE=America/Denver  ; A standard variable
;MYVAR=somevalue  ; A user configured variable

;[1000](phoneprov_defaults)
;endpoint=1000; Required only if automatic setting of
  ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
  ; are needed.
;MAC=deadbeef4dad ; required
;MYVAR=someUSERvalue  ; A user confdigured variable
;LABEL=1000   ; A standard variable
 
; The previous sections would produce a template substitution map as follows:

;MAC=deadbeef4dad   ;added by pp1000
;USERNAME=myname;automatically added by 1000-auth username
;SECRET=mysecret;automatically added by 1000-auth password
;PROFILE=someprofile;added by defaults
;SERVER=myserver.example.com;added by defaults
;SERVER_PORT=5060   ;added by defaults
;MYVAR=someUSERvalue;added by defaults but overdidden by user
;CALLERID=8005551212;automatically added by 1000 callerid
;DISPLAY_NAME=My Name   ;automatically added by 1000 callerid
;TIMEZONE=America/Denver;added by defaults
;TZOFFSET=252100;automatically calculated by res_phoneprov
;DST_ENABLE=1   ;automatically calculated by res_phoneprov
;DST_START_MONTH=3  ;automatically calculated by res_phoneprov
;DST_START_MDAY=9   ;automatically calculated by res_phoneprov
;DST_START_HOUR=3   ;automatically calculated by res_phoneprov
;DST_END_MONTH=11   ;automatically calculated by res_phoneprov
;DST_END_MDAY=2 ;automatically calculated by res_phoneprov
;DST_END_HOUR=1 ;automatically calculated by res_phoneprov
;ENDPOINT_ID=1000   ;automatically added by this module
;AUTH_ID=1000-auth  ;automatically added by this module
;TRANSPORT_ID=transport-udp-nat ;automatically added by this module
;LABEL=1000 ;added by user


Diffs (updated)
-

  branches/12/res/res_pjsip_phoneprov_provider.c 

Re: [asterisk-dev] [Code Review] 3976: New module: res_pjsip_phoneprov_provider provides the integration between res_pjsip and res_phoneprov.

2014-09-30 Thread rmudgett

---
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3976/#review13417
---


I'm hesitant about this going into v12 and v13 at this late a date especially 
since v13 is a LTS and currently feature frozen.


branches/12/res/res_pjsip_phoneprov_provider.c
https://reviewboard.asterisk.org/r/3976/#comment23940

Since this is a party id you need to check the number valid flag as well.

if valid and !ast_strlen_zero()



branches/12/res/res_pjsip_phoneprov_provider.c
https://reviewboard.asterisk.org/r/3976/#comment23941

idem


- rmudgett


On Sept. 30, 2014, 1:03 p.m., George Joseph wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://reviewboard.asterisk.org/r/3976/
 ---
 
 (Updated Sept. 30, 2014, 1:03 p.m.)
 
 
 Review request for Asterisk Developers.
 
 
 Repository: Asterisk
 
 
 Description
 ---
 
 This module allows res_pjsip to integrate with res_phoneprov and depends on 
 the res_phoneprov refactor (r3970).
 
 A new pjsip.conf object is defined by this module...
 
 ;EXAMPLE PHONEPROV CONFIGURATION
 
 ; Before configuring provisioning here, see the documentation for 
 res_phoneprov
 ; and configure phoneprov.conf appropriately.
 
 ; For each user to be autoprovisioned, a [phoneprov] configuration section
 ; must be created.  At a minimum, the 'type', 'PROFILE' and 'MAC' variables 
 must
 ; be set.  All other variables are optional.
 ; Example:
 
 ;[1000]
 ;type=phoneprov   ; must be specified as 'phoneprov'
 ;endpoint=1000; Required only if automatic setting of
   ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
   ; are needed.
 ;PROFILE=digium   ; required
 ;MAC=deadbeef4dad ; required
 ;SERVER=myserver.example.com  ; A standard variable
 ;TIMEZONE=America/Denver  ; A standard variable
 ;MYVAR=somevalue  ; A user confdigured variable
 
 ; If the phoneprov sections have common variables, it is best to create a
 ; phoneprov template.  The example below will produce the same configuration
 ; as the one specified above except that MYVAR will be overridden for
 ; the specific user.
 ; Example:
 
 ;[phoneprov_defaults](!)
 ;type=phoneprov   ; must be specified as 'phoneprov'
 ;PROFILE=digium   ; required
 ;SERVER=myserver.example.com  ; A standard variable
 ;TIMEZONE=America/Denver  ; A standard variable
 ;MYVAR=somevalue  ; A user configured variable
 
 ;[1000](phoneprov_defaults)
 ;endpoint=1000; Required only if automatic setting of
   ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
   ; are needed.
 ;MAC=deadbeef4dad ; required
 ;MYVAR=someOTHERvalue ; A user confdigured variable
 
 ; To have USERNAME and SECRET automatically set, the endpoint
 ; specified here must in turn have an outbound_auth section defined.
 
 ; Fuller example:
 
 ;[1000]
 ;type=endpoint
 ;outbound_auth=1000-auth
 ;callerid=My Name 8005551212
 ;transport=transport-udp-nat
 
 ;[1000-auth]
 ;type=auth
 ;auth_type=userpass
 ;username=myname
 ;password=mysecret
 
 ;[phoneprov_defaults](!)
 ;type=phoneprov   ; must be specified as 'phoneprov'
 ;PROFILE=someprofile  ; required
 ;SERVER=myserver.example.com  ; A standard variable
 ;TIMEZONE=America/Denver  ; A standard variable
 ;MYVAR=somevalue  ; A user configured variable
 
 ;[1000](phoneprov_defaults)
 ;endpoint=1000; Required only if automatic setting of
   ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
   ; are needed.
 ;MAC=deadbeef4dad ; required
 ;MYVAR=someUSERvalue  ; A user confdigured variable
 ;LABEL=1000   ; A standard variable
  
 ; The previous sections would produce a template substitution map as follows:
 
 ;MAC=deadbeef4dad   ;added by pp1000
 ;USERNAME=myname;automatically added by 1000-auth username
 ;SECRET=mysecret;automatically added by 1000-auth password
 ;PROFILE=someprofile;added by defaults
 ;SERVER=myserver.example.com;added by defaults
 ;SERVER_PORT=5060   ;added by defaults
 ;MYVAR=someUSERvalue;added by defaults but overdidden by user
 ;CALLERID=8005551212;automatically added by 1000 callerid
 ;DISPLAY_NAME=My Name   ;automatically added by 1000 callerid
 ;TIMEZONE=America/Denver;added by defaults
 ;TZOFFSET=252100;automatically calculated by res_phoneprov
 ;DST_ENABLE=1   

Re: [asterisk-dev] [Code Review] 3976: New module: res_pjsip_phoneprov_provider provides the integration between res_pjsip and res_phoneprov.

2014-09-30 Thread George Joseph

---
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3976/
---

(Updated Sept. 30, 2014, 2:43 p.m.)


Review request for Asterisk Developers.


Changes
---

Added the party id checks.


Repository: Asterisk


Description
---

This module allows res_pjsip to integrate with res_phoneprov and depends on the 
res_phoneprov refactor (r3970).

A new pjsip.conf object is defined by this module...

;EXAMPLE PHONEPROV CONFIGURATION

; Before configuring provisioning here, see the documentation for res_phoneprov
; and configure phoneprov.conf appropriately.

; For each user to be autoprovisioned, a [phoneprov] configuration section
; must be created.  At a minimum, the 'type', 'PROFILE' and 'MAC' variables must
; be set.  All other variables are optional.
; Example:

;[1000]
;type=phoneprov   ; must be specified as 'phoneprov'
;endpoint=1000; Required only if automatic setting of
  ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
  ; are needed.
;PROFILE=digium   ; required
;MAC=deadbeef4dad ; required
;SERVER=myserver.example.com  ; A standard variable
;TIMEZONE=America/Denver  ; A standard variable
;MYVAR=somevalue  ; A user confdigured variable

; If the phoneprov sections have common variables, it is best to create a
; phoneprov template.  The example below will produce the same configuration
; as the one specified above except that MYVAR will be overridden for
; the specific user.
; Example:

;[phoneprov_defaults](!)
;type=phoneprov   ; must be specified as 'phoneprov'
;PROFILE=digium   ; required
;SERVER=myserver.example.com  ; A standard variable
;TIMEZONE=America/Denver  ; A standard variable
;MYVAR=somevalue  ; A user configured variable

;[1000](phoneprov_defaults)
;endpoint=1000; Required only if automatic setting of
  ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
  ; are needed.
;MAC=deadbeef4dad ; required
;MYVAR=someOTHERvalue ; A user confdigured variable

; To have USERNAME and SECRET automatically set, the endpoint
; specified here must in turn have an outbound_auth section defined.

; Fuller example:

;[1000]
;type=endpoint
;outbound_auth=1000-auth
;callerid=My Name 8005551212
;transport=transport-udp-nat

;[1000-auth]
;type=auth
;auth_type=userpass
;username=myname
;password=mysecret

;[phoneprov_defaults](!)
;type=phoneprov   ; must be specified as 'phoneprov'
;PROFILE=someprofile  ; required
;SERVER=myserver.example.com  ; A standard variable
;TIMEZONE=America/Denver  ; A standard variable
;MYVAR=somevalue  ; A user configured variable

;[1000](phoneprov_defaults)
;endpoint=1000; Required only if automatic setting of
  ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
  ; are needed.
;MAC=deadbeef4dad ; required
;MYVAR=someUSERvalue  ; A user confdigured variable
;LABEL=1000   ; A standard variable
 
; The previous sections would produce a template substitution map as follows:

;MAC=deadbeef4dad   ;added by pp1000
;USERNAME=myname;automatically added by 1000-auth username
;SECRET=mysecret;automatically added by 1000-auth password
;PROFILE=someprofile;added by defaults
;SERVER=myserver.example.com;added by defaults
;SERVER_PORT=5060   ;added by defaults
;MYVAR=someUSERvalue;added by defaults but overdidden by user
;CALLERID=8005551212;automatically added by 1000 callerid
;DISPLAY_NAME=My Name   ;automatically added by 1000 callerid
;TIMEZONE=America/Denver;added by defaults
;TZOFFSET=252100;automatically calculated by res_phoneprov
;DST_ENABLE=1   ;automatically calculated by res_phoneprov
;DST_START_MONTH=3  ;automatically calculated by res_phoneprov
;DST_START_MDAY=9   ;automatically calculated by res_phoneprov
;DST_START_HOUR=3   ;automatically calculated by res_phoneprov
;DST_END_MONTH=11   ;automatically calculated by res_phoneprov
;DST_END_MDAY=2 ;automatically calculated by res_phoneprov
;DST_END_HOUR=1 ;automatically calculated by res_phoneprov
;ENDPOINT_ID=1000   ;automatically added by this module
;AUTH_ID=1000-auth  ;automatically added by this module
;TRANSPORT_ID=transport-udp-nat ;automatically added by this module
;LABEL=1000 ;added by user


Diffs (updated)
-

  branches/12/res/res_pjsip_phoneprov_provider.c PRE-CREATION 

Re: [asterisk-dev] [Code Review] 3976: New module: res_pjsip_phoneprov_provider provides the integration between res_pjsip and res_phoneprov.

2014-09-30 Thread rmudgett

---
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3976/#review13423
---

Ship it!


Ship It!

- rmudgett


On Sept. 30, 2014, 3:43 p.m., George Joseph wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://reviewboard.asterisk.org/r/3976/
 ---
 
 (Updated Sept. 30, 2014, 3:43 p.m.)
 
 
 Review request for Asterisk Developers.
 
 
 Repository: Asterisk
 
 
 Description
 ---
 
 This module allows res_pjsip to integrate with res_phoneprov and depends on 
 the res_phoneprov refactor (r3970).
 
 A new pjsip.conf object is defined by this module...
 
 ;EXAMPLE PHONEPROV CONFIGURATION
 
 ; Before configuring provisioning here, see the documentation for 
 res_phoneprov
 ; and configure phoneprov.conf appropriately.
 
 ; For each user to be autoprovisioned, a [phoneprov] configuration section
 ; must be created.  At a minimum, the 'type', 'PROFILE' and 'MAC' variables 
 must
 ; be set.  All other variables are optional.
 ; Example:
 
 ;[1000]
 ;type=phoneprov   ; must be specified as 'phoneprov'
 ;endpoint=1000; Required only if automatic setting of
   ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
   ; are needed.
 ;PROFILE=digium   ; required
 ;MAC=deadbeef4dad ; required
 ;SERVER=myserver.example.com  ; A standard variable
 ;TIMEZONE=America/Denver  ; A standard variable
 ;MYVAR=somevalue  ; A user confdigured variable
 
 ; If the phoneprov sections have common variables, it is best to create a
 ; phoneprov template.  The example below will produce the same configuration
 ; as the one specified above except that MYVAR will be overridden for
 ; the specific user.
 ; Example:
 
 ;[phoneprov_defaults](!)
 ;type=phoneprov   ; must be specified as 'phoneprov'
 ;PROFILE=digium   ; required
 ;SERVER=myserver.example.com  ; A standard variable
 ;TIMEZONE=America/Denver  ; A standard variable
 ;MYVAR=somevalue  ; A user configured variable
 
 ;[1000](phoneprov_defaults)
 ;endpoint=1000; Required only if automatic setting of
   ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
   ; are needed.
 ;MAC=deadbeef4dad ; required
 ;MYVAR=someOTHERvalue ; A user confdigured variable
 
 ; To have USERNAME and SECRET automatically set, the endpoint
 ; specified here must in turn have an outbound_auth section defined.
 
 ; Fuller example:
 
 ;[1000]
 ;type=endpoint
 ;outbound_auth=1000-auth
 ;callerid=My Name 8005551212
 ;transport=transport-udp-nat
 
 ;[1000-auth]
 ;type=auth
 ;auth_type=userpass
 ;username=myname
 ;password=mysecret
 
 ;[phoneprov_defaults](!)
 ;type=phoneprov   ; must be specified as 'phoneprov'
 ;PROFILE=someprofile  ; required
 ;SERVER=myserver.example.com  ; A standard variable
 ;TIMEZONE=America/Denver  ; A standard variable
 ;MYVAR=somevalue  ; A user configured variable
 
 ;[1000](phoneprov_defaults)
 ;endpoint=1000; Required only if automatic setting of
   ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
   ; are needed.
 ;MAC=deadbeef4dad ; required
 ;MYVAR=someUSERvalue  ; A user confdigured variable
 ;LABEL=1000   ; A standard variable
  
 ; The previous sections would produce a template substitution map as follows:
 
 ;MAC=deadbeef4dad   ;added by pp1000
 ;USERNAME=myname;automatically added by 1000-auth username
 ;SECRET=mysecret;automatically added by 1000-auth password
 ;PROFILE=someprofile;added by defaults
 ;SERVER=myserver.example.com;added by defaults
 ;SERVER_PORT=5060   ;added by defaults
 ;MYVAR=someUSERvalue;added by defaults but overdidden by user
 ;CALLERID=8005551212;automatically added by 1000 callerid
 ;DISPLAY_NAME=My Name   ;automatically added by 1000 callerid
 ;TIMEZONE=America/Denver;added by defaults
 ;TZOFFSET=252100;automatically calculated by res_phoneprov
 ;DST_ENABLE=1   ;automatically calculated by res_phoneprov
 ;DST_START_MONTH=3  ;automatically calculated by res_phoneprov
 ;DST_START_MDAY=9   ;automatically calculated by res_phoneprov
 ;DST_START_HOUR=3   ;automatically calculated by res_phoneprov
 ;DST_END_MONTH=11   ;automatically calculated by res_phoneprov
 ;DST_END_MDAY=2 ;automatically calculated by res_phoneprov
 ;DST_END_HOUR=1

Re: [asterisk-dev] [Code Review] 3976: New module: res_pjsip_phoneprov_provider provides the integration between res_pjsip and res_phoneprov.

2014-09-18 Thread George Joseph

---
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3976/
---

(Updated Sept. 18, 2014, 3:21 p.m.)


Review request for Asterisk Developers.


Changes
---

Updated description and cleaned up default processing.


Repository: Asterisk


Description (updated)
---

This module allows res_pjsip to integrate with res_phoneprov and depends on the 
res_phoneprov refactor (r3970).

A new pjsip.conf object is defined by this module...

;EXAMPLE PHONEPROV CONFIGURATION

; Before configuring provisioning here, see the documentation for res_phoneprov
; and configure phoneprov.conf appropriately.

; For each user to be autoprovisioned, a [phoneprov] configuration section
; must be created.  At a minimum, the 'type', 'PROFILE' and 'MAC' variables must
; be set.  All other variables are optional.
; Example:

;[1000]
;type=phoneprov   ; must be specified as 'phoneprov'
;endpoint=1000; Required only if automatic setting of
  ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
  ; are needed.
;PROFILE=digium   ; required
;MAC=deadbeef4dad ; required
;SERVER=myserver.example.com  ; A standard variable
;TIMEZONE=America/Denver  ; A standard variable
;MYVAR=somevalue  ; A user confdigured variable

; If the phoneprov sections have common variables, it is best to create a
; phoneprov template.  The example below will produce the same configuration
; as the one specified above except that MYVAR will be overridden for
; the specific user.
; Example:

;[phoneprov_defaults](!)
;type=phoneprov   ; must be specified as 'phoneprov'
;PROFILE=digium   ; required
;SERVER=myserver.example.com  ; A standard variable
;TIMEZONE=America/Denver  ; A standard variable
;MYVAR=somevalue  ; A user configured variable

;[1000](phoneprov_defaults)
;endpoint=1000; Required only if automatic setting of
  ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
  ; are needed.
;MAC=deadbeef4dad ; required
;MYVAR=someOTHERvalue ; A user confdigured variable

; To have USERNAME and SECRET automatically set, the endpoint
; specified here must in turn have an outbound_auth section defined.

; Fuller example:

;[1000]
;type=endpoint
;outbound_auth=1000-auth
;callerid=My Name 8005551212
;transport=transport-udp-nat

;[1000-auth]
;type=auth
;auth_type=userpass
;username=myname
;password=mysecret

;[phoneprov_defaults](!)
;type=phoneprov   ; must be specified as 'phoneprov'
;PROFILE=someprofile  ; required
;SERVER=myserver.example.com  ; A standard variable
;TIMEZONE=America/Denver  ; A standard variable
;MYVAR=somevalue  ; A user configured variable

;[1000](phoneprov_defaults)
;endpoint=1000; Required only if automatic setting of
  ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
  ; are needed.
;MAC=deadbeef4dad ; required
;MYVAR=someUSERvalue  ; A user confdigured variable
;LABEL=1000   ; A standard variable
 
; The previous sections would produce a template substitution map as follows:

;MAC=deadbeef4dad   ;added by pp1000
;USERNAME=myname;automatically added by 1000-auth username
;SECRET=mysecret;automatically added by 1000-auth password
;PROFILE=someprofile;added by defaults
;SERVER=myserver.example.com;added by defaults
;SERVER_PORT=5060   ;added by defaults
;MYVAR=someUSERvalue;added by defaults but overdidden by user
;CALLERID=8005551212;automatically added by 1000 callerid
;DISPLAY_NAME=My Name   ;automatically added by 1000 callerid
;TIMEZONE=America/Denver;added by defaults
;TZOFFSET=252100;automatically calculated by res_phoneprov
;DST_ENABLE=1   ;automatically calculated by res_phoneprov
;DST_START_MONTH=3  ;automatically calculated by res_phoneprov
;DST_START_MDAY=9   ;automatically calculated by res_phoneprov
;DST_START_HOUR=3   ;automatically calculated by res_phoneprov
;DST_END_MONTH=11   ;automatically calculated by res_phoneprov
;DST_END_MDAY=2 ;automatically calculated by res_phoneprov
;DST_END_HOUR=1 ;automatically calculated by res_phoneprov
;ENDPOINT_ID=1000   ;automatically added by this module
;AUTH_ID=1000-auth  ;automatically added by this module
;TRANSPORT_ID=transport-udp-nat ;automatically added by this module
;LABEL=1000 ;added by user


Diffs (updated)
-

  

Re: [asterisk-dev] [Code Review] 3976: New module: res_pjsip_phoneprov_provider provides the integration between res_pjsip and res_phoneprov.

2014-09-18 Thread rmudgett

---
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3976/#review13359
---



branches/12/res/res_pjsip_phoneprov_provider.c
https://reviewboard.asterisk.org/r/3976/#comment23848

Probably should be marked as extended since res_phoneprov is extended.



branches/12/res/res_pjsip_phoneprov_provider.c
https://reviewboard.asterisk.org/r/3976/#comment23852

Concerned about the parameter names chosen.  All uppercase parameter names 
is a bit unusual.

I think there is a requirement for pjsip parameters to be snake_case for 
ARI.



branches/12/res/res_pjsip_phoneprov_provider.c
https://reviewboard.asterisk.org/r/3976/#comment23851

Thge ??



branches/12/res/res_pjsip_phoneprov_provider.c
https://reviewboard.asterisk.org/r/3976/#comment23850

Another case where the if test burried in AST_VAR_LIST_INSERT_TAIL() is 
redundant.



branches/12/res/res_pjsip_phoneprov_provider.c
https://reviewboard.asterisk.org/r/3976/#comment23847

Use:
for (; (pp = ao2_iter_next()); ao2_ref(pp, -1))

This way you could use continue instead of goto cleanup.


Probably should break up the while loop body into functions.  It is rather 
large.



branches/12/res/res_pjsip_phoneprov_provider.c
https://reviewboard.asterisk.org/r/3976/#comment23846

Check for failure.


- rmudgett


On Sept. 18, 2014, 4:21 p.m., George Joseph wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://reviewboard.asterisk.org/r/3976/
 ---
 
 (Updated Sept. 18, 2014, 4:21 p.m.)
 
 
 Review request for Asterisk Developers.
 
 
 Repository: Asterisk
 
 
 Description
 ---
 
 This module allows res_pjsip to integrate with res_phoneprov and depends on 
 the res_phoneprov refactor (r3970).
 
 A new pjsip.conf object is defined by this module...
 
 ;EXAMPLE PHONEPROV CONFIGURATION
 
 ; Before configuring provisioning here, see the documentation for 
 res_phoneprov
 ; and configure phoneprov.conf appropriately.
 
 ; For each user to be autoprovisioned, a [phoneprov] configuration section
 ; must be created.  At a minimum, the 'type', 'PROFILE' and 'MAC' variables 
 must
 ; be set.  All other variables are optional.
 ; Example:
 
 ;[1000]
 ;type=phoneprov   ; must be specified as 'phoneprov'
 ;endpoint=1000; Required only if automatic setting of
   ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
   ; are needed.
 ;PROFILE=digium   ; required
 ;MAC=deadbeef4dad ; required
 ;SERVER=myserver.example.com  ; A standard variable
 ;TIMEZONE=America/Denver  ; A standard variable
 ;MYVAR=somevalue  ; A user confdigured variable
 
 ; If the phoneprov sections have common variables, it is best to create a
 ; phoneprov template.  The example below will produce the same configuration
 ; as the one specified above except that MYVAR will be overridden for
 ; the specific user.
 ; Example:
 
 ;[phoneprov_defaults](!)
 ;type=phoneprov   ; must be specified as 'phoneprov'
 ;PROFILE=digium   ; required
 ;SERVER=myserver.example.com  ; A standard variable
 ;TIMEZONE=America/Denver  ; A standard variable
 ;MYVAR=somevalue  ; A user configured variable
 
 ;[1000](phoneprov_defaults)
 ;endpoint=1000; Required only if automatic setting of
   ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
   ; are needed.
 ;MAC=deadbeef4dad ; required
 ;MYVAR=someOTHERvalue ; A user confdigured variable
 
 ; To have USERNAME and SECRET automatically set, the endpoint
 ; specified here must in turn have an outbound_auth section defined.
 
 ; Fuller example:
 
 ;[1000]
 ;type=endpoint
 ;outbound_auth=1000-auth
 ;callerid=My Name 8005551212
 ;transport=transport-udp-nat
 
 ;[1000-auth]
 ;type=auth
 ;auth_type=userpass
 ;username=myname
 ;password=mysecret
 
 ;[phoneprov_defaults](!)
 ;type=phoneprov   ; must be specified as 'phoneprov'
 ;PROFILE=someprofile  ; required
 ;SERVER=myserver.example.com  ; A standard variable
 ;TIMEZONE=America/Denver  ; A standard variable
 ;MYVAR=somevalue  ; A user configured variable
 
 ;[1000](phoneprov_defaults)
 ;endpoint=1000; Required only if automatic setting of
   ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
   ; are needed.
 ;MAC=deadbeef4dad ; required
 ;MYVAR=someUSERvalue  ; A user confdigured variable
 ;LABEL=1000   ; A standard variable
  
 ; The previous sections would produce a 

Re: [asterisk-dev] [Code Review] 3976: New module: res_pjsip_phoneprov_provider provides the integration between res_pjsip and res_phoneprov.

2014-09-18 Thread George Joseph


 On Sept. 18, 2014, 5:32 p.m., rmudgett wrote:
  branches/12/res/res_pjsip_phoneprov_provider.c, lines 71-75
  https://reviewboard.asterisk.org/r/3976/diff/3/?file=67405#file67405line71
 
  Concerned about the parameter names chosen.  All uppercase parameter 
  names is a bit unusual.
  
  I think there is a requirement for pjsip parameters to be snake_case 
  for ARI.

phoneprov variable have historically been upper case and they are 
case-sensitive.  Having some upper and some lower would be not only confusing 
but it would make it impossible to use the same template file for both sip and 
pjsip providers.


- George


---
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3976/#review13359
---


On Sept. 18, 2014, 3:21 p.m., George Joseph wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://reviewboard.asterisk.org/r/3976/
 ---
 
 (Updated Sept. 18, 2014, 3:21 p.m.)
 
 
 Review request for Asterisk Developers.
 
 
 Repository: Asterisk
 
 
 Description
 ---
 
 This module allows res_pjsip to integrate with res_phoneprov and depends on 
 the res_phoneprov refactor (r3970).
 
 A new pjsip.conf object is defined by this module...
 
 ;EXAMPLE PHONEPROV CONFIGURATION
 
 ; Before configuring provisioning here, see the documentation for 
 res_phoneprov
 ; and configure phoneprov.conf appropriately.
 
 ; For each user to be autoprovisioned, a [phoneprov] configuration section
 ; must be created.  At a minimum, the 'type', 'PROFILE' and 'MAC' variables 
 must
 ; be set.  All other variables are optional.
 ; Example:
 
 ;[1000]
 ;type=phoneprov   ; must be specified as 'phoneprov'
 ;endpoint=1000; Required only if automatic setting of
   ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
   ; are needed.
 ;PROFILE=digium   ; required
 ;MAC=deadbeef4dad ; required
 ;SERVER=myserver.example.com  ; A standard variable
 ;TIMEZONE=America/Denver  ; A standard variable
 ;MYVAR=somevalue  ; A user confdigured variable
 
 ; If the phoneprov sections have common variables, it is best to create a
 ; phoneprov template.  The example below will produce the same configuration
 ; as the one specified above except that MYVAR will be overridden for
 ; the specific user.
 ; Example:
 
 ;[phoneprov_defaults](!)
 ;type=phoneprov   ; must be specified as 'phoneprov'
 ;PROFILE=digium   ; required
 ;SERVER=myserver.example.com  ; A standard variable
 ;TIMEZONE=America/Denver  ; A standard variable
 ;MYVAR=somevalue  ; A user configured variable
 
 ;[1000](phoneprov_defaults)
 ;endpoint=1000; Required only if automatic setting of
   ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
   ; are needed.
 ;MAC=deadbeef4dad ; required
 ;MYVAR=someOTHERvalue ; A user confdigured variable
 
 ; To have USERNAME and SECRET automatically set, the endpoint
 ; specified here must in turn have an outbound_auth section defined.
 
 ; Fuller example:
 
 ;[1000]
 ;type=endpoint
 ;outbound_auth=1000-auth
 ;callerid=My Name 8005551212
 ;transport=transport-udp-nat
 
 ;[1000-auth]
 ;type=auth
 ;auth_type=userpass
 ;username=myname
 ;password=mysecret
 
 ;[phoneprov_defaults](!)
 ;type=phoneprov   ; must be specified as 'phoneprov'
 ;PROFILE=someprofile  ; required
 ;SERVER=myserver.example.com  ; A standard variable
 ;TIMEZONE=America/Denver  ; A standard variable
 ;MYVAR=somevalue  ; A user configured variable
 
 ;[1000](phoneprov_defaults)
 ;endpoint=1000; Required only if automatic setting of
   ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
   ; are needed.
 ;MAC=deadbeef4dad ; required
 ;MYVAR=someUSERvalue  ; A user confdigured variable
 ;LABEL=1000   ; A standard variable
  
 ; The previous sections would produce a template substitution map as follows:
 
 ;MAC=deadbeef4dad   ;added by pp1000
 ;USERNAME=myname;automatically added by 1000-auth username
 ;SECRET=mysecret;automatically added by 1000-auth password
 ;PROFILE=someprofile;added by defaults
 ;SERVER=myserver.example.com;added by defaults
 ;SERVER_PORT=5060   ;added by defaults
 ;MYVAR=someUSERvalue;added by defaults but overdidden by user
 ;CALLERID=8005551212;automatically added by 1000 callerid
 ;DISPLAY_NAME=My Name   ;automatically added by 1000 

Re: [asterisk-dev] [Code Review] 3976: New module: res_pjsip_phoneprov_provider provides the integration between res_pjsip and res_phoneprov.

2014-09-18 Thread George Joseph


 On Sept. 18, 2014, 5:32 p.m., rmudgett wrote:
  branches/12/res/res_pjsip_phoneprov_provider.c, line 174
  https://reviewboard.asterisk.org/r/3976/diff/3/?file=67405#file67405line174
 
  Another case where the if test burried in AST_VAR_LIST_INSERT_TAIL() is 
  redundant.

true but here I'm actually checking the return for the allocation failure and 
bailing.  res_phoneprov always silently ignored the allocation failure and just 
didn't insert the variable into the list.

Silently ignoring non-required variables can't hurt anything and if the system 
is so low on memory that it can't allocate a dozen bytes then you'll never see 
the error messages anyway.  So, I guess I'll remove the check here and silently 
ignore.


- George


---
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3976/#review13359
---


On Sept. 18, 2014, 3:21 p.m., George Joseph wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://reviewboard.asterisk.org/r/3976/
 ---
 
 (Updated Sept. 18, 2014, 3:21 p.m.)
 
 
 Review request for Asterisk Developers.
 
 
 Repository: Asterisk
 
 
 Description
 ---
 
 This module allows res_pjsip to integrate with res_phoneprov and depends on 
 the res_phoneprov refactor (r3970).
 
 A new pjsip.conf object is defined by this module...
 
 ;EXAMPLE PHONEPROV CONFIGURATION
 
 ; Before configuring provisioning here, see the documentation for 
 res_phoneprov
 ; and configure phoneprov.conf appropriately.
 
 ; For each user to be autoprovisioned, a [phoneprov] configuration section
 ; must be created.  At a minimum, the 'type', 'PROFILE' and 'MAC' variables 
 must
 ; be set.  All other variables are optional.
 ; Example:
 
 ;[1000]
 ;type=phoneprov   ; must be specified as 'phoneprov'
 ;endpoint=1000; Required only if automatic setting of
   ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
   ; are needed.
 ;PROFILE=digium   ; required
 ;MAC=deadbeef4dad ; required
 ;SERVER=myserver.example.com  ; A standard variable
 ;TIMEZONE=America/Denver  ; A standard variable
 ;MYVAR=somevalue  ; A user confdigured variable
 
 ; If the phoneprov sections have common variables, it is best to create a
 ; phoneprov template.  The example below will produce the same configuration
 ; as the one specified above except that MYVAR will be overridden for
 ; the specific user.
 ; Example:
 
 ;[phoneprov_defaults](!)
 ;type=phoneprov   ; must be specified as 'phoneprov'
 ;PROFILE=digium   ; required
 ;SERVER=myserver.example.com  ; A standard variable
 ;TIMEZONE=America/Denver  ; A standard variable
 ;MYVAR=somevalue  ; A user configured variable
 
 ;[1000](phoneprov_defaults)
 ;endpoint=1000; Required only if automatic setting of
   ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
   ; are needed.
 ;MAC=deadbeef4dad ; required
 ;MYVAR=someOTHERvalue ; A user confdigured variable
 
 ; To have USERNAME and SECRET automatically set, the endpoint
 ; specified here must in turn have an outbound_auth section defined.
 
 ; Fuller example:
 
 ;[1000]
 ;type=endpoint
 ;outbound_auth=1000-auth
 ;callerid=My Name 8005551212
 ;transport=transport-udp-nat
 
 ;[1000-auth]
 ;type=auth
 ;auth_type=userpass
 ;username=myname
 ;password=mysecret
 
 ;[phoneprov_defaults](!)
 ;type=phoneprov   ; must be specified as 'phoneprov'
 ;PROFILE=someprofile  ; required
 ;SERVER=myserver.example.com  ; A standard variable
 ;TIMEZONE=America/Denver  ; A standard variable
 ;MYVAR=somevalue  ; A user configured variable
 
 ;[1000](phoneprov_defaults)
 ;endpoint=1000; Required only if automatic setting of
   ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
   ; are needed.
 ;MAC=deadbeef4dad ; required
 ;MYVAR=someUSERvalue  ; A user confdigured variable
 ;LABEL=1000   ; A standard variable
  
 ; The previous sections would produce a template substitution map as follows:
 
 ;MAC=deadbeef4dad   ;added by pp1000
 ;USERNAME=myname;automatically added by 1000-auth username
 ;SECRET=mysecret;automatically added by 1000-auth password
 ;PROFILE=someprofile;added by defaults
 ;SERVER=myserver.example.com;added by defaults
 ;SERVER_PORT=5060   ;added by defaults
 ;MYVAR=someUSERvalue;added by defaults but overdidden by user
 ;CALLERID=8005551212

Re: [asterisk-dev] [Code Review] 3976: New module: res_pjsip_phoneprov_provider provides the integration between res_pjsip and res_phoneprov.

2014-09-18 Thread George Joseph

---
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3976/
---

(Updated Sept. 18, 2014, 6:55 p.m.)


Review request for Asterisk Developers.


Changes
---

Addressed Richard's comments.


Repository: Asterisk


Description
---

This module allows res_pjsip to integrate with res_phoneprov and depends on the 
res_phoneprov refactor (r3970).

A new pjsip.conf object is defined by this module...

;EXAMPLE PHONEPROV CONFIGURATION

; Before configuring provisioning here, see the documentation for res_phoneprov
; and configure phoneprov.conf appropriately.

; For each user to be autoprovisioned, a [phoneprov] configuration section
; must be created.  At a minimum, the 'type', 'PROFILE' and 'MAC' variables must
; be set.  All other variables are optional.
; Example:

;[1000]
;type=phoneprov   ; must be specified as 'phoneprov'
;endpoint=1000; Required only if automatic setting of
  ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
  ; are needed.
;PROFILE=digium   ; required
;MAC=deadbeef4dad ; required
;SERVER=myserver.example.com  ; A standard variable
;TIMEZONE=America/Denver  ; A standard variable
;MYVAR=somevalue  ; A user confdigured variable

; If the phoneprov sections have common variables, it is best to create a
; phoneprov template.  The example below will produce the same configuration
; as the one specified above except that MYVAR will be overridden for
; the specific user.
; Example:

;[phoneprov_defaults](!)
;type=phoneprov   ; must be specified as 'phoneprov'
;PROFILE=digium   ; required
;SERVER=myserver.example.com  ; A standard variable
;TIMEZONE=America/Denver  ; A standard variable
;MYVAR=somevalue  ; A user configured variable

;[1000](phoneprov_defaults)
;endpoint=1000; Required only if automatic setting of
  ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
  ; are needed.
;MAC=deadbeef4dad ; required
;MYVAR=someOTHERvalue ; A user confdigured variable

; To have USERNAME and SECRET automatically set, the endpoint
; specified here must in turn have an outbound_auth section defined.

; Fuller example:

;[1000]
;type=endpoint
;outbound_auth=1000-auth
;callerid=My Name 8005551212
;transport=transport-udp-nat

;[1000-auth]
;type=auth
;auth_type=userpass
;username=myname
;password=mysecret

;[phoneprov_defaults](!)
;type=phoneprov   ; must be specified as 'phoneprov'
;PROFILE=someprofile  ; required
;SERVER=myserver.example.com  ; A standard variable
;TIMEZONE=America/Denver  ; A standard variable
;MYVAR=somevalue  ; A user configured variable

;[1000](phoneprov_defaults)
;endpoint=1000; Required only if automatic setting of
  ; USERNAME, SECRET, DISPLAY_NAME and CALLERID
  ; are needed.
;MAC=deadbeef4dad ; required
;MYVAR=someUSERvalue  ; A user confdigured variable
;LABEL=1000   ; A standard variable
 
; The previous sections would produce a template substitution map as follows:

;MAC=deadbeef4dad   ;added by pp1000
;USERNAME=myname;automatically added by 1000-auth username
;SECRET=mysecret;automatically added by 1000-auth password
;PROFILE=someprofile;added by defaults
;SERVER=myserver.example.com;added by defaults
;SERVER_PORT=5060   ;added by defaults
;MYVAR=someUSERvalue;added by defaults but overdidden by user
;CALLERID=8005551212;automatically added by 1000 callerid
;DISPLAY_NAME=My Name   ;automatically added by 1000 callerid
;TIMEZONE=America/Denver;added by defaults
;TZOFFSET=252100;automatically calculated by res_phoneprov
;DST_ENABLE=1   ;automatically calculated by res_phoneprov
;DST_START_MONTH=3  ;automatically calculated by res_phoneprov
;DST_START_MDAY=9   ;automatically calculated by res_phoneprov
;DST_START_HOUR=3   ;automatically calculated by res_phoneprov
;DST_END_MONTH=11   ;automatically calculated by res_phoneprov
;DST_END_MDAY=2 ;automatically calculated by res_phoneprov
;DST_END_HOUR=1 ;automatically calculated by res_phoneprov
;ENDPOINT_ID=1000   ;automatically added by this module
;AUTH_ID=1000-auth  ;automatically added by this module
;TRANSPORT_ID=transport-udp-nat ;automatically added by this module
;LABEL=1000 ;added by user


Diffs (updated)
-

  branches/12/res/res_pjsip_phoneprov_provider.c 

Re: [asterisk-dev] [Code Review] 3976: New module: res_pjsip_phoneprov_provider provides the integration between res_pjsip and res_phoneprov.

2014-09-05 Thread George Joseph

---
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3976/
---

(Updated Sept. 5, 2014, 6:44 p.m.)


Review request for Asterisk Developers.


Changes
---

Fixed some reference leaks.
Refactored for default processing change in res_phoneprov.
Added documentation to pjsip.conf.sample.


Repository: Asterisk


Description
---

This module allows res_pjsip to integrate with res_phoneprov and depends on the 
res_phoneprov refactor (r3970).

Two new pjsip.conf objects are defined by this module...

'phoneprov_default' which defines defaults for all users created by this 
provider.

[myppdefaults]
type=phoneprov_default
PROFILE=grandstream ; required
SERVER=myserver.example.com
OTHERVAR=othervalue

'phoneprov_user' which defines each user to be exposed.

[pp1000]
type=phoneprov_user
endpoint=ep1000 ; optional reference to an existing endpoint
MAC=deadbeef4dad ; required
PROFILE=grandstream2 ; overrides the default
LINEKEYS=1
LINE=1
OTHERVAR=othervalue

[pp1001]
type=phoneprov_user
endpoint=ep1001 ; optional reference to an existing endpoint
MAC=deadf00d4dad ; required
LINEKEYS=1
LINE=1
LABEL=1001 ; overrides pp1001
OTHERVAR=othervalue

USERNAME, CALLERID, DISPLAY_NAME and SECRET are automatically pulled from 
endpoint and endpoint-auth if defined.
LABEL is automatically set from the phoneprov_user id.
ENDPOINT_ID, TRANSPORT_ID and AUTH_ID are automatically added.

Any other variables defined are automatically passed through and are available 
for template substitution even if they're not one of the standard variables 
defined by res_phoneprov.


Diffs (updated)
-

  branches/12/res/res_pjsip_phoneprov_provider.c PRE-CREATION 
  branches/12/configs/pjsip.conf.sample 422737 

Diff: https://reviewboard.asterisk.org/r/3976/diff/


Testing
---

I'm already starting to convert sip peers to pjsip endpoints with no change to 
my Grandstream templates.


Thanks,

George Joseph

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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