Error while playing Media using pjsua

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
I am using PJSUA on Linux machine for calling a X-lite subscriber. I intend
to play a wav file on the sip-phone as it answers the call or anytime during
the call; like we have in IVRS applications. For this I have tried using
pjsua with the following options:
./pjsua --id=sip:user1 at example.com
<sip%3Auser1 at example.com>--play-file=/home/cdot/sample.wav

where example.com is defined as the domain name of my system(in /etc/hosts)
and sample.wav is a wav file that I need to play.
next when i place a call using 'm' and to sip url of x-lite, lets say
"sip:4 at titikshu"
*The call is getting placed but I am not able to hear any wav file on the
x-lite phone*.
*Could you explain the reason for the same and what changes I would need in
order to resolve t5he problem and achieve the desired results.
*
The logs displayed on my system are as follows:
./pjsua-x86_64-unknown-linux-gnu
--id=sip:user1 at example.com<sip%3Auser1 at example.com>--play-file=/home/cdot/sample.wav
 16:46:13.021 os_core_unix.c  pjlib 1.6 for POSIX initialized
 16:46:13.035 sip_endpoint.c  Creating endpoint instance...
 16:46:13.036          pjlib  select() I/O Queue created (0x18e3c710)
 16:46:13.036 sip_endpoint.c  Module "mod-msg-print" registered
 16:46:13.036 sip_transport.  Transport manager created.
 16:46:13.036 sip_endpoint.c  Module "mod-pjsua-log" registered
 16:46:13.036 sip_endpoint.c  Module "mod-tsx-layer" registered
 16:46:13.036 sip_endpoint.c  Module "mod-stateful-util" registered
 16:46:13.036 sip_endpoint.c  Module "mod-ua" registered
 16:46:13.036 sip_endpoint.c  Module "mod-100rel" registered
 16:46:13.036 sip_endpoint.c  Module "mod-pjsua" registered
 16:46:13.036 sip_endpoint.c  Module "mod-invite" registered
 16:46:13.103       pa_dev.c  PortAudio sound library initialized, status=0
 16:46:13.103       pa_dev.c  PortAudio host api count=2
 16:46:13.103       pa_dev.c  Sound device count=11
 16:46:13.103          pjlib  select() I/O Queue created (0x18e775d8)
 16:46:13.117 sip_endpoint.c  Module "mod-evsub" registered
 16:46:13.117 sip_endpoint.c  Module "mod-presence" registered
 16:46:13.117 sip_endpoint.c  Module "mod-mwi" registered
 16:46:13.117 sip_endpoint.c  Module "mod-refer" registered
 16:46:13.117 sip_endpoint.c  Module "mod-pjsua-pres" registered
 16:46:13.117 sip_endpoint.c  Module "mod-pjsua-im" registered
 16:46:13.117 sip_endpoint.c  Module "mod-pjsua-options" registered
 16:46:13.117   pjsua_core.c  1 SIP worker threads created
 16:46:13.117   pjsua_core.c  pjsua version 1.6 for x86_64-unknown-linux-gnu
initialized
 16:46:13.117 sip_endpoint.c  Module "mod-default-handler" registered
 16:46:13.117   wav_player.c  File player '/home/cdot/sample.wav' created:
samp.rate=22050, ch=1, bufsize=4KB, filesize=121KB
 16:46:13.118   pjsua_core.c  SIP UDP socket reachable at
192.168.105.90:5060
 16:46:13.118  udp0x18e8d040  SIP UDP transport started, published address
is 192.168.105.90:5060
 16:46:13.118    pjsua_acc.c  Account <sip:192.168.105.90:5060> added with
id 0
 16:46:13.118    tcplis:5060  SIP TCP listener ready for incoming
connections at 192.168.105.90:5060
 16:46:13.118    pjsua_acc.c  Account <sip:192.168.105.90:5060;transport=TCP>
added with id 1
 16:46:13.118    pjsua_acc.c  Account
