noxxi / p5-net-sip

Net::SIP Perl Module
Other
15 stars 22 forks source link

Chain and Filter - Can't get see all Method types #51

Closed ghenry closed 2 years ago

ghenry commented 2 years ago

Hi,

I'm looking to get at all Method types processed:

Web application available at http://127.0.0.1:8090
1634496223.4648 DEBUG:<2>   REQ  OPTIONS sip:192.168.100.90:5060 
1634496223.4652 DEBUG:<1> Net::SIP::Registrar::receive[75]: method OPTIONS addr=<sip:192.168.100.90:5060>
1634496223.4653 DEBUG:<1> Net::SIP::Registrar::receive[78]: sip:192.168.100.90:5060 not locally registered
1634496223.4662 DEBUG:<2> Net::SIP::Leg::deliver[426]: delivery with udp from 192.168.100.90:5060 to 192.168.100.90:50920:
1634496223.4662 DEBUG:<2>   RESP 200 'OK' 
1634496293.6026 DEBUG:<2> Net::SIP::Leg::receive[468]: received packet on sip:192.168.100.90:5060 from sip:192.168.100.90:15832:
1634496293.6026 DEBUG:<2>   REQ  REGISTER sip:192.168.100.90 
1634496293.6034 DEBUG:<2> Net::SIP::Leg::deliver[426]: delivery with udp from 192.168.100.90:5060 to 192.168.100.90:15832:
1634496293.6034 DEBUG:<2>   RESP 200 'OK' 

1634496223.4648 DEBUG:<2>   REQ  OPTIONS sip:192.168.100.90:5060 
...
1634496295.1109 DEBUG:<2>   REQ  PUBLISH sip:1001@192.168.100.90 with body
...
1634496297.1088 DEBUG:<2>   REQ  SUBSCRIBE sip:1001@192.168.100.90 

but I'm only getting INVITEs into my filter (like the docs state - https://metacpan.org/pod/Net::SIP::Simple#listen-(-%ARGS-)):

# https://github.com/noxxi/p5-net-sip/issues/49#issuecomment-902025333
$ua->create_chain(
    [ $ua->create_registrar, $ua->listen( filter => $save_details ) ] );
);

Where should me filter be so I can get all the packets Net::SIP::Registrar is processing too?

noxxi commented 2 years ago

Please don't open issues just for asking question on how to implement things. Use StackOverflow instead for such kind of questions. And if you want to get all requests you need to be at the top of the chain. listen will handle only calls, i.e. INVITE.

ghenry commented 2 years ago

Thanks. Well, I had an issue and I asked. If the issue tracker is just for Bugs, please state that in the project docs or on MetaCPAN. Maybe a Help file pointing at StackOverflow and an appropriate tag?

noxxi commented 2 years ago

I think we have a different understanding of what an issue tracker is. In my opinion it is not a generic support forum, but about bugs, feature requests, ... And it seems to be used mostly this way too. But I agree that the wording is ambivalent and that what you ask about is in some way an "issue" too. Note that I did not add it as issue tracker though in MetaCPAN, but instead I added as bug tracker in Makefile.PL, and MetaCPAN is showing this entry as issue tracker.

Anyway, there is no official support forum for this module and I have not enough time to invest in this. For this reason I would not like to point out StackOverflow in the documentation as the official support site. But I hang around there a lot and often answer questions, including questions about Net::SIP.

ghenry commented 2 years ago

Understood @noxxi and I appreciate your response. Very professional. I wish other contributors and maintainers were like this.

For others, I got this working by doing:

$ua->create_chain(
    [ $ua->create_registrar, $ua->listen ],
    (
        filter => $save_details
    )
);

then in my filter I get a Net::SIP::Request to pull things apart. BTW, this is all for https://github.com/ghenry/SentryPeer in my prototype. I'll git push soon :-)