I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2011-12-24 08:27:23.401547-08 by bluechalk
Suggest addition of listen callback for NOTIFY events
My SIP application needed notification of SIP NOTIFY events so that it could track MWI status. I made a small modification to Simple.pm to allow this:
diff -c -r Net-SIP-0.64/lib/Net/SIP/Simple.pm Net-SIP-new-0.64/lib/Net/SIP/Simple.pm *** Net-SIP-0.64/lib/Net/SIP/Simple.pm 2011-10-07 08:24:36.000000000 -0400 --- Net-SIP-new-0.64/lib/Net/SIP/Simple.pm 2011-12-24 09:37:53.845103566 -0500 *************** *** 412,417 **** --- 412,424 ---- $self->{endpoint}->new_response( $ctx,$response,$leg,$from ); $self->{endpoint}->close_context( $ctx ); return; + } elsif ( $method eq 'NOTIFY' ) { + DEBUG( 10,"NOTIFY request: ".$request->dump ); + if ( my $notify = $args->{notify} ) { + invoke_callback( $notify, $ctx->{from},$request ); + } + $self->{endpoint}->close_context( $ctx ); + return; } elsif ( $method ne 'INVITE' ) { DEBUG( 10,"drop non-INVITE request: ".$request->dump ); $self->{endpoint}->close_context( $ctx );
The usage is something like...
$sua->listen( notify => sub { my $param = shift; my $request = shift; print "RECEIVED NOTIFY: ", scalar(localtime), "\n"; print $request->{body},"\nEND NOTIFY\n"; } );
Is there any chance that this could be added to the official code?
Direct Responses: 13586 | Write a response
Posted on 2012-01-04 01:41:15.21381-08 by noxxi in response to 13584
Re: Suggest addition of listen callback for NOTIFY events
From my understanding of RFC3265 NOTIFY is used with SUBSCRIBE and NOTIFY gets delivered to the client, not the server. So the handling in listen is IMHO wrong.
Direct Responses: Write a response