sip:user1 at example.com<sip%3Auser1 at example.com>added with id 2
 16:46:13.118  pjsua_media.c  RTP socket reachable at 192.168.105.90:4000
 16:46:13.118  pjsua_media.c  RTCP socket reachable at 192.168.105.90:4001
 16:46:13.118  pjsua_media.c  RTP socket reachable at 192.168.105.90:4002
 16:46:13.118  pjsua_media.c  RTCP socket reachable at 192.168.105.90:4003
 16:46:13.118  pjsua_media.c  RTP socket reachable at 192.168.105.90:4004
 16:46:13.118  pjsua_media.c  RTCP socket reachable at 192.168.105.90:4005
 16:46:13.118  pjsua_media.c  RTP socket reachable at 192.168.105.90:4006
 16:46:13.118  pjsua_media.c  RTCP socket reachable at 192.168.105.90:4007
 16:46:13.118 sip_endpoint.c  Module "mod-unsolicited-mwi" registered
>>>>
Account list:
  [ 0] <sip:192.168.105.90:5060>: does not register
       Online status: Online
  [ 1] <sip:192.168.105.90:5060;transport=TCP>: does not register
       Online status: Online
 *[ 2] sip:user1 at example.com <sip%3Auser1 at example.com>: does not register
       Online status: Online
Buddy list:
 -none-

