[Asterisk-Users] Remote Voicemail Notifier / enter Dialplan on SIPRegister

Anton Krall akrall-lists at intruder.com.mx
Wed May 25 16:51:19 MST 2005


Damn! This is very nice Chris! 

|-----Original Message-----
|From: asterisk-users-bounces at lists.digium.com 
|[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of 
|Chris A. Icide
|Sent: Miércoles, 25 de Mayo de 2005 02:45 p.m.
|To: asterisk-users at lists.digium.com
|Subject: [Asterisk-Users] Remote Voicemail Notifier / enter 
|Dialplan on SIPRegister
|
|There is a patch on Mantis (http://bugs.digium.com/view.php?id=4371)
|
|Which includes several features.
|
|1.  Support for central voicemail server(s) with remote server 
|notification via IAX
|
|In other words, this patch allows you to configure an Asterisk 
|server as a central voicemail server and to send out voicemail 
|notification to remote Asterisk servers who can then pass the 
|notification on to local clients.
|
|2. Diaplan command to update voicemail pointers
|
|The patch includes a dialplan command (ChangeMailbox) which 
|allows you to change both the central voicemail server as well 
|as the remote clients mailbox pointers.  In other words, you 
|can add/move 'mailbox=' 
|fields via the dialplan.
|
|3. Entry into dial plan upon device registration or loss of 
|registration
|
|This function allows you to configure a dialplan context in 
|which SIP or IAX devises will activate a dialplan thread 
|allowing you to execute any non-audio stream dependant 
|dialplan command(s).  An example might be identifying the 
|location of the registration and using the changemailbox 
|command to direct the correct voicemail indication to the 
|registering device.
|
|We need community support if we want to get this added to asterisk.  
|Please take a gander.  I also have a patch against CVS head 
|05-02-2005 if you want to test against CVS HEAD prior to all 
|the function changes.
|
|Below are notes on the configuration:
|
|First, the remote voicemail notification configuration:
|
|In voicemail.conf under the general section we need to 
|identify that this voicemail server is a centralized voicemail 
|server supplying remote notification.  This is done by adding an
|
|entry that points at an iax entry for this server.  Note that 
|you must add an entry for this
|
|server in your IAX configuration.
|
|[general]
|voicemail_server=<unique_IAX_peername_of_this_server>
|
|On the same server we will configure the voicemail boxes.  
|There is one new entry required over the normal user 
|configuration and that is the remote asterisk server hosting 
|the client device to which we will be sending voicemail 
|indication.  This is included as an IAX entry (must also exist 
|in your IAX config) as shown here
|
|[default]
|<vmbox>:<iax_peer> => <pin>,<name>,etc..
|
|or if we have voicemail box 1000 being served for a client 
|device attached to IAX peer 'sip-reg-srv-001' as defined in 
|your iax.conf file, the line would look like this:
|
|[default]
|1000:sip-reg-srv-001 => 1000,John Doe,jdoe at john.doe....
|
|All servers (both central voicemail and remote client) must 
|have iax entries for each other (and the central server must 
|include an entry for itself in it's own iax.conf file).  
|Servers can be dyanmic
|(host=dynamic) as well as static.
|
|In the sip.conf or iax.conf for each device there is a change 
|to the mailbox= argument.  Note that the mailbox=<user> still 
|works for locally served mailboxes.  For remote mailboxes the 
|format is this:
|
|mailbox=<user>:<vm_context>@<iax_peername_of_VMserver>
|
|so in the example above, it would look like this
|
|sip.conf
|[1000]
|type=friend
|host=dynamic
|mailbox=1000:default at vm-srv-001
|
|where 'vm-srv-001' is the entry in the iax.conf for the 
|central voicemail server.
|
|This configuration does not include automatic routing of 
|voicemail commands (voicemail and voicemailmain).  You must 
|still route calls to voicemail to the central voicemail server 
|through your dialplan.  If you try and call a voicemailbox 
|directly on a remote client you will get a no such 
|voicemailbox error.  So when you want to leave voicemail or 
|retrieve it, the call needs to be sent to the central 
|voicemail server where you would then execute the VoiceMail or 
|VoiceMailMain functions.
|
|
|Second, the ChangeMailbox function
|
|
|There is an application that you can change the mailbox= 
|definition in either iax.conf/sip.conf or voicemail.conf 
|(changes are NOT reflected in the configuration files, they 
|are not updated by this command)
|
|ChangeMailbox(tech,name=newsetting)
|
|On the central voicemail server, you can change both the 
|voicemail entry as well as the sip or iax entry.  On the 
|remote client servers you can only change the sip/iax entries.
|
|To change the remote server in which a client's voicemail 
|status is sent, you would use the Voicemail keyword for 
|technology in the following structure:
|
|1) Voicemail
|ChangeMailbox(Voicemail,<mailbox>@<iax_peername>)
|
|On the system which hosts the UA device, you would use the 
|following structure, with SIP or IAX as the technology:
|
|2) IAX/SIP/etc
|ChangeMailbox(IAX,<user-123>=<mailbox>:<vm-context>@<iax_peerna
me-central_vmserver>)
|
|To completely change the location a voicemail indication is 
|being sent, you may need to exectute this command on both the 
|central vm server as well as the remote client server.  The 
|entry on the voicemail server tells the vm server what remote 
|asterisk server to send the notification to.  The entry on the 
|remote client server tells the local asterisk system which 
|device to notify.  So in the case that the device only changes 
|(you want to send or add vmail indication to another device on 
|the same server) only the SIP or IAX entry need be changed.  
|However if the device moves to a different remote client 
|server, you will also need to tell the central VM server to 
|change where it's sending notification as well.
|
|
|Now the 3rd feature ...
|in iax.conf or sip.conf for each user define the keyword 
|'onregister-context'
|
|syntax:
|
|[user]
|type=friend
|onregister-context=regcontext
|etc
|
|then upon registry, (context,exten) = 
|(<onregister-context>,<user>,1) will be invoked and on unregister the
|(unreg-<onregister-context>,<user>,1) is invoked
|
|So on unregister 'unreg-' is prefixed to the onregister_context
|
|The variable ${DEVICETECH} contains the technology of the 
|device registering.
|
|To rebuild the unique channel id from this, you would use 
|${DEVICETECH}/${EXTEN} which for example would return SIP/1000 
|in the case of that device registering
|
|
|-Chris
|
|_______________________________________________
|Asterisk-Users mailing list
|Asterisk-Users at lists.digium.com
|http://lists.digium.com/mailman/listinfo/asterisk-users
|To UNSUBSCRIBE or update options visit:
|   http://lists.digium.com/mailman/listinfo/asterisk-users
|




More information about the asterisk-users mailing list