[Serusers] Injecting SIP NOTIFY into ser FIFO

Dave Bath dave at fuuz.com
Sun Sep 19 11:16:33 CEST 2004


Hi Java,

Presumably your users are registered with SER?  And you have some
specific routing for when they check their mailbox? Either forwarding a
short code to VoiceMailMain or forwarding a variation of their extension
or something?  How about simply checking for the "BYE" method in this
routing block and using the exec module in SER to force a recheck of the
script on the asterisk box?

D

-----Original Message-----
From: Java Rockx [mailto:javarockx at yahoo.com] 
Sent: 19 September 2004 05:56
To: serusers at lists.iptel.org; Dave Bath
Subject: RE: [Serusers] Injecting SIP NOTIFY into ser FIFO

Dave,

I cheated big time. I use sipsak to send the message from my Asterisk
server to
my ser proxy. I realized to late that I mentioned FIFO in my original
post. 

I use the Asterisk "externnotify" in the voicemail.conf file to specify
an
external bash script. This script then simply "touches" a file in
/var/spool/mwi/ for later processing by cron.

My cron job comes along after the fact and picks up all the files in
/var/spool/mwi/ and generates the appropriate SIP NOTIFY message and
then it
uses sipsak to "shoot" it to the ser proxy.

This works really well for me when I need to turn on the MWI for a UA.
What I
still can't do is turn the MWI off when there are no new messages. I'm
really
having a hard time trying to determine how to hook the "Hang-Up" event
in
Asterisk. I need to essentially have an "externnotify" for hang ups so I
can
check the message status for a the mailbox and cancel the MWI if there
are no
new messages.

I also need to handle SUBSCRIBE messages that the SIP proxy gets. I'm
planning
on have the ser.cfg file execute an external script that will get a
message to
the cron job on my Asterisk box. Once the Asterisk box gets notified of
the
SUBSCRIBE message, it will process the same as if the user just had a
voice
mail left and the externnotify event got fired.

Paul


--- Dave Bath <dave at fuuz.com> wrote:

> Hey Java,
> 
> I know it's cheeky, but I was wondering if you might let me see the
> script you wrote to create the mwi message?  Great piece of work!
> 
> Dave
> 
> -----Original Message-----
> From: serusers-bounces at iptel.org [mailto:serusers-bounces at lists.iptel.org]
On
> Behalf Of Java Rockx
> Sent: 18 September 2004 03:49
> To: Java Rockx; serusers at lists.iptel.org; Fred Tips
> Subject: Re: [Serusers] Injecting SIP NOTIFY into ser FIFO
> 
> I found my problem. I had to convert the NOTIFY message from Unix
format
> to
> Windoz format. I used the unix2dos command to do this.
> 
> Everything is good now.
> 
> P
> 
> --- Java Rockx <javarockx at yahoo.com> wrote:
> 
> > Fred,
> > 
> > I actually messed up my original post. I stated that I am placing my
> NOTIFY
> > messages directly in the ser FIFO. In reality I should have said I'm
> using
> > sipsak to send the message to ser just like any normal UA would.
> > 
> > In my asterisk file sip.conf I have the following:
> > 
> > [general]
> > register => vmserver:number4 at sip01.mycompany.com/vmserver
> > 
> > So asterisk is a registered UA with ser. Doing this I assumed I
could
> simply
> > use sipsak from the asterisk server to send NOTIFY messages to the
ser
> box.
> > 
> > I can infact do this, becuase when I do so the "TO:" SIP UA crashes.
> That
> > tells
> > me that everything is working, but my message is not 100% correct.
> > 
> > I also have the user extension configured in ser and asterisk and
all
> is
> > working because I can leave voice mail and listen to voice mail
> normally.
> > It's
> > just the MWI that is giving me grief.
> > 
> > Paul
> > 
> > --- Fred Tips <fred at callcarrera.com> wrote:
> > 
> > > Do you have mailbox= in * under the sip peer ?
> > > 
> > > ----- Original Message ----- 
> > > From: "Java Rockx" <javarockx at yahoo.com>
> > > To: <serusers at lists.iptel.org>
> > > Sent: Friday, September 17, 2004 3:14 PM
> > > Subject: [Serusers] Injecting SIP NOTIFY into ser FIFO
> > > 
> > > 
> > > > Hello everyone.
> > > >
> > > > Can anyone tell me what I'm doing wrong? I am using Asterisk as
a
> voice
> > > mail
> > > > server for my ser SIP proxy. Everything works fine expect the
> Message
> > > Waiting
> > > > Indicator (MWI). I've read a few articles and got some good feed
> back
> > from
> > > this
> > > > mailing list but here is my problem.
> > > >
> > > > My NOTIFY message is crashing my SIP phone. Here is my setup.
I'm
> using
> > > > "externnotify" in Asterisk to call a /usr/bin/mwi script that I
> wrote.
> > All
> > > this
> > > > script does is create file in /var/spool/mwi that contains the
> > > externnotify
> > > > information.
> > > >
> > > > Then cron periodically processes the messages in /var/spool/mwi.
> By
> > > process I
> > > > mean it will create the SIP NOTIFY messages and place them
> directly in to
> > > the
> > > > ser FIFO. The problem is when this happens the SIP phone
crashes.
> > > >
> > > > Here is a sample of my NOTIFY message that my Asterisk server
cron
> job is
> > > > sending to the ser FIFO. I wish there was a way to just have
> Asterisk
> > > register
> > > > with the ser proxy and handle this automatically.
> > > >
> > > > Can anyone see a problem?
> > > > Regards,
> > > > Paul
> > > >
> > > > --------------------------------------------------
> > > >
> > > > NOTIFY sip:1002 at sip01.mycompany.com SIP/2.0
> > > > Via: SIP/2.0/UDP 4.4.242.201:5060
> > > > From: "vmserver" <sip:vmserver at sip01.mycompany.com>
> > > > To: <sip:1002 at sip01.mycomany.com>
> > > > Contact: <sip:vmserver at sip01.mycompany.com>
> > > > Call-ID: 5b8be1521efe68b5365a36466ad3b87 at 4.4.242.201
> > > > CSeq: 1101 NOTIFY
> > > > User-Agent: VoiceMail
> > > > Event: message-summary
> > > > Content-Type: application/simple-message-summary
> > > > Content-Length: 38
> > > >
> > > >
> > > > Messages-Waiting: yes
> > > > Voicemail: 13/0
> > > >
> > > 
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > _______________________________
> > > > Do you Yahoo!?
> > > > Declare Yourself - Register online to vote today!
> > > > http://vote.yahoo.com
> > > >
> > > > _______________________________________________
> > > > Serusers mailing list
> > > > serusers at lists.iptel.org
> > > > http://lists.iptel.org/mailman/listinfo/serusers
> > > 
> > > 
> > 
> > 
> > 
> > 		
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Mail - 50x more storage than other providers!
> > http://promotions.yahoo.com/new_mail
> > 
> > _______________________________________________
> > Serusers mailing list
> > serusers at lists.iptel.org
> > http://lists.iptel.org/mailman/listinfo/serusers
> > 
> 
> 
> 
> 		
> __________________________________
> Do you Yahoo!?
> New and Improved Yahoo! Mail - Send 10MB messages!
> http://promotions.yahoo.com/new_mail 
> 
> _______________________________________________
> Serusers mailing list
> serusers at lists.iptel.org
> http://lists.iptel.org/mailman/listinfo/serusers
> 
> 
> 
> 
> 



		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 







More information about the sr-users mailing list