+=============================================================================+
|       Call Commands:         |   Buddy, IM & Presence:  |
Account:      |
|                              |
|                   |
|  m  Make new call            | +b  Add new buddy       .| +a  Add new
accnt |
|  M  Make multiple calls      | -b  Delete buddy         | -a  Delete
accnt. |
|  a  Answer call              |  i  Send IM              | !a  Modify
accnt. |
|  h  Hangup call  (ha=all)    |  s  Subscribe presence   | rr
(Re-)register |
|  H  Hold call                |  u  Unsubscribe presence | ru
Unregister    |
|  v  re-inVite (release hold) |  t  ToGgle Online status |  >  Cycle next
ac.|
|  U  send UPDATE              |  T  Set online status    |  <  Cycle prev
ac.|
| ],[ Select next/prev call
+--------------------------+-------------------+
|  x  Xfer call                |      Media Commands:     |  Status &
Config: |
|  X  Xfer with Replaces       |
|                   |
|  #  Send RFC 2833 DTMF       | cl  List ports           |  d  Dump
status   |
|  *  Send DTMF with INFO      | cc  Connect port         | dd  Dump
detailed |
| dq  Dump curr. call quality  | cd  Disconnect port      | dc  Dump
config   |
|                              |  V  Adjust audio Volume  |  f  Save
config   |
|  S  Send arbitrary REQUEST   | Cp  Codec priorities     |  f  Save
config   |
+------------------------------+--------------------------+-------------------+
|  q  QUIT   L  ReLoad   sleep MS   echo [0|1|txt]     n: detect NAT
type     |
+=============================================================================+
You have 0 active call
>>> m
(You currently have 0 calls)
Buddy list:
 -none-

Choices:
   0         For current dialog.
  -1         All 0 buddies in buddy list
  [1 - 0]    Select from buddy list
  URL        An URL
  <Enter>    Empty input (or 'q') to cancel
Make call: sip:4 at titikshu
 16:46:24.564  pjsua_media.c  Opening sound device PCM at 16000/1/20ms
 16:46:24.571   ec0x18e76cd0  AEC created, clock_rate=16000, channel=1,
samples per frame=320, tail length=200 ms, latency=100 ms
 16:46:24.576   pjsua_call.c  Making call with acc #2 to sip:4 at titikshu
 16:46:24.576  pjsua_media.c  Media index 0 selected for call 0
 16:46:24.577   pjsua_core.c  TX 1090 bytes Request msg INVITE/cseq=26487
(tdta0x18ecf590) to UDP 196.1.110.214:5060:
INVITE sip:4 at titikshu SIP/2.0
Via: SIP/2.0/UDP 192.168.105.90:5060
;rport;branch=z9hG4bKPjd5989ccd-d3ec-47b4-9107-1f793bf9f9b5
Max-Forwards: 70
From: sip:user1@xxxxxxxxxxx <sip%3Auser1 at example.com>
;tag=0b10e4a3-cc6e-452b-a427-dddf63e539e2
To: sip:4 at titikshu
Contact: <sip:user1 at 192.168.105.90:5060>
Call-ID: 70605430-8f48-4c1e-a8d5-b27331f9bb32
CSeq: 26487 INVITE
Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, SUBSCRIBE, NOTIFY, REFER,
MESSAGE, OPTIONS
Supported: replaces, 100rel, timer, norefersub
Session-Expires: 1800
Min-SE: 90
User-Agent: PJSUA v1.6/x86_64-unknown-linux-gnu
Content-Type: application/sdp
Content-Length:   465

v=0
o=- 3484379784 3484379784 IN IP4 192.168.105.90
s=pjmedia
c=IN IP4 192.168.105.90
t=0 0
a=X-nat:0
m=audio 4000 RTP/AVP 103 102 104 109 3 0 8 9 101
a=rtcp:4001 IN IP4 192.168.105.90
a=rtpmap:103 speex/16000
a=rtpmap:102 speex/8000
a=rtpmap:104 speex/32000
a=rtpmap:109 iLBC/8000
a=fmtp:109 mode=30
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:9 G722/8000
a=sendrecv
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15

--end msg--
 16:46:24.577    pjsua_app.c  Call 0 state changed to CALLING
>>>  16:46:24.580   pjsua_core.c  RX 379 bytes Response msg
100/INVITE/cseq=26487 (rdata0x18e8d508) from UDP 196.1.110.214:5060:
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.105.90:5060
;rport;branch=z9hG4bKPjd5989ccd-d3ec-47b4-9107-1f793bf9f9b5
From: sip:user1@xxxxxxxxxxx <sip%3Auser1 at example.com>
;tag=0b10e4a3-cc6e-452b-a427-dddf63e539e2
To: <sip:4 at titikshu>;tag=1673815833
Contact: <sip:4 at 196.1.110.214:5060>
Call-ID: 70605430-8f48-4c1e-a8d5-b27331f9bb32
CSeq: 26487 INVITE
Server: X-Lite release 1105d
Content-Length: 0


--end msg--
 16:46:24.580    pjsua_app.c  Call 0 state changed to EARLY (100 Trying)
 16:46:24.612   pjsua_core.c  RX 380 bytes Response msg
180/INVITE/cseq=26487 (rdata0x18e8d508) from UDP 196.1.110.214:5060:
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 192.168.105.90:5060
;rport;branch=z9hG4bKPjd5989ccd-d3ec-47b4-9107-1f793bf9f9b5
From: sip:user1@xxxxxxxxxxx <sip%3Auser1 at example.com>
;tag=0b10e4a3-cc6e-452b-a427-dddf63e539e2
To: <sip:4 at titikshu>;tag=1673815833
Contact: <sip:4 at 196.1.110.214:5060>
Call-ID: 70605430-8f48-4c1e-a8d5-b27331f9bb32
CSeq: 26487 INVITE
Server: X-Lite release 1105d
Content-Length: 0


--end msg--
 16:46:24.612   conference.c  Port 2 (ringback) transmitting to port 0 (HDA
Intel: AD198x Analog (hw:0,0))
 16:46:24.612    pjsua_app.c  Call 0 state changed to EARLY (180 Ringing)
 16:46:24.616 os_core_unix.c  Info: possibly re-registering existing thread
 16:46:29.617   sound_port.c  EC suspended because of inactivity
 16:46:31.606  udp0x18e8f0d0  Remote RTCP address switched to
196.1.110.214:4001
 16:46:31.611   pjsua_core.c  RX 689 bytes Response msg
200/INVITE/cseq=26487 (rdata0x18e8d508) from UDP 196.1.110.214:5060:
SIP/2.0 200 Ok
Via: SIP/2.0/UDP 192.168.105.90:5060
;rport;branch=z9hG4bKPjd5989ccd-d3ec-47b4-9107-1f793bf9f9b5
From: sip:user1@xxxxxxxxxxx <sip%3Auser1 at example.com>
;tag=0b10e4a3-cc6e-452b-a427-dddf63e539e2
To: <sip:4 at titikshu>;tag=1673815833
Contact: <sip:4 at 196.1.110.214:5060>
Call-ID: 70605430-8f48-4c1e-a8d5-b27331f9bb32
CSeq: 26487 INVITE
Content-Type: application/sdp
Server: X-Lite release 1105d
Content-Length: 281

v=0
o=4 4080949630 4080956661 IN IP4 196.1.110.214
s=X-Lite
c=IN IP4 196.1.110.214
t=0 0
m=audio 4000 RTP/AVP 98 0 8 3 101
a=rtpmap:0 pcmu/8000
a=rtpmap:8 pcma/8000
a=rtpmap:3 gsm/8000
a=rtpmap:98 iLBC/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv

--end msg--
 16:46:31.611    pjsua_app.c  Call 0 state changed to CONNECTING
 16:46:31.611 strm0x18ed5458  VAD temporarily disabled
 16:46:31.611 strm0x18ed5458  Encoder stream started
 16:46:31.611 strm0x18ed5458  Decoder stream started
 16:46:31.611  pjsua_media.c  Media updates, stream #0: iLBC (sendrecv)
 16:46:31.611   conference.c  Port 2 (ringback) stop transmitting to port 0
(HDA Intel: AD198x Analog (hw:0,0))
 16:46:31.611   conference.c  Port 4 (sip:4 at titikshu) transmitting to port 0
(HDA Intel: AD198x Analog (hw:0,0))
 16:46:31.611   conference.c  Port 0 (HDA Intel: AD198x Analog (hw:0,0))
transmitting to port 4 (sip:4 at titikshu)
 16:46:31.611    pjsua_app.c  Media for call 0 is active
 16:46:31.611   pjsua_core.c  TX 344 bytes Request msg ACK/cseq=26487
(tdta0x18edbaf0) to UDP 196.1.110.214:5060:
ACK sip:4 at 196.1.110.214:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.105.90:5060
;rport;branch=z9hG4bKPj097fb5ae-26f0-4cc4-9c07-1d4ec681ba7e
Max-Forwards: 70
From: sip:user1@xxxxxxxxxxx <sip%3Auser1 at example.com>
;tag=0b10e4a3-cc6e-452b-a427-dddf63e539e2
To: sip:4 at titikshu;tag=1673815833
Call-ID: 70605430-8f48-4c1e-a8d5-b27331f9bb32
CSeq: 26487 ACK
Content-Length:  0


--end msg--
 16:46:31.611    pjsua_app.c  Call 0 state changed to CONFIRMED
 16:46:38.531   pjsua_core.c  RX 413 bytes Request msg BYE/cseq=7560
(rdata0x18e8d508) from UDP 196.1.110.214:5060:
BYE sip:user1 at 192.168.105.90:5060 SIP/2.0
Via: SIP/2.0/UDP 196.1.110.214:5060
;rport;branch=z9hG4bK6CF4B2ACDC0273EC25F0F9C7FE83DC8D
From: <sip:4@titikshu>;tag=1673815833
To: sip:user1 at example.com <sip%3Auser1 at example.com>
;tag=0b10e4a3-cc6e-452b-a427-dddf63e539e2
Contact: <sip:4 at 196.1.110.214:5060>
Call-ID: 70605430-8f48-4c1e-a8d5-b27331f9bb32
CSeq: 7560 BYE
Max-Forwards: 70
User-Agent: X-Lite release 1105d
Content-Length: 0


--end msg--
 16:46:38.531   pjsua_core.c  TX 328 bytes Response msg 200/BYE/cseq=7560
(tdta0x18eddab0) to UDP 196.1.110.214:5060:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 196.1.110.214:5060
;rport=5060;received=196.1.110.214;branch=z9hG4bK6CF4B2ACDC0273EC25F0F9C7FE83DC8D
Call-ID: 70605430-8f48-4c1e-a8d5-b27331f9bb32
From: <sip:4@titikshu>;tag=1673815833
To: <sip:user1 at example.com <sip%3Auser1 at example.com>
>;tag=0b10e4a3-cc6e-452b-a427-dddf63e539e2
CSeq: 7560 BYE
Content-Length:  0


--end msg--
 16:46:38.531    pjsua_app.c  Call 0 is DISCONNECTED [reason=200 (Normal
call clearing)]
 16:46:38.531    pjsua_app.c
  [DISCONNCTD] To: sip:4 at titikshu;tag=1673815833
    Call time: 00h:00m:06s, 1st res in 4 ms, conn in 7035ms
    SRTP status: Not active Crypto-suite: (null)
    #0 iLBC @8KHz, sendrecv, peer=196.1.110.214:4000
       RX pt=109, stat last update: never
          total 3pkt 150B (270B +IP hdr) @avg=173bps/312bps
          pkt loss=0 (0.0%), discrd=0 (0.0%), dup=0 (0.0%), reord=0 (0.0%)
                (msec)    min     avg     max     last    dev
          loss period:   0.000   0.000   0.000   0.000   0.000
          jitter     :  -0.001   0.000   0.000   0.000   0.000
       TX pt=98, ptime=30ms, stat last update: 00h:00m:01.887s ago
          total 1pkt 0B (40B +IP hdr) @avg 0bps/46bps
          pkt loss=0 (0.0%), dup=0 (0.0%), reorder=0 (0.0%)
                (msec)    min     avg     max     last    dev
          loss period:   0.000   0.000   0.000   0.000   0.000
          jitter     :   0.000   0.000   0.000   0.000   0.000
      RTT msec       :   0.000   0.000   0.000   0.000   0.000
 16:46:38.531  pjsua_media.c  Media session for call 0 is destroyed
 16:46:39.531  pjsua_media.c  Closing sound device after idle for 1 seconds
 16:46:39.531  pjsua_media.c  Closing HDA Intel: AD198x Analog (hw:0,0)
sound playback device and HDA Intel: AD198x Analog (hw:0,0) sound capture
device
h
No current call
>>> q
 17:02:01.787   pjsua_core.c  Shutting down...
 17:02:01.788   pjsua_pres.c  Shutting down presence..
 17:02:01.788  pjsua_media.c  Shutting down media..
 17:02:02.188       pa_dev.c  PortAudio sound library shutting down..
 17:02:03.189   pjsua_core.c  Destroying...
 17:02:03.189 sip_transactio  Stopping transaction layer module
 17:02:03.189 sip_endpoint.c  Module "mod-default-handler" unregistered
 17:02:03.190 sip_endpoint.c  Module "mod-unsolicited-mwi" unregistered
 17:02:03.190 sip_endpoint.c  Module "mod-pjsua-options" unregistered
 17:02:03.190 sip_endpoint.c  Module "mod-pjsua-im" unregistered
 17:02:03.190 sip_endpoint.c  Module "mod-pjsua-pres" unregistered
 17:02:03.190 sip_endpoint.c  Module "mod-pjsua" unregistered
 17:02:03.190 sip_endpoint.c  Module "mod-stateful-util" unregistered
 17:02:03.190 sip_endpoint.c  Module "mod-refer" unregistered
 17:02:03.190 sip_endpoint.c  Module "mod-mwi" unregistered
 17:02:03.190 sip_endpoint.c  Module "mod-presence" unregistered
 17:02:03.190 sip_endpoint.c  Module "mod-evsub" unregistered
 17:02:03.190 sip_endpoint.c  Module "mod-invite" unregistered
 17:02:03.190 sip_endpoint.c  Module "mod-100rel" unregistered
 17:02:03.190 sip_endpoint.c  Module "mod-ua" unregistered
 17:02:03.190 sip_transactio  Transaction layer module destroyed
 17:02:03.190 sip_endpoint.c  Module "mod-tsx-layer" unregistered
 17:02:03.190 sip_endpoint.c  Module "mod-msg-print" unregistered
 17:02:03.190 sip_endpoint.c  Module "mod-pjsua-log" unregistered
 17:02:03.191    tcplis:5060  SIP TCP listener destroyed
 17:02:03.191 sip_endpoint.c  Endpoint 0x18e31978 destroyed
 17:02:03.191     sample.wav  Pool is not released by application, releasing
now
 17:02:03.191   pjsua_core.c  PJSUA destroyed...

Kindly reply ASAP.
Thanks and Regards,
Shivani Singh Atoliya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20100601/657b0583/attachment-0001.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux