DM
Davide Marrone
Fri, Mar 14, 2008 3:05 PM
Hi,
I'm writing a simple client using PJSUA, the only things that the client
should do is start a call and at the first ring of the recipient hang up
the call. With the SIP providers that I have tried the SIP message "180
Ringing" isn't sent to the client so I can't handle all the procedure
only with on_call_state callback.
Dumping the traffic of XTen-XLite I have noticed that the singal of
ringing is sent to client with RTP packet.
The problem so is that I need a callback for the incomung RTP traffic, I
want to analize that traffic and hang up the call when the ringing
packet arrives.
I saw the source code and a lower level is used "on_rx_rtp" callback, in
PJSUA I saw the function pjsua_media_transports_attach that is declared
but unfortunately is not yet implemented.
The question is, how can I read the RTP packets using PJSUA? I read
siprtp.c that use directly PJMEDIA but I can't understand how to
integrate PJMEDIA with PJSUA, what I have to do for getting a callback
like on_rx_rtcp?
regards
Davide
Hi,
I'm writing a simple client using PJSUA, the only things that the client
should do is start a call and at the first ring of the recipient hang up
the call. With the SIP providers that I have tried the SIP message "180
Ringing" isn't sent to the client so I can't handle all the procedure
only with on_call_state callback.
Dumping the traffic of XTen-XLite I have noticed that the singal of
ringing is sent to client with RTP packet.
The problem so is that I need a callback for the incomung RTP traffic, I
want to analize that traffic and hang up the call when the ringing
packet arrives.
I saw the source code and a lower level is used "on_rx_rtp" callback, in
PJSUA I saw the function pjsua_media_transports_attach that is declared
but unfortunately is not yet implemented.
The question is, how can I read the RTP packets using PJSUA? I read
siprtp.c that use directly PJMEDIA but I can't understand how to
integrate PJMEDIA with PJSUA, what I have to do for getting a callback
like on_rx_rtcp?
regards
Davide
SV
Samuel Vinson
Fri, Mar 14, 2008 3:20 PM
Hi Davide,
I don't think it works like you described.
When your client receive a call, the callback "on_incoming_call" is called.
You must reply with msg 180 :
pjsua_call_answer(call_id, 180, NULL, NULL);
If you reply immediately by msg 200, the call is established.
To reply you must call the following function to send msg 200 :
pjsua_call_answer(current_call, 200, NULL, NULL);
Samuel
Davide Marrone a écrit :
Hi,
I'm writing a simple client using PJSUA, the only things that the client
should do is start a call and at the first ring of the recipient hang up
the call. With the SIP providers that I have tried the SIP message "180
Ringing" isn't sent to the client so I can't handle all the procedure
only with on_call_state callback.
Dumping the traffic of XTen-XLite I have noticed that the singal of
ringing is sent to client with RTP packet.
The problem so is that I need a callback for the incomung RTP traffic, I
want to analize that traffic and hang up the call when the ringing
packet arrives.
I saw the source code and a lower level is used "on_rx_rtp" callback, in
PJSUA I saw the function pjsua_media_transports_attach that is declared
but unfortunately is not yet implemented.
The question is, how can I read the RTP packets using PJSUA? I read
siprtp.c that use directly PJMEDIA but I can't understand how to
integrate PJMEDIA with PJSUA, what I have to do for getting a callback
like on_rx_rtcp?
regards
Davide
Visit our blog: http://blog.pjsip.org
pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
Hi Davide,
I don't think it works like you described.
When your client receive a call, the callback "on_incoming_call" is called.
You must reply with msg 180 :
pjsua_call_answer(call_id, 180, NULL, NULL);
If you reply immediately by msg 200, the call is established.
To reply you must call the following function to send msg 200 :
pjsua_call_answer(current_call, 200, NULL, NULL);
Samuel
Davide Marrone a écrit :
> Hi,
> I'm writing a simple client using PJSUA, the only things that the client
> should do is start a call and at the first ring of the recipient hang up
> the call. With the SIP providers that I have tried the SIP message "180
> Ringing" isn't sent to the client so I can't handle all the procedure
> only with on_call_state callback.
>
> Dumping the traffic of XTen-XLite I have noticed that the singal of
> ringing is sent to client with RTP packet.
> The problem so is that I need a callback for the incomung RTP traffic, I
> want to analize that traffic and hang up the call when the ringing
> packet arrives.
> I saw the source code and a lower level is used "on_rx_rtp" callback, in
> PJSUA I saw the function pjsua_media_transports_attach that is declared
> but unfortunately is not yet implemented.
> The question is, how can I read the RTP packets using PJSUA? I read
> siprtp.c that use directly PJMEDIA but I can't understand how to
> integrate PJMEDIA with PJSUA, what I have to do for getting a callback
> like on_rx_rtcp?
>
> regards
> Davide
>
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip@lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>
>
>
DM
Davide Marrone
Sat, Mar 15, 2008 3:14 PM
Hi Samuel,
maybe my question wasn't exactly clear. I don't need to receive or hang
up an incoming call, I need to make an outgoing call from my sip client
to exeternal phones. The problem is that I don't know exatly when the
external phone is ringing because via SIP aren't sent packets about that.
Davide
Samuel Vinson wrote:
Hi Davide,
I don't think it works like you described.
When your client receive a call, the callback "on_incoming_call" is called.
You must reply with msg 180 :
pjsua_call_answer(call_id, 180, NULL, NULL);
If you reply immediately by msg 200, the call is established.
To reply you must call the following function to send msg 200 :
pjsua_call_answer(current_call, 200, NULL, NULL);
Samuel
Davide Marrone a écrit :
Hi,
I'm writing a simple client using PJSUA, the only things that the client
should do is start a call and at the first ring of the recipient hang up
the call. With the SIP providers that I have tried the SIP message "180
Ringing" isn't sent to the client so I can't handle all the procedure
only with on_call_state callback.
Dumping the traffic of XTen-XLite I have noticed that the singal of
ringing is sent to client with RTP packet.
The problem so is that I need a callback for the incomung RTP traffic, I
want to analize that traffic and hang up the call when the ringing
packet arrives.
I saw the source code and a lower level is used "on_rx_rtp" callback, in
PJSUA I saw the function pjsua_media_transports_attach that is declared
but unfortunately is not yet implemented.
The question is, how can I read the RTP packets using PJSUA? I read
siprtp.c that use directly PJMEDIA but I can't understand how to
integrate PJMEDIA with PJSUA, what I have to do for getting a callback
like on_rx_rtcp?
regards
Davide
Hi Samuel,
maybe my question wasn't exactly clear. I don't need to receive or hang
up an incoming call, I need to make an outgoing call from my sip client
to exeternal phones. The problem is that I don't know exatly when the
external phone is ringing because via SIP aren't sent packets about that.
Davide
Samuel Vinson wrote:
> Hi Davide,
>
> I don't think it works like you described.
> When your client receive a call, the callback "on_incoming_call" is called.
> You must reply with msg 180 :
> pjsua_call_answer(call_id, 180, NULL, NULL);
> If you reply immediately by msg 200, the call is established.
>
> To reply you must call the following function to send msg 200 :
> pjsua_call_answer(current_call, 200, NULL, NULL);
>
> Samuel
>
>
> Davide Marrone a écrit :
>> Hi,
>> I'm writing a simple client using PJSUA, the only things that the client
>> should do is start a call and at the first ring of the recipient hang up
>> the call. With the SIP providers that I have tried the SIP message "180
>> Ringing" isn't sent to the client so I can't handle all the procedure
>> only with on_call_state callback.
>>
>> Dumping the traffic of XTen-XLite I have noticed that the singal of
>> ringing is sent to client with RTP packet.
>> The problem so is that I need a callback for the incomung RTP traffic, I
>> want to analize that traffic and hang up the call when the ringing
>> packet arrives.
>> I saw the source code and a lower level is used "on_rx_rtp" callback, in
>> PJSUA I saw the function pjsua_media_transports_attach that is declared
>> but unfortunately is not yet implemented.
>> The question is, how can I read the RTP packets using PJSUA? I read
>> siprtp.c that use directly PJMEDIA but I can't understand how to
>> integrate PJMEDIA with PJSUA, what I have to do for getting a callback
>> like on_rx_rtcp?
>>
>> regards
>> Davide
>>
BP
Benny Prijono
Mon, Mar 17, 2008 12:57 PM
Hi Samuel,
maybe my question wasn't exactly clear. I don't need to receive or hang
up an incoming call, I need to make an outgoing call from my sip client
to exeternal phones. The problem is that I don't know exatly when the
external phone is ringing because via SIP aren't sent packets about that.
Is this because the 18x response is lost? If so, reliable provisional
response should solve it I think. You can require remote to send
response reliably with --use-100rel option in pjsua.
If you think that listening for incoming RTP is the only way to go,
then for now the only way is to hack the UDP media transport to call
your callback whenever there's an incoming RTP packet. Or something
like that, I haven't thought of this very thoroughly.
In the future I'm planning to add another callback in pjsua-lib to
allow application to create its own media transport (or to report
media transport creation). This among other thing will enable
application such as yours to do some work with the transport.
cheers,
-benny
On 3/15/08, Davide Marrone <unidavide@email.it> wrote:
> Hi Samuel,
> maybe my question wasn't exactly clear. I don't need to receive or hang
> up an incoming call, I need to make an outgoing call from my sip client
> to exeternal phones. The problem is that I don't know exatly when the
> external phone is ringing because via SIP aren't sent packets about that.
>
Is this because the 18x response is lost? If so, reliable provisional
response should solve it I think. You can require remote to send
response reliably with --use-100rel option in pjsua.
If you think that listening for incoming RTP is the only way to go,
then for now the only way is to hack the UDP media transport to call
your callback whenever there's an incoming RTP packet. Or something
like that, I haven't thought of this very thoroughly.
In the future I'm planning to add another callback in pjsua-lib to
allow application to create its own media transport (or to report
media transport creation). This among other thing will enable
application such as yours to do some work with the transport.
cheers,
-benny
> Davide
DM
Davide Marrone
Mon, Mar 17, 2008 7:50 PM
Hi Benny,
first of all thanks for your reply
Benny Prijono wrote:
Hi Samuel,
maybe my question wasn't exactly clear. I don't need to receive or hang
up an incoming call, I need to make an outgoing call from my sip client
to exeternal phones. The problem is that I don't know exatly when the
external phone is ringing because via SIP aren't sent packets about that.
Is this because the 18x response is lost? If so, reliable provisional
response should solve it I think. You can require remote to send
response reliably with --use-100rel option in pjsua.
no, the problem isn't that, the service (voip.eutelia.it and others
italian services) doesn't send this packet, I don't know why, but it
doesn't arrive, if I use --use-100rel when I try to make a call I get
20:18:40.527 test.c Entered in on_call_state
20:18:40.527 test.c Call 0 is DISCONNECTED [reason=420 (Bad Extension)]
while without it the call is made correctly, anyway I don't think that
100rel is the problem
If you think that listening for incoming RTP is the only way to go,
then for now the only way is to hack the UDP media transport to call
your callback whenever there's an incoming RTP packet. Or something
like that, I haven't thought of this very thoroughly.
Yes, I'm really sure that the only thing to do is to intercept the
incoming RTP traffic. I have discoverd it using xten-xlite, I have made
a lot of tries with tcpdump & ngrep, when I make a call to an external
phone I have saw that:
- the SIP packet 180 ringing doesn't arrive, never
- I receive a SIP packet: 183 Session Progress
- xten-xlite doesn't play the local ringing tone until the change of RTP
traffic
I really made many tries and I'm sure that the only SIP packet that
arrive when the call in on going is 183 Session Progress and "viewing"
with ngrep the RTP packets is really clear that, at a moment when the
traffic change, the client start to play the local ringing tone that
simulate the remote ringing. This moment is exactly when the remote
phone is really ringing. So I'm sure at 100% that I have to get the RTP
traffic.
I don't already know what changes of the traffic I have to intercept but
first of all I have to get it.
In the future I'm planning to add another callback in pjsua-lib to
allow application to create its own media transport (or to report
media transport creation). This among other thing will enable
application such as yours to do some work with the transport.
great, but for now there is a solution to my problem?
I have tried to do that:
// ...
// initialization of pjsua and registration to the server
// ...
// make the call
status = pjsua_call_make_call(acc_id, &uri, 0, NULL, NULL, &call_id);
if (status != PJ_SUCCESS) error_exit("Error making call", status);
// the call start correctly, i receive the SIP 183 packet
// and my remote phone rings
pjsua_call *call;
pjmedia_sock_info skinfo;
call = &pjsua_var.calls[call_id];
// get transport info
pjmedia_transport_get_info(call->med_tp, &skinfo);
if (status != PJ_SUCCESS) error_exit("Error getting info", status);
pj_sockaddr_in rem_addr;
pj_sockaddr_in rem_rtcp;
rem_addr= (pj_sockaddr_in)skinfo.rtp_addr_name;
rem_rtcp= (pj_sockaddr_in)skinfo.rtcp_addr_name;
// is correct this detach ?
pjmedia_transport_detach(call->med_tp, call->user_data);
if (status != PJ_SUCCESS) error_exit("Error detaching transport", status);
// is correct this ?
pjmedia_transport_attach(call->med_tp, NULL, &rem_addr, &rem_rtcp,
sizeof(pj_sockaddr_in), &on_rx_rtp, NULL);
if (status != PJ_SUCCESS) error_exit("Error attaching transport", status);
but it doesn't work, I'm using a modded version of pjsua, but when I run
it I got
20:28:58.792 os_core_unix.c pjlib 0.8.0 for POSIX initialized
20:28:58.792 sip_endpoint.c Creating endpoint instance...
20:28:58.793 pjlib select() I/O Queue created (0x814956c)
20:28:58.793 sip_endpoint.c Module "mod-msg-print" registered
20:28:58.793 sip_transport. Transport manager created.
20:28:58.809 pjsua_core.c pjsua version 0.8.0 for i686-pc-linux-gnu
initialized
20:28:58.898 pjsua_acc.c Registration sent
20:28:59.138 pjsua_acc.c sip:024XXXXX@voip.eutelia.it:
unregistration success
20:28:59.138 test.c Entered in on_reg_state
20:28:59.138 test.c Successfully logged in entering main loop
20:28:59.208 test.c Entered in on_call_state
20:28:59.208 test.c Call 0 state changed to CALLING
20:28:59.208 test.c Entered in on_call_tsx_state
20:28:59.438 test.c Entered in on_call_state
20:28:59.438 test.c Call 0 state changed to CALLING
20:28:59.438 test.c Entered in on_call_tsx_state
20:28:59.438 test.c Entered in on_call_tsx_state
20:28:59.592 test.c Entered in on_call_tsx_state
20:29:01.359 test.c Entered in on_call_state
20:29:01.359 test.c Wait and cancel call numeber: 0
20:29:01.359 test.c Call 0 state changed to EARLY (183 Session
Progress)
test: ../src/pjmedia/transport_udp.c:561: transport_attach: Assertion
`!udp->attached' failed.
Aborted
what's wrong with my code? I have put the pjmedia_transport_detach in
the code but I got that error.
thanks
Davide
p.s. anyway Benny my best congratulations for all you work, this
framework is really incredible and useful !
Hi Benny,
first of all thanks for your reply
Benny Prijono wrote:
> On 3/15/08, Davide Marrone <unidavide@email.it> wrote:
>> Hi Samuel,
>> maybe my question wasn't exactly clear. I don't need to receive or hang
>> up an incoming call, I need to make an outgoing call from my sip client
>> to exeternal phones. The problem is that I don't know exatly when the
>> external phone is ringing because via SIP aren't sent packets about that.
>>
>
> Is this because the 18x response is lost? If so, reliable provisional
> response should solve it I think. You can require remote to send
> response reliably with --use-100rel option in pjsua.
>
no, the problem isn't that, the service (voip.eutelia.it and others
italian services) doesn't send this packet, I don't know why, but it
doesn't arrive, if I use --use-100rel when I try to make a call I get
20:18:40.527 test.c Entered in on_call_state
20:18:40.527 test.c Call 0 is DISCONNECTED [reason=420 (Bad Extension)]
while without it the call is made correctly, anyway I don't think that
100rel is the problem
> If you think that listening for incoming RTP is the only way to go,
> then for now the only way is to hack the UDP media transport to call
> your callback whenever there's an incoming RTP packet. Or something
> like that, I haven't thought of this very thoroughly.
Yes, I'm really sure that the only thing to do is to intercept the
incoming RTP traffic. I have discoverd it using xten-xlite, I have made
a lot of tries with tcpdump & ngrep, when I make a call to an external
phone I have saw that:
- the SIP packet 180 ringing doesn't arrive, never
- I receive a SIP packet: 183 Session Progress
- xten-xlite doesn't play the local ringing tone until the change of RTP
traffic
I really made many tries and I'm sure that the only SIP packet that
arrive when the call in on going is 183 Session Progress and "viewing"
with ngrep the RTP packets is really clear that, at a moment when the
traffic change, the client start to play the local ringing tone that
simulate the remote ringing. This moment is exactly when the remote
phone is really ringing. So I'm sure at 100% that I have to get the RTP
traffic.
I don't already know what changes of the traffic I have to intercept but
first of all I have to get it.
> In the future I'm planning to add another callback in pjsua-lib to
> allow application to create its own media transport (or to report
> media transport creation). This among other thing will enable
> application such as yours to do some work with the transport.
great, but for now there is a solution to my problem?
I have tried to do that:
// ...
// initialization of pjsua and registration to the server
// ...
// make the call
status = pjsua_call_make_call(acc_id, &uri, 0, NULL, NULL, &call_id);
if (status != PJ_SUCCESS) error_exit("Error making call", status);
// the call start correctly, i receive the SIP 183 packet
// and my remote phone rings
pjsua_call *call;
pjmedia_sock_info skinfo;
call = &pjsua_var.calls[call_id];
// get transport info
pjmedia_transport_get_info(call->med_tp, &skinfo);
if (status != PJ_SUCCESS) error_exit("Error getting info", status);
pj_sockaddr_in rem_addr;
pj_sockaddr_in rem_rtcp;
rem_addr= (pj_sockaddr_in)skinfo.rtp_addr_name;
rem_rtcp= (pj_sockaddr_in)skinfo.rtcp_addr_name;
// is correct this detach ?
pjmedia_transport_detach(call->med_tp, call->user_data);
if (status != PJ_SUCCESS) error_exit("Error detaching transport", status);
// is correct this ?
pjmedia_transport_attach(call->med_tp, NULL, &rem_addr, &rem_rtcp,
sizeof(pj_sockaddr_in), &on_rx_rtp, NULL);
if (status != PJ_SUCCESS) error_exit("Error attaching transport", status);
but it doesn't work, I'm using a modded version of pjsua, but when I run
it I got
20:28:58.792 os_core_unix.c pjlib 0.8.0 for POSIX initialized
20:28:58.792 sip_endpoint.c Creating endpoint instance...
20:28:58.793 pjlib select() I/O Queue created (0x814956c)
20:28:58.793 sip_endpoint.c Module "mod-msg-print" registered
20:28:58.793 sip_transport. Transport manager created.
20:28:58.809 pjsua_core.c pjsua version 0.8.0 for i686-pc-linux-gnu
initialized
20:28:58.898 pjsua_acc.c Registration sent
20:28:59.138 pjsua_acc.c sip:024XXXXX@voip.eutelia.it:
unregistration success
20:28:59.138 test.c Entered in on_reg_state
20:28:59.138 test.c Successfully logged in entering main loop
20:28:59.208 test.c Entered in on_call_state
20:28:59.208 test.c Call 0 state changed to CALLING
20:28:59.208 test.c Entered in on_call_tsx_state
20:28:59.438 test.c Entered in on_call_state
20:28:59.438 test.c Call 0 state changed to CALLING
20:28:59.438 test.c Entered in on_call_tsx_state
20:28:59.438 test.c Entered in on_call_tsx_state
20:28:59.592 test.c Entered in on_call_tsx_state
20:29:01.359 test.c Entered in on_call_state
20:29:01.359 test.c Wait and cancel call numeber: 0
20:29:01.359 test.c Call 0 state changed to EARLY (183 Session
Progress)
test: ../src/pjmedia/transport_udp.c:561: transport_attach: Assertion
`!udp->attached' failed.
Aborted
what's wrong with my code? I have put the pjmedia_transport_detach in
the code but I got that error.
thanks
Davide
p.s. anyway Benny my best congratulations for all you work, this
framework is really incredible and useful !
BP
Benny Prijono
Mon, Mar 17, 2008 8:15 PM
Hi Benny,
first of all thanks for your reply
no, the problem isn't that, the service (voip.eutelia.it and others
italian services) doesn't send this packet, I don't know why, but it
doesn't arrive, if I use --use-100rel when I try to make a call I get
20:18:40.527 test.c Entered in on_call_state
20:18:40.527 test.c Call 0 is DISCONNECTED [reason=420 (Bad Extension)]
while without it the call is made correctly, anyway I don't think that
100rel is the problem
Yeah, the 420 response means remote doesn't support the extension.
Yes, I'm really sure that the only thing to do is to intercept the
incoming RTP traffic. I have discoverd it using xten-xlite, I have made
a lot of tries with tcpdump & ngrep, when I make a call to an external
phone I have saw that:
- the SIP packet 180 ringing doesn't arrive, never
- I receive a SIP packet: 183 Session Progress
- xten-xlite doesn't play the local ringing tone until the change of RTP
traffic
I really made many tries and I'm sure that the only SIP packet that
arrive when the call in on going is 183 Session Progress and "viewing"
with ngrep the RTP packets is really clear that, at a moment when the
traffic change, the client start to play the local ringing tone that
simulate the remote ringing. This moment is exactly when the remote
phone is really ringing. So I'm sure at 100% that I have to get the RTP
traffic.
I don't already know what changes of the traffic I have to intercept but
first of all I have to get it.
Sorry now I'm a bit lost. If you said you've got 183, then why can't
you just "start the call" with the arrival of this 183 response
(rather than waiting for the 180 response). It is quite common to
receive 183 instead of 180 if you are calling a PSTN gateway, and if
you listen to the incoming audio most likely you will hear ringing
tone with the 183 response.
great, but for now there is a solution to my problem?
Since you've had 183 (and I assume there is SDP in the 183), your
media has been established, and your on_call_media_state() callback
should have been called.
So now you can just poll the media statistic of the call to see if
you've received RTP packets. You can use "dq" command in pjsua to show
the call's media statistic (and trace the implementation of this
command to see how to retrieve the media statistic programmatically).
I'm not sure why your code below doesn't work though.
cheers,
-benny
I have tried to do that:
// ...
// initialization of pjsua and registration to the server
// ...
// make the call
status = pjsua_call_make_call(acc_id, &uri, 0, NULL, NULL, &call_id);
if (status != PJ_SUCCESS) error_exit("Error making call", status);
// the call start correctly, i receive the SIP 183 packet
// and my remote phone rings
pjsua_call *call;
pjmedia_sock_info skinfo;
call = &pjsua_var.calls[call_id];
// get transport info
pjmedia_transport_get_info(call->med_tp, &skinfo);
if (status != PJ_SUCCESS) error_exit("Error getting info", status);
pj_sockaddr_in rem_addr;
pj_sockaddr_in rem_rtcp;
rem_addr= (pj_sockaddr_in)skinfo.rtp_addr_name;
rem_rtcp= (pj_sockaddr_in)skinfo.rtcp_addr_name;
// is correct this detach ?
pjmedia_transport_detach(call->med_tp, call->user_data);
if (status != PJ_SUCCESS) error_exit("Error detaching transport", status);
// is correct this ?
pjmedia_transport_attach(call->med_tp, NULL, &rem_addr, &rem_rtcp,
sizeof(pj_sockaddr_in), &on_rx_rtp, NULL);
if (status != PJ_SUCCESS) error_exit("Error attaching transport", status);
but it doesn't work, I'm using a modded version of pjsua, but when I run
it I got
20:28:58.792 os_core_unix.c pjlib 0.8.0 for POSIX initialized
20:28:58.792 sip_endpoint.c Creating endpoint instance...
20:28:58.793 pjlib select() I/O Queue created (0x814956c)
20:28:58.793 sip_endpoint.c Module "mod-msg-print" registered
20:28:58.793 sip_transport. Transport manager created.
20:28:58.809 pjsua_core.c pjsua version 0.8.0 for i686-pc-linux-gnu
initialized
20:28:58.898 pjsua_acc.c Registration sent
20:28:59.138 pjsua_acc.c sip:024XXXXX@voip.eutelia.it:
unregistration success
20:28:59.138 test.c Entered in on_reg_state
20:28:59.138 test.c Successfully logged in entering main loop
20:28:59.208 test.c Entered in on_call_state
20:28:59.208 test.c Call 0 state changed to CALLING
20:28:59.208 test.c Entered in on_call_tsx_state
20:28:59.438 test.c Entered in on_call_state
20:28:59.438 test.c Call 0 state changed to CALLING
20:28:59.438 test.c Entered in on_call_tsx_state
20:28:59.438 test.c Entered in on_call_tsx_state
20:28:59.592 test.c Entered in on_call_tsx_state
20:29:01.359 test.c Entered in on_call_state
20:29:01.359 test.c Wait and cancel call numeber: 0
20:29:01.359 test.c Call 0 state changed to EARLY (183 Session
Progress)
test: ../src/pjmedia/transport_udp.c:561: transport_attach: Assertion
`!udp->attached' failed.
Aborted
what's wrong with my code? I have put the pjmedia_transport_detach in
the code but I got that error.
thanks
Davide
p.s. anyway Benny my best congratulations for all you work, this
framework is really incredible and useful !
Visit our blog: http://blog.pjsip.org
pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
On 3/17/08, Davide Marrone <unidavide@email.it> wrote:
> Hi Benny,
> first of all thanks for your reply
>
> no, the problem isn't that, the service (voip.eutelia.it and others
> italian services) doesn't send this packet, I don't know why, but it
> doesn't arrive, if I use --use-100rel when I try to make a call I get
>
> 20:18:40.527 test.c Entered in on_call_state
> 20:18:40.527 test.c Call 0 is DISCONNECTED [reason=420 (Bad Extension)]
>
> while without it the call is made correctly, anyway I don't think that
> 100rel is the problem
>
Yeah, the 420 response means remote doesn't support the extension.
> Yes, I'm really sure that the only thing to do is to intercept the
> incoming RTP traffic. I have discoverd it using xten-xlite, I have made
> a lot of tries with tcpdump & ngrep, when I make a call to an external
> phone I have saw that:
> - the SIP packet 180 ringing doesn't arrive, never
> - I receive a SIP packet: 183 Session Progress
> - xten-xlite doesn't play the local ringing tone until the change of RTP
> traffic
>
> I really made many tries and I'm sure that the only SIP packet that
> arrive when the call in on going is 183 Session Progress and "viewing"
> with ngrep the RTP packets is really clear that, at a moment when the
> traffic change, the client start to play the local ringing tone that
> simulate the remote ringing. This moment is exactly when the remote
> phone is really ringing. So I'm sure at 100% that I have to get the RTP
> traffic.
> I don't already know what changes of the traffic I have to intercept but
> first of all I have to get it.
>
Sorry now I'm a bit lost. If you said you've got 183, then why can't
you just "start the call" with the arrival of this 183 response
(rather than waiting for the 180 response). It is quite common to
receive 183 instead of 180 if you are calling a PSTN gateway, and if
you listen to the incoming audio most likely you will hear ringing
tone with the 183 response.
>
> great, but for now there is a solution to my problem?
Since you've had 183 (and I assume there is SDP in the 183), your
media has been established, and your on_call_media_state() callback
should have been called.
So now you can just poll the media statistic of the call to see if
you've received RTP packets. You can use "dq" command in pjsua to show
the call's media statistic (and trace the implementation of this
command to see how to retrieve the media statistic programmatically).
I'm not sure why your code below doesn't work though.
cheers,
-benny
> I have tried to do that:
>
> // ...
> // initialization of pjsua and registration to the server
> // ...
>
> // make the call
> status = pjsua_call_make_call(acc_id, &uri, 0, NULL, NULL, &call_id);
> if (status != PJ_SUCCESS) error_exit("Error making call", status);
>
> // the call start correctly, i receive the SIP 183 packet
> // and my remote phone rings
>
> pjsua_call *call;
> pjmedia_sock_info skinfo;
>
> call = &pjsua_var.calls[call_id];
>
> // get transport info
> pjmedia_transport_get_info(call->med_tp, &skinfo);
> if (status != PJ_SUCCESS) error_exit("Error getting info", status);
>
> pj_sockaddr_in rem_addr;
> pj_sockaddr_in rem_rtcp;
> rem_addr= (pj_sockaddr_in)skinfo.rtp_addr_name;
> rem_rtcp= (pj_sockaddr_in)skinfo.rtcp_addr_name;
>
> // is correct this detach ?
> pjmedia_transport_detach(call->med_tp, call->user_data);
> if (status != PJ_SUCCESS) error_exit("Error detaching transport", status);
>
> // is correct this ?
> pjmedia_transport_attach(call->med_tp, NULL, &rem_addr, &rem_rtcp,
> sizeof(pj_sockaddr_in), &on_rx_rtp, NULL);
> if (status != PJ_SUCCESS) error_exit("Error attaching transport", status);
>
>
> but it doesn't work, I'm using a modded version of pjsua, but when I run
> it I got
>
>
> 20:28:58.792 os_core_unix.c pjlib 0.8.0 for POSIX initialized
> 20:28:58.792 sip_endpoint.c Creating endpoint instance...
> 20:28:58.793 pjlib select() I/O Queue created (0x814956c)
> 20:28:58.793 sip_endpoint.c Module "mod-msg-print" registered
> 20:28:58.793 sip_transport. Transport manager created.
> 20:28:58.809 pjsua_core.c pjsua version 0.8.0 for i686-pc-linux-gnu
> initialized
> 20:28:58.898 pjsua_acc.c Registration sent
> 20:28:59.138 pjsua_acc.c sip:024XXXXX@voip.eutelia.it:
> unregistration success
> 20:28:59.138 test.c Entered in on_reg_state
> 20:28:59.138 test.c Successfully logged in entering main loop
> 20:28:59.208 test.c Entered in on_call_state
> 20:28:59.208 test.c Call 0 state changed to CALLING
> 20:28:59.208 test.c Entered in on_call_tsx_state
> 20:28:59.438 test.c Entered in on_call_state
> 20:28:59.438 test.c Call 0 state changed to CALLING
> 20:28:59.438 test.c Entered in on_call_tsx_state
> 20:28:59.438 test.c Entered in on_call_tsx_state
> 20:28:59.592 test.c Entered in on_call_tsx_state
> 20:29:01.359 test.c Entered in on_call_state
> 20:29:01.359 test.c Wait and cancel call numeber: 0
> 20:29:01.359 test.c Call 0 state changed to EARLY (183 Session
> Progress)
> test: ../src/pjmedia/transport_udp.c:561: transport_attach: Assertion
> `!udp->attached' failed.
> Aborted
>
> what's wrong with my code? I have put the pjmedia_transport_detach in
> the code but I got that error.
>
> thanks
>
> Davide
>
>
> p.s. anyway Benny my best congratulations for all you work, this
> framework is really incredible and useful !
>
>
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip@lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>
DM
Davide Marrone
Wed, Mar 19, 2008 2:45 PM
Yes, I'm really sure that the only thing to do is to intercept the
incoming RTP traffic. I have discoverd it using xten-xlite, I have made
a lot of tries with tcpdump & ngrep, when I make a call to an external
phone I have saw that:
- the SIP packet 180 ringing doesn't arrive, never
- I receive a SIP packet: 183 Session Progress
- xten-xlite doesn't play the local ringing tone until the change of RTP
traffic
I really made many tries and I'm sure that the only SIP packet that
arrive when the call in on going is 183 Session Progress and "viewing"
with ngrep the RTP packets is really clear that, at a moment when the
traffic change, the client start to play the local ringing tone that
simulate the remote ringing. This moment is exactly when the remote
phone is really ringing. So I'm sure at 100% that I have to get the RTP
traffic.
I don't already know what changes of the traffic I have to intercept but
first of all I have to get it.
Sorry now I'm a bit lost. If you said you've got 183, then why can't
you just "start the call" with the arrival of this 183 response
(rather than waiting for the 180 response). It is quite common to
receive 183 instead of 180 if you are calling a PSTN gateway, and if
you listen to the incoming audio most likely you will hear ringing
tone with the 183 response.
Yes, I have to call mobile phones.
Since you've had 183 (and I assume there is SDP in the 183), your
media has been established, and your on_call_media_state() callback
should have been called.
Yes, you right, in the 183 there is SDP, the media is established and
the on_call_media_state is called.
So now you can just poll the media statistic of the call to see if
you've received RTP packets. You can use "dq" command in pjsua to show
the call's media statistic (and trace the implementation of this
command to see how to retrieve the media statistic programmatically).
I have tried to do that, I saw that the "dq" calls the pjsua_call_dump
and I saw in the implementation that it calls dump_media_session to
retrive RTP statistic.
The the problem is: how can I understand from the statistics when the
remote phone is ringing ?
I have to know exactly when the remote phone start to ring and I have to
immediatly hang up the call.
The program that I'm writing must do only a single ring on the remote
phone, this is a kind of "cover signal" that wakeup the mobile phone.
The program need to be perfectly synchronized because I have to minimize
the ringing time so the user cannot answer to the call. If the user
answer to the call I have a to pay for it, so the ringing time must be
really short to avoid charge for me.
cheers
Davide
Benny Prijono wrote:
>> Yes, I'm really sure that the only thing to do is to intercept the
>> incoming RTP traffic. I have discoverd it using xten-xlite, I have made
>> a lot of tries with tcpdump & ngrep, when I make a call to an external
>> phone I have saw that:
>> - the SIP packet 180 ringing doesn't arrive, never
>> - I receive a SIP packet: 183 Session Progress
>> - xten-xlite doesn't play the local ringing tone until the change of RTP
>> traffic
>>
>> I really made many tries and I'm sure that the only SIP packet that
>> arrive when the call in on going is 183 Session Progress and "viewing"
>> with ngrep the RTP packets is really clear that, at a moment when the
>> traffic change, the client start to play the local ringing tone that
>> simulate the remote ringing. This moment is exactly when the remote
>> phone is really ringing. So I'm sure at 100% that I have to get the RTP
>> traffic.
>> I don't already know what changes of the traffic I have to intercept but
>> first of all I have to get it.
>>
>
> Sorry now I'm a bit lost. If you said you've got 183, then why can't
> you just "start the call" with the arrival of this 183 response
> (rather than waiting for the 180 response). It is quite common to
> receive 183 instead of 180 if you are calling a PSTN gateway, and if
> you listen to the incoming audio most likely you will hear ringing
> tone with the 183 response.
Yes, I have to call mobile phones.
> Since you've had 183 (and I assume there is SDP in the 183), your
> media has been established, and your on_call_media_state() callback
> should have been called.
Yes, you right, in the 183 there is SDP, the media is established and
the on_call_media_state is called.
> So now you can just poll the media statistic of the call to see if
> you've received RTP packets. You can use "dq" command in pjsua to show
> the call's media statistic (and trace the implementation of this
> command to see how to retrieve the media statistic programmatically).
I have tried to do that, I saw that the "dq" calls the pjsua_call_dump
and I saw in the implementation that it calls dump_media_session to
retrive RTP statistic.
The the problem is: how can I understand from the statistics when the
remote phone is ringing ?
I have to know exactly when the remote phone start to ring and I have to
immediatly hang up the call.
The program that I'm writing must do only a single ring on the remote
phone, this is a kind of "cover signal" that wakeup the mobile phone.
The program need to be perfectly synchronized because I have to minimize
the ringing time so the user cannot answer to the call. If the user
answer to the call I have a to pay for it, so the ringing time must be
really short to avoid charge for me.
cheers
Davide
RK
Roland Klabunde
Wed, Mar 19, 2008 2:57 PM
The the problem is: how can I understand from the statistics when the
remote phone is ringing ?
If there is no explicit RINGING SIP message, you would have to analyze the
received RTP in order to find the ringtone pattern... Nearly impossible, I
guess.
----- Original Message -----
From: "Davide Marrone" unidavide@email.it
To: "pjsip list" pjsip@lists.pjsip.org
Sent: Wednesday, March 19, 2008 3:45 PM
Subject: Re: [pjsip] Is possibile to have a on_rx_rtp callback with PJSUA?
Yes, I'm really sure that the only thing to do is to intercept the
incoming RTP traffic. I have discoverd it using xten-xlite, I have made
a lot of tries with tcpdump & ngrep, when I make a call to an external
phone I have saw that:
- the SIP packet 180 ringing doesn't arrive, never
- I receive a SIP packet: 183 Session Progress
- xten-xlite doesn't play the local ringing tone until the change of
RTP
traffic
I really made many tries and I'm sure that the only SIP packet that
arrive when the call in on going is 183 Session Progress and "viewing"
with ngrep the RTP packets is really clear that, at a moment when the
traffic change, the client start to play the local ringing tone that
simulate the remote ringing. This moment is exactly when the remote
phone is really ringing. So I'm sure at 100% that I have to get the RTP
traffic.
I don't already know what changes of the traffic I have to intercept
but
first of all I have to get it.
Sorry now I'm a bit lost. If you said you've got 183, then why can't
you just "start the call" with the arrival of this 183 response
(rather than waiting for the 180 response). It is quite common to
receive 183 instead of 180 if you are calling a PSTN gateway, and if
you listen to the incoming audio most likely you will hear ringing
tone with the 183 response.
Yes, I have to call mobile phones.
Since you've had 183 (and I assume there is SDP in the 183), your
media has been established, and your on_call_media_state() callback
should have been called.
Yes, you right, in the 183 there is SDP, the media is established and
the on_call_media_state is called.
So now you can just poll the media statistic of the call to see if
you've received RTP packets. You can use "dq" command in pjsua to show
the call's media statistic (and trace the implementation of this
command to see how to retrieve the media statistic programmatically).
I have tried to do that, I saw that the "dq" calls the pjsua_call_dump
and I saw in the implementation that it calls dump_media_session to
retrive RTP statistic.
The the problem is: how can I understand from the statistics when the
remote phone is ringing ?
I have to know exactly when the remote phone start to ring and I have to
immediatly hang up the call.
The program that I'm writing must do only a single ring on the remote
phone, this is a kind of "cover signal" that wakeup the mobile phone.
The program need to be perfectly synchronized because I have to minimize
the ringing time so the user cannot answer to the call. If the user
answer to the call I have a to pay for it, so the ringing time must be
really short to avoid charge for me.
cheers
Davide
Visit our blog: http://blog.pjsip.org
pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
> The the problem is: how can I understand from the statistics when the
> remote phone is ringing ?
If there is no explicit RINGING SIP message, you would have to analyze the
received RTP in order to find the ringtone pattern... Nearly impossible, I
guess.
----- Original Message -----
From: "Davide Marrone" <unidavide@email.it>
To: "pjsip list" <pjsip@lists.pjsip.org>
Sent: Wednesday, March 19, 2008 3:45 PM
Subject: Re: [pjsip] Is possibile to have a on_rx_rtp callback with PJSUA?
> Benny Prijono wrote:
>>> Yes, I'm really sure that the only thing to do is to intercept the
>>> incoming RTP traffic. I have discoverd it using xten-xlite, I have made
>>> a lot of tries with tcpdump & ngrep, when I make a call to an external
>>> phone I have saw that:
>>> - the SIP packet 180 ringing doesn't arrive, never
>>> - I receive a SIP packet: 183 Session Progress
>>> - xten-xlite doesn't play the local ringing tone until the change of
>>> RTP
>>> traffic
>>>
>>> I really made many tries and I'm sure that the only SIP packet that
>>> arrive when the call in on going is 183 Session Progress and "viewing"
>>> with ngrep the RTP packets is really clear that, at a moment when the
>>> traffic change, the client start to play the local ringing tone that
>>> simulate the remote ringing. This moment is exactly when the remote
>>> phone is really ringing. So I'm sure at 100% that I have to get the RTP
>>> traffic.
>>> I don't already know what changes of the traffic I have to intercept
>>> but
>>> first of all I have to get it.
>>>
>>
>> Sorry now I'm a bit lost. If you said you've got 183, then why can't
>> you just "start the call" with the arrival of this 183 response
>> (rather than waiting for the 180 response). It is quite common to
>> receive 183 instead of 180 if you are calling a PSTN gateway, and if
>> you listen to the incoming audio most likely you will hear ringing
>> tone with the 183 response.
>
> Yes, I have to call mobile phones.
>
>> Since you've had 183 (and I assume there is SDP in the 183), your
>> media has been established, and your on_call_media_state() callback
>> should have been called.
>
> Yes, you right, in the 183 there is SDP, the media is established and
> the on_call_media_state is called.
>
>> So now you can just poll the media statistic of the call to see if
>> you've received RTP packets. You can use "dq" command in pjsua to show
>> the call's media statistic (and trace the implementation of this
>> command to see how to retrieve the media statistic programmatically).
>
> I have tried to do that, I saw that the "dq" calls the pjsua_call_dump
> and I saw in the implementation that it calls dump_media_session to
> retrive RTP statistic.
> The the problem is: how can I understand from the statistics when the
> remote phone is ringing ?
> I have to know exactly when the remote phone start to ring and I have to
> immediatly hang up the call.
> The program that I'm writing must do only a single ring on the remote
> phone, this is a kind of "cover signal" that wakeup the mobile phone.
>
> The program need to be perfectly synchronized because I have to minimize
> the ringing time so the user cannot answer to the call. If the user
> answer to the call I have a to pay for it, so the ringing time must be
> really short to avoid charge for me.
>
> cheers
> Davide
>
>
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip@lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>
DM
Davide Marrone
Wed, Mar 19, 2008 5:06 PM
The the problem is: how can I understand from the statistics when the
remote phone is ringing ?
If there is no explicit RINGING SIP message, you would have to analyze the
received RTP in order to find the ringtone pattern... Nearly impossible, I
guess.
Is exactly what I want to do, I want to analyze the RTP traffic and
recognize the ringtone pattern. Firt of all I need to get the RTP
traffic, have you any suggestion to get it?
cheers
Davide
Roland Klabunde wrote:
>> The the problem is: how can I understand from the statistics when the
>> remote phone is ringing ?
> If there is no explicit RINGING SIP message, you would have to analyze the
> received RTP in order to find the ringtone pattern... Nearly impossible, I
> guess.
Is exactly what I want to do, I want to analyze the RTP traffic and
recognize the ringtone pattern. Firt of all I need to get the RTP
traffic, have you any suggestion to get it?
cheers
Davide
BP
Benny Prijono
Wed, Mar 19, 2008 5:13 PM
The the problem is: how can I understand from the statistics when the
remote phone is ringing ?
If there is no explicit RINGING SIP message, you would have to analyze the
received RTP in order to find the ringtone pattern... Nearly impossible, I
guess.
David,
Since originally you just want to know whether incoming RTP packets
have been received, you can just check that in the call media
statistic (it's there somewhere if you look at it carefully ;-) ).
But Roland is right, just because you have RTP doesn't mean remote is
ringing. It could well be that remote is sending "Sorry the number is
wrong" prompt.
Cheers,
-benny
On 3/19/08, Roland Klabunde <roland.klabunde@freenet.de> wrote:
> > The the problem is: how can I understand from the statistics when the
> > remote phone is ringing ?
>
> If there is no explicit RINGING SIP message, you would have to analyze the
> received RTP in order to find the ringtone pattern... Nearly impossible, I
> guess.
David,
Since originally you just want to know whether incoming RTP packets
have been received, you can just check that in the call media
statistic (it's there somewhere if you look at it carefully ;-) ).
But Roland is right, just because you have RTP doesn't mean remote is
ringing. It could well be that remote is sending "Sorry the number is
wrong" prompt.
Cheers,
-benny
DM
Davide Marrone
Wed, Mar 19, 2008 5:42 PM
The the problem is: how can I understand from the statistics when the
remote phone is ringing ?
If there is no explicit RINGING SIP message, you would have to analyze the
received RTP in order to find the ringtone pattern... Nearly impossible, I
guess.
David,
Since originally you just want to know whether incoming RTP packets
have been received, you can just check that in the call media
statistic (it's there somewhere if you look at it carefully ;-) ).
But Roland is right, just because you have RTP doesn't mean remote is
ringing. It could well be that remote is sending "Sorry the number is
wrong" prompt.
Hi Benny,
in my first message I wrote:
The problem so is that I need a callback for the incomung RTP traffic, I
want to analize that traffic and hang up the call when the ringing
packet arrives.
maybe wasn't exactly clear, sorry for my english, I know that is not so
good.
Now I think that all is clear, I saw the media statistics and I saw the
number of incoming RTP packets but, you have correctly said that RTP
doesn't mean remote is ringing, so I need to get the RTP traffic and
analyze it.
Can you give me some hint to get the RTP traffic?
thanks again
Davide
Benny Prijono wrote:
> On 3/19/08, Roland Klabunde <roland.klabunde@freenet.de> wrote:
>>> The the problem is: how can I understand from the statistics when the
>> > remote phone is ringing ?
>>
>> If there is no explicit RINGING SIP message, you would have to analyze the
>> received RTP in order to find the ringtone pattern... Nearly impossible, I
>> guess.
>
> David,
>
> Since originally you just want to know whether incoming RTP packets
> have been received, you can just check that in the call media
> statistic (it's there somewhere if you look at it carefully ;-) ).
>
> But Roland is right, just because you have RTP doesn't mean remote is
> ringing. It could well be that remote is sending "Sorry the number is
> wrong" prompt.
Hi Benny,
in my first message I wrote:
> The problem so is that I need a callback for the incomung RTP traffic, I
> want to analize that traffic and hang up the call when the ringing
> packet arrives.
maybe wasn't exactly clear, sorry for my english, I know that is not so
good.
Now I think that all is clear, I saw the media statistics and I saw the
number of incoming RTP packets but, you have correctly said that RTP
doesn't mean remote is ringing, so I need to get the RTP traffic and
analyze it.
Can you give me some hint to get the RTP traffic?
thanks again
Davide
BP
Benny Prijono
Wed, Mar 19, 2008 5:45 PM
The the problem is: how can I understand from the statistics when the
remote phone is ringing ?
If there is no explicit RINGING SIP message, you would have to analyze the
received RTP in order to find the ringtone pattern... Nearly impossible, I
guess.
Is exactly what I want to do, I want to analyze the RTP traffic and
recognize the ringtone pattern. Firt of all I need to get the RTP
traffic, have you any suggestion to get it?
Ah right, I misunderstood what you're trying to do (and it seems that
we've been discussing the wrong topic!).
So you want to do some signal analysis. The good news is that the
media has been established, so we can just peek at the PCM signal
rather than hacking the incoming RTP packets, and this is very easy
with PJSUA-LIB!
What you need to do is something like this:
- implement your signal analysis as a sink media port
(http://trac.pjsip.org/repos/wiki/FAQ#audio-man)
- register this port to pjsua-lib's conference bridge (pjsua_conf_add_port())
- once call's media is establish, connect the call's media slot to
your signal analysis port (with pjsua_conf_connect()) and begin your
signal analysis!
Cheers,
-benny
On 3/19/08, Davide Marrone <unidavide@email.it> wrote:
> Roland Klabunde wrote:
> >> The the problem is: how can I understand from the statistics when the
> >> remote phone is ringing ?
> > If there is no explicit RINGING SIP message, you would have to analyze the
> > received RTP in order to find the ringtone pattern... Nearly impossible, I
> > guess.
>
> Is exactly what I want to do, I want to analyze the RTP traffic and
> recognize the ringtone pattern. Firt of all I need to get the RTP
> traffic, have you any suggestion to get it?
Ah right, I misunderstood what you're trying to do (and it seems that
we've been discussing the wrong topic!).
So you want to do some signal analysis. The good news is that the
media has been established, so we can just peek at the PCM signal
rather than hacking the incoming RTP packets, and this is very easy
with PJSUA-LIB!
What you need to do is something like this:
- implement your signal analysis as a sink media port
(http://trac.pjsip.org/repos/wiki/FAQ#audio-man)
- register this port to pjsua-lib's conference bridge (pjsua_conf_add_port())
- once call's media is establish, connect the call's media slot to
your signal analysis port (with pjsua_conf_connect()) and begin your
signal analysis!
Cheers,
-benny
RK
Roland Klabunde
Wed, Mar 19, 2008 6:48 PM
If there is no explicit RINGING SIP message, you would have to analyze
received RTP in order to find the ringtone pattern... Nearly
So you want to do some signal analysis. The good news is that the
media has been established, so we can just peek at the PCM signal
rather than hacking the incoming RTP packets, and this is very easy
with PJSUA-LIB!
I'm not up to date here. What in case of G.72x? Does he have access to plain
PCM data? If so, the signal analysis isn't really that impossible, I claimed
before :)
But what in case the user is busy? Or he gets some sort of voice annotation?
("Then number you have dialed...") Could become more problematic than,
though
Regards
----- Original Message -----
From: "Benny Prijono" bennylp@pjsip.org
To: "pjsip list" pjsip@lists.pjsip.org
Sent: Wednesday, March 19, 2008 6:45 PM
Subject: Re: [pjsip] Is possibile to have a on_rx_rtp callback with PJSUA?
The the problem is: how can I understand from the statistics when the
remote phone is ringing ?
If there is no explicit RINGING SIP message, you would have to analyze
received RTP in order to find the ringtone pattern... Nearly
Is exactly what I want to do, I want to analyze the RTP traffic and
recognize the ringtone pattern. Firt of all I need to get the RTP
traffic, have you any suggestion to get it?
Ah right, I misunderstood what you're trying to do (and it seems that
we've been discussing the wrong topic!).
So you want to do some signal analysis. The good news is that the
media has been established, so we can just peek at the PCM signal
rather than hacking the incoming RTP packets, and this is very easy
with PJSUA-LIB!
What you need to do is something like this:
- implement your signal analysis as a sink media port
(http://trac.pjsip.org/repos/wiki/FAQ#audio-man)
- register this port to pjsua-lib's conference bridge
(pjsua_conf_add_port())
- once call's media is establish, connect the call's media slot to
your signal analysis port (with pjsua_conf_connect()) and begin your
signal analysis!
Cheers,
-benny
Visit our blog: http://blog.pjsip.org
pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>> > If there is no explicit RINGING SIP message, you would have to analyze
>> the
>> > received RTP in order to find the ringtone pattern... Nearly
>> impossible, I
>> > guess.
> So you want to do some signal analysis. The good news is that the
> media has been established, so we can just peek at the PCM signal
> rather than hacking the incoming RTP packets, and this is very easy
> with PJSUA-LIB!
I'm not up to date here. What in case of G.72x? Does he have access to plain
PCM data? If so, the signal analysis isn't really that impossible, I claimed
before :)
But what in case the user is busy? Or he gets some sort of voice annotation?
("Then number you have dialed...") Could become more problematic than,
though
Regards
----- Original Message -----
From: "Benny Prijono" <bennylp@pjsip.org>
To: "pjsip list" <pjsip@lists.pjsip.org>
Sent: Wednesday, March 19, 2008 6:45 PM
Subject: Re: [pjsip] Is possibile to have a on_rx_rtp callback with PJSUA?
> On 3/19/08, Davide Marrone <unidavide@email.it> wrote:
>> Roland Klabunde wrote:
>> >> The the problem is: how can I understand from the statistics when the
>> >> remote phone is ringing ?
>> > If there is no explicit RINGING SIP message, you would have to analyze
>> the
>> > received RTP in order to find the ringtone pattern... Nearly
>> impossible, I
>> > guess.
>>
>> Is exactly what I want to do, I want to analyze the RTP traffic and
>> recognize the ringtone pattern. Firt of all I need to get the RTP
>> traffic, have you any suggestion to get it?
>
> Ah right, I misunderstood what you're trying to do (and it seems that
> we've been discussing the wrong topic!).
>
> So you want to do some signal analysis. The good news is that the
> media has been established, so we can just peek at the PCM signal
> rather than hacking the incoming RTP packets, and this is very easy
> with PJSUA-LIB!
>
> What you need to do is something like this:
> - implement your signal analysis as a sink media port
> (http://trac.pjsip.org/repos/wiki/FAQ#audio-man)
> - register this port to pjsua-lib's conference bridge
> (pjsua_conf_add_port())
> - once call's media is establish, connect the call's media slot to
> your signal analysis port (with pjsua_conf_connect()) and begin your
> signal analysis!
>
> Cheers,
> -benny
>
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip@lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>
BP
Benny Prijono
Wed, Mar 19, 2008 7:27 PM
So you want to do some signal analysis. The good news is that the
media has been established, so we can just peek at the PCM signal
rather than hacking the incoming RTP packets, and this is very easy
with PJSUA-LIB!
I'm not up to date here. What in case of G.72x? Does he have access to plain
PCM data? If so, the signal analysis isn't really that impossible, I claimed
before :)
Since we've got 183 response with SDP, that means codec has been
negotiated, so we don't need to care about RTP and just work at PCM
level.
But what in case the user is busy? Or he gets some sort of voice annotation?
("Then number you have dialed...") Could become more problematic than,
though
Well I didn't mean signal analysis is easy. ;-)
What I mean to say was that if you want to peek at the PCM samples,
that should be easy with PJSUA-LIB. For the signal analysis itself,
I'll leave that to Davide. :)
cheers,
-benny
Regards
----- Original Message -----
From: "Benny Prijono" bennylp@pjsip.org
To: "pjsip list" pjsip@lists.pjsip.org
Sent: Wednesday, March 19, 2008 6:45 PM
Subject: Re: [pjsip] Is possibile to have a on_rx_rtp callback with PJSUA?
The the problem is: how can I understand from the statistics when the
remote phone is ringing ?
If there is no explicit RINGING SIP message, you would have to analyze
received RTP in order to find the ringtone pattern... Nearly
Is exactly what I want to do, I want to analyze the RTP traffic and
recognize the ringtone pattern. Firt of all I need to get the RTP
traffic, have you any suggestion to get it?
Ah right, I misunderstood what you're trying to do (and it seems that
we've been discussing the wrong topic!).
So you want to do some signal analysis. The good news is that the
media has been established, so we can just peek at the PCM signal
rather than hacking the incoming RTP packets, and this is very easy
with PJSUA-LIB!
What you need to do is something like this:
- implement your signal analysis as a sink media port
(http://trac.pjsip.org/repos/wiki/FAQ#audio-man)
- register this port to pjsua-lib's conference bridge
(pjsua_conf_add_port())
- once call's media is establish, connect the call's media slot to
your signal analysis port (with pjsua_conf_connect()) and begin your
signal analysis!
Cheers,
-benny
On 3/19/08, Roland Klabunde <roland.klabunde@freenet.de> wrote:
> > So you want to do some signal analysis. The good news is that the
> > media has been established, so we can just peek at the PCM signal
> > rather than hacking the incoming RTP packets, and this is very easy
> > with PJSUA-LIB!
>
> I'm not up to date here. What in case of G.72x? Does he have access to plain
> PCM data? If so, the signal analysis isn't really that impossible, I claimed
> before :)
Since we've got 183 response with SDP, that means codec has been
negotiated, so we don't need to care about RTP and just work at PCM
level.
> But what in case the user is busy? Or he gets some sort of voice annotation?
> ("Then number you have dialed...") Could become more problematic than,
> though
Well I didn't mean signal analysis is easy. ;-)
What I mean to say was that if you want to peek at the PCM samples,
that should be easy with PJSUA-LIB. For the signal analysis itself,
I'll leave that to Davide. :)
cheers,
-benny
> Regards
>
>
>
>
> ----- Original Message -----
> From: "Benny Prijono" <bennylp@pjsip.org>
> To: "pjsip list" <pjsip@lists.pjsip.org>
> Sent: Wednesday, March 19, 2008 6:45 PM
> Subject: Re: [pjsip] Is possibile to have a on_rx_rtp callback with PJSUA?
>
>
>
> > On 3/19/08, Davide Marrone <unidavide@email.it> wrote:
> >> Roland Klabunde wrote:
> >> >> The the problem is: how can I understand from the statistics when the
> >> >> remote phone is ringing ?
> >> > If there is no explicit RINGING SIP message, you would have to analyze
> >> the
> >> > received RTP in order to find the ringtone pattern... Nearly
> >> impossible, I
> >> > guess.
> >>
> >> Is exactly what I want to do, I want to analyze the RTP traffic and
> >> recognize the ringtone pattern. Firt of all I need to get the RTP
> >> traffic, have you any suggestion to get it?
> >
> > Ah right, I misunderstood what you're trying to do (and it seems that
> > we've been discussing the wrong topic!).
> >
> > So you want to do some signal analysis. The good news is that the
> > media has been established, so we can just peek at the PCM signal
> > rather than hacking the incoming RTP packets, and this is very easy
> > with PJSUA-LIB!
> >
> > What you need to do is something like this:
> > - implement your signal analysis as a sink media port
> > (http://trac.pjsip.org/repos/wiki/FAQ#audio-man)
> > - register this port to pjsua-lib's conference bridge
> > (pjsua_conf_add_port())
> > - once call's media is establish, connect the call's media slot to
> > your signal analysis port (with pjsua_conf_connect()) and begin your
> > signal analysis!
> >
> > Cheers,
> > -benny
> >
>
> > _______________________________________________
> > Visit our blog: http://blog.pjsip.org
> >
> > pjsip mailing list
> > pjsip@lists.pjsip.org
> > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
> >
>
>
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip@lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>
RK
Roland Klabunde
Wed, Mar 19, 2008 7:53 PM
Well I didn't mean signal analysis is easy. ;-)
What I mean to say was that if you want to peek at the PCM samples,
that should be easy with PJSUA-LIB. For the signal analysis itself,
I'll leave that to Davide. :)
As I would do :)
But seems to be not that easy to capture the "start of ringing" in VoIP as
it was with ISDN...
Regards
Regards
----- Original Message -----
From: "Benny Prijono" bennylp@pjsip.org
To: "pjsip list" pjsip@lists.pjsip.org
Sent: Wednesday, March 19, 2008 6:45 PM
Subject: Re: [pjsip] Is possibile to have a on_rx_rtp callback with
PJSUA?
The the problem is: how can I understand from the statistics when
remote phone is ringing ?
If there is no explicit RINGING SIP message, you would have to
received RTP in order to find the ringtone pattern... Nearly
Is exactly what I want to do, I want to analyze the RTP traffic and
recognize the ringtone pattern. Firt of all I need to get the RTP
traffic, have you any suggestion to get it?
Ah right, I misunderstood what you're trying to do (and it seems that
we've been discussing the wrong topic!).
So you want to do some signal analysis. The good news is that the
media has been established, so we can just peek at the PCM signal
rather than hacking the incoming RTP packets, and this is very easy
with PJSUA-LIB!
What you need to do is something like this:
- implement your signal analysis as a sink media port
(http://trac.pjsip.org/repos/wiki/FAQ#audio-man)
- register this port to pjsua-lib's conference bridge
(pjsua_conf_add_port())
- once call's media is establish, connect the call's media slot to
your signal analysis port (with pjsua_conf_connect()) and begin your
signal analysis!
Cheers,
-benny
> Well I didn't mean signal analysis is easy. ;-)
> What I mean to say was that if you want to peek at the PCM samples,
> that should be easy with PJSUA-LIB. For the signal analysis itself,
> I'll leave that to Davide. :)
As I would do :)
But seems to be not that easy to capture the "start of ringing" in VoIP as
it was with ISDN...
Regards
>
> cheers,
> -benny
>
>
>> Regards
>>
>>
>>
>>
>> ----- Original Message -----
>> From: "Benny Prijono" <bennylp@pjsip.org>
>> To: "pjsip list" <pjsip@lists.pjsip.org>
>> Sent: Wednesday, March 19, 2008 6:45 PM
>> Subject: Re: [pjsip] Is possibile to have a on_rx_rtp callback with
>> PJSUA?
>>
>>
>>
>> > On 3/19/08, Davide Marrone <unidavide@email.it> wrote:
>> >> Roland Klabunde wrote:
>> >> >> The the problem is: how can I understand from the statistics when
>> the
>> >> >> remote phone is ringing ?
>> >> > If there is no explicit RINGING SIP message, you would have to
>> analyze
>> >> the
>> >> > received RTP in order to find the ringtone pattern... Nearly
>> >> impossible, I
>> >> > guess.
>> >>
>> >> Is exactly what I want to do, I want to analyze the RTP traffic and
>> >> recognize the ringtone pattern. Firt of all I need to get the RTP
>> >> traffic, have you any suggestion to get it?
>> >
>> > Ah right, I misunderstood what you're trying to do (and it seems that
>> > we've been discussing the wrong topic!).
>> >
>> > So you want to do some signal analysis. The good news is that the
>> > media has been established, so we can just peek at the PCM signal
>> > rather than hacking the incoming RTP packets, and this is very easy
>> > with PJSUA-LIB!
>> >
>> > What you need to do is something like this:
>> > - implement your signal analysis as a sink media port
>> > (http://trac.pjsip.org/repos/wiki/FAQ#audio-man)
>> > - register this port to pjsua-lib's conference bridge
>> > (pjsua_conf_add_port())
>> > - once call's media is establish, connect the call's media slot to
>> > your signal analysis port (with pjsua_conf_connect()) and begin your
>> > signal analysis!
>> >
>> > Cheers,
>> > -benny
>> >
>>
>> > _______________________________________________
>> > Visit our blog: http://blog.pjsip.org
>> >
>> > pjsip mailing list
>> > pjsip@lists.pjsip.org
>> > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>> >
>>
>>
>> _______________________________________________
>> Visit our blog: http://blog.pjsip.org
>>
>> pjsip mailing list
>> pjsip@lists.pjsip.org
>> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>>
>
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip@lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>
DM
Davide Marrone
Thu, Mar 20, 2008 3:29 PM
Well I didn't mean signal analysis is easy. ;-)
What I mean to say was that if you want to peek at the PCM samples,
that should be easy with PJSUA-LIB. For the signal analysis itself,
I'll leave that to Davide. :)
well, others suggestions to create the program that I need are all
welcome :)
Do you know any voip service that always send 180 Ringing exactly when
the remote phone is ringing? This can save me a lot of time !
Maybe I can open a new theard here in the list to ask if anyone knows a
service that always send the 180 ringing packet.
But seems to be not that easy to capture the "start of ringing" in VoIP as
it was with ISDN...
mmm, interesting, was is it more simple? Maybe I can consider to use an
ISDN with more fix costs if is really easy to implement.
Otherwise if there isn't another solution tell me: "good luck" :)
cheers
Davide
Roland Klabunde wrote:
>> Well I didn't mean signal analysis is easy. ;-)
>> What I mean to say was that if you want to peek at the PCM samples,
>> that should be easy with PJSUA-LIB. For the signal analysis itself,
>> I'll leave that to Davide. :)
>
> As I would do :)
well, others suggestions to create the program that I need are all
welcome :)
Do you know any voip service that always send 180 Ringing exactly when
the remote phone is ringing? This can save me a lot of time !
Maybe I can open a new theard here in the list to ask if anyone knows a
service that always send the 180 ringing packet.
> But seems to be not that easy to capture the "start of ringing" in VoIP as
> it was with ISDN...
mmm, interesting, was is it more simple? Maybe I can consider to use an
ISDN with more fix costs if is really easy to implement.
Otherwise if there isn't another solution tell me: "good luck" :)
cheers
Davide