How to use pjsip with video in local loopback mode?

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

 



Hi Ken,

Perhaps you should switch the active call first, check ']'/'[' command.

BR,
nanang


On Fri, Jul 27, 2012 at 12:22 AM, Ken Resander <kresander at yahoo.com> wrote:
>
> I am new to pjsip and need to learn how to use video & audio step-by-step
> by using local loopback. Friends and relatives would not know how to be a
> remote test site of course and cannot assist.
>
> I tried:  pjsua --video --vcapture-dev=-1 -vrender-dev=-1
> sip:127.0.0.1:5060
>
> Q1. Is the command above the right way?
>
> Q2. If the command is correct, what else might be the problem? (console
> log
>     attached)
>
> I expected the web-camera (a Logitech) to pick me up me sitting in front
> of the computer and transfer video and sound (mic built into to the webcam)
> to the same local computer. Then as an incoming call. I could hear the ring
> tone, but user-interface command-letter 'a' (answer call) did not have any
> effect. Could only enter letter q to quit. Also have tried local loopback
> with the --play-avi=AVIFILE option with the same result (started a thread
> describing this). The webcamera works fine with Cheese and Skype.
>
>
> Q3.  sip:music at iptel.org plays music. Are there other sip URIs that
> provide video&audio in a similar fashion? Would be useful for learning and
> testing pjsip video.
>
>
> A bit long maybe, but here is the console log text:
>
> ken at meijin-desktop:~$
> ./pjs201c/pjproject-2.0.1/pjsip-apps/bin/pjsua-i686-pc-linux-gnu --video
> --vcapture-dev=-1 --vrender-dev=-1 sip:127.0.0.1:5060
> 12:36:17.591 os_core_unix.c !pjlib 2.0.1 for POSIX initialized
> 12:36:17.592 sip_endpoint.c  .Creating endpoint instance...
> 12:36:17.593          pjlib  .select() I/O Queue created (0xa6c9170)
> 12:36:17.593 sip_endpoint.c  .Module "mod-msg-print" registered
> 12:36:17.593 sip_transport.  .Transport manager created.
> 12:36:17.593   pjsua_core.c  .PJSUA state changed: NULL --> CREATED
> 12:36:17.593 sip_endpoint.c  .Module "mod-pjsua-log" registered
> 12:36:17.593 sip_endpoint.c  .Module "mod-tsx-layer" registered
> 12:36:17.593 sip_endpoint.c  .Module "mod-stateful-util" registered
> 12:36:17.593 sip_endpoint.c  .Module "mod-ua" registered
> 12:36:17.593 sip_endpoint.c  .Module "mod-100rel" registered
> 12:36:17.593 sip_endpoint.c  .Module "mod-pjsua" registered
> 12:36:17.593 sip_endpoint.c  .Module "mod-invite" registered
> bt_audio_service_open: connect() failed: Connection refused (111)
> bt_audio_service_open: connect() failed: Connection refused (111)
> bt_audio_service_open: connect() failed: Connection refused (111)
> bt_audio_service_open: connect() failed: Connection refused (111)
> 12:36:17.666       pa_dev.c  ..PortAudio sound library initialized,
> status=0
> 12:36:17.666       pa_dev.c  ..PortAudio host api count=2
> 12:36:17.666       pa_dev.c  ..Sound device count=10
> 12:36:17.666          pjlib  ..select() I/O Queue created (0xa6e8bd4)
> 12:36:17.696    pjsua_vid.c  ..Initializing video subsystem..
> 12:36:17.698 ffmpeg_vid_cod  ...Cannot find H264 encoder in ffmpeg library
> 12:36:17.698 colorbar_dev.c  ...Colorbar video src initialized with 1
> device(s):
> 12:36:17.698 colorbar_dev.c  ... 0: Colorbar generator
> 12:36:17.772      sdl_dev.c  ...SDL 2.0 initialized
> 12:36:17.772 sip_endpoint.c  .Module "mod-evsub" registered
> 12:36:17.772 sip_endpoint.c  .Module "mod-presence" registered
> 12:36:17.772 sip_endpoint.c  .Module "mod-mwi" registered
> 12:36:17.772 sip_endpoint.c  .Module "mod-refer" registered
> 12:36:17.772 sip_endpoint.c  .Module "mod-pjsua-pres" registered
> 12:36:17.772 sip_endpoint.c  .Module "mod-pjsua-im" registered
> 12:36:17.772 sip_endpoint.c  .Module "mod-pjsua-options" registered
> 12:36:17.773   pjsua_core.c  .1 SIP worker threads created
> 12:36:17.773   pjsua_core.c  .pjsua version 2.0.1 for
> Linux-2.6.32.41/i686/glibc-2.11 initialized
> 12:36:17.773   pjsua_core.c  .PJSUA state changed: CREATED --> INIT
> 12:36:17.773 sip_endpoint.c  Module "mod-default-handler" registered
> 12:36:17.773   pjsua_core.c  SIP UDP socket reachable at 192.168.0.2:5060
> 12:36:17.773   udp0xa7111e0  SIP UDP transport started, published address
> is 192.168.0.2:5060
> 12:36:17.773    pjsua_acc.c  Adding account: id=<sip:192.168.0.2:5060>
> 12:36:17.773    pjsua_acc.c  .Account <sip:192.168.0.2:5060> added with id
> 0
> 12:36:17.773    pjsua_acc.c  Modifying accunt 0
> 12:36:17.773    pjsua_acc.c  Acc 0: setting online status to 1..
> 12:36:17.774    tcplis:5060  SIP TCP listener ready for incoming
> connections at 192.168.0.2:5060
> 12:36:17.774    pjsua_acc.c  Adding account:
> id=<sip:192.168.0.2:5060;transport=TCP>
> 12:36:17.774    pjsua_acc.c  .Account <sip:192.168.0.2:5060;transport=TCP>
> added with id 1
> 12:36:17.774    pjsua_acc.c  Modifying accunt 1
> 12:36:17.774    pjsua_acc.c  Acc 1: setting online status to 1..
> 12:36:17.774   pjsua_pres.c  Adding buddy: sip:127.0.0.1:5060
> 12:36:17.774   pjsua_pres.c  .Buddy 0 added.
> 12:36:17.774   pjsua_pres.c  .Buddy 0: unsubscribing presence..
> 12:36:17.774   pjsua_pres.c  ..Buddy 0: updating presence..
> 12:36:17.774   pjsua_core.c  PJSUA state changed: INIT --> STARTING
> 12:36:17.774  pjsua_media.c  ..NAT type detection failed: Invalid STUN
> server or server not configured (PJNATH_ESTUNINSERVER)
> 12:36:17.774 sip_endpoint.c  .Module "mod-unsolicited-mwi" registered
> 12:36:17.774   pjsua_core.c  .PJSUA state changed: STARTING --> RUNNING
> 12:36:17.774   pjsua_call.c  Making call with acc #1 to sip:127.0.0.1:5060
> 12:36:17.774    pjsua_aud.c  .Set sound device: capture=-1, playback=-2
> 12:36:17.774    pjsua_app.c  ..Turning sound device ON
> 12:36:17.774    pjsua_aud.c  ..Opening sound device PCM at 16000/1/20ms
> 12:36:17.777    ec0xa7304e8  ...AEC created, clock_rate=16000, channel=1,
> samples per frame=320, tail length=200 ms, latency=100 ms
> 12:36:17.777  pjsua_media.c  .Call 0: initializing media..
> 12:36:17.777  pjsua_media.c  ..RTP socket reachable at 192.168.0.2:40000
> 12:36:17.777  pjsua_media.c  ..RTCP socket reachable at 192.168.0.2:40001
> 12:36:17.778  pjsua_media.c  ..RTP socket reachable at 192.168.0.2:40002
> 12:36:17.778  pjsua_media.c  ..RTCP socket reachable at 192.168.0.2:40003
> 12:36:17.778  pjsua_media.c  ..Media index 0 selected for audio call 0
> 12:36:17.779   pjsua_core.c  ....TX 1266 bytes Request msg INVITE/cseq=634
> (tdta0xaa6cae0) to UDP 127.0.0.1:5060:
> INVITE sip:127.0.0.1:5060 SIP/2.0
> Via: SIP/2.0/UDP
> 192.168.0.2:5060;rport;branch=z9hG4bKPjt-FyKRLPJg5xEJpfGH8jOodfbKsHXt0d
> Max-Forwards: 70
> From: <sip:192.168.0.2>;tag=knD2N3cRRPB8JbWQchIdnohvz4BLCu-j
> To: sip:127.0.0.1
> Contact: <sip:192.168.0.2:5060;ob>
> Call-ID: 7q3ZVMr2iBByiJVjO6qULHQWBriOBsUh
> CSeq: 634 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 v2.0.1 Linux-2.6.32.41/i686/glibc-2.11
> Content-Type: application/sdp
> Content-Length:   656
>
> v=0
> o=- 3552291377 3552291377 IN IP4 192.168.0.2
> s=pjmedia
> c=IN IP4 192.168.0.2
> b=AS:352
> t=0 0
> a=X-nat:0
> m=audio 40000 RTP/AVP 98 97 99 104 3 0 8 9 96
> c=IN IP4 192.168.0.2
> b=TIAS:64000
> a=rtcp:40001 IN IP4 192.168.0.2
> a=sendrecv
> a=rtpmap:98 speex/16000
> a=rtpmap:97 speex/8000
> a=rtpmap:99 speex/32000
> a=rtpmap:104 iLBC/8000
> a=fmtp:104 mode=30
> a=rtpmap:3 GSM/8000
> a=rtpmap:0 PCMU/8000
> a=rtpmap:8 PCMA/8000
> a=rtpmap:9 G722/8000
> a=rtpmap:96 telephone-event/8000
> a=fmtp:96 0-15
> m=video 40002 RTP/AVP 96
> c=IN IP4 192.168.0.2
> b=TIAS:256000
> a=rtcp:40003 IN IP4 192.168.0.2
> a=sendrecv
> a=rtpmap:96 H263-1998/90000
> a=fmtp:96 CIF=1;QCIF=1
>
> --end msg--
> 12:36:17.779   pjsua_core.c  .RX 1266 bytes Request msg INVITE/cseq=634
> (rdata0xa72c1f4) from UDP 127.0.0.1:5060:
> INVITE sip:127.0.0.1:5060 SIP/2.0
> Via: SIP/2.0/UDP
> 192.168.0.2:5060;rport;branch=z9hG4bKPjt-FyKRLPJg5xEJpfGH8jOodfbKsHXt0d
> Max-Forwards: 70
> From: <sip:192.168.0.2>;tag=knD2N3cRRPB8JbWQchIdnohvz4BLCu-j
> To: sip:127.0.0.1
> Contact: <sip:192.168.0.2:5060;ob>
> Call-ID: 7q3ZVMr2iBByiJVjO6qULHQWBriOBsUh
> CSeq: 634 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 v2.0.1 Linux-2.6.32.41/i686/glibc-2.11
> Content-Type: application/sdp
> Content-Length:   656
>
> v=0
> o=- 3552291377 3552291377 IN IP4 192.168.0.2
> s=pjmedia
> c=IN IP4 192.168.0.2
> b=AS:352
> t=0 0
> a=X-nat:0
> m=audio 40000 RTP/AVP 98 97 99 104 3 0 8 9 96
> c=IN IP4 192.168.0.2
> b=TIAS:64000
> a=rtcp:40001 IN IP4 192.168.0.2
> a=sendrecv
> a=rtpmap:98 speex/16000
> a=rtpmap:97 speex/8000
> a=rtpmap:99 speex/32000
> a=rtpmap:104 iLBC/8000
> a=fmtp:104 mode=30
> a=rtpmap:3 GSM/8000
> a=rtpmap:0 PCMU/8000
> a=rtpmap:8 PCMA/8000
> a=rtpmap:9 G722/8000
> a=rtpmap:96 telephone-event/8000
> a=fmtp:96 0-15
> m=video 40002 RTP/AVP 96
> c=IN IP4 192.168.0.2
> b=TIAS:256000
> a=rtcp:40003 IN IP4 192.168.0.2
> a=sendrecv
> a=rtpmap:96 H263-1998/90000
> a=fmtp:96 CIF=1;QCIF=1
>
> --end msg--
> 12:36:17.779    pjsua_app.c  .......Call 0 state changed to CALLING
> 12:36:17.779   pjsua_call.c !.Incoming Request msg INVITE/cseq=634
> (rdata0xa72c1f4)
> 12:36:17.779  pjsua_media.c  ..Call 1: initializing media..
> 12:36:17.780  pjsua_media.c  ...RTP socket reachable at 192.168.0.2:40004
> 12:36:17.780  pjsua_media.c  ...RTCP socket reachable at 192.168.0.2:40005
> 12:36:17.780  pjsua_media.c  ...RTP socket reachable at 192.168.0.2:40006
> 12:36:17.780  pjsua_media.c  ...RTCP socket reachable at 192.168.0.2:40007
> 12:36:17.780  pjsua_media.c  ...Media index 0 selected for audio call 1
> 12:36:17.781   pjsua_core.c  .....TX 300 bytes Response msg
> 100/INVITE/cseq=634 (tdta0xaa80408) to UDP 127.0.0.1:5060:
> SIP/2.0 100 Trying
> Via: SIP/2.0/UDP
> 192.168.0.2:5060;rport=5060;received=127.0.0.1;branch=z9hG4bKPjt-FyKRLPJg5xEJpfGH8jOodfbKsHXt0d
> Call-ID: 7q3ZVMr2iBByiJVjO6qULHQWBriOBsUh
> From: <sip:192.168.0.2>;tag=knD2N3cRRPB8JbWQchIdnohvz4BLCu-j
> To: <sip:127.0.0.1>
> CSeq: 634 INVITE
> Content-Length:  0
>
>
> --end msg--
> 12:36:17.781    pjsua_aud.c  ..Conf connect: 2 --> 0
> 12:36:17.781   conference.c  ...Port 2 (ring) transmitting to port 0
> (Intel 82801DB-ICH4: Intel 82801DB-ICH4 (hw:0,0))
> 12:36:17.781    pjsua_app.c  ..Incoming call for account 0!
> Media count: 1 audio & 1 video
> To reject the video, type "vid disable" first, before answering the call!
> From: <sip:192.168.0.2>
> To: <sip:127.0.0.1>
> Press a to answer or h to reject call
> 12:36:17.781   pjsua_core.c  .RX 300 bytes Response msg
> 100/INVITE/cseq=634 (rdata0xa72c1f4) from UDP 127.0.0.1:5060:
> SIP/2.0 100 Trying
> Via: SIP/2.0/UDP
> 192.168.0.2:5060;rport=5060;received=127.0.0.1;branch=z9hG4bKPjt-FyKRLPJg5xEJpfGH8jOodfbKsHXt0d
> Call-ID: 7q3ZVMr2iBByiJVjO6qULHQWBriOBsUh
> From: <sip:192.168.0.2>;tag=knD2N3cRRPB8JbWQchIdnohvz4BLCu-j
> To: <sip:127.0.0.1>
> CSeq: 634 INVITE
> Content-Length:  0
>
>
> --end msg--
> >>>>
> Account list:
>   [ 0] <sip:192.168.0.2:5060>: does not register
>        Online status: Online
>  *[ 1] <sip:192.168.0.2:5060;transport=TCP>: does not register
>        Online status: Online
> Buddy list:
>  [ 1] <?>  sip:127.0.0.1:5060
>
>
> +=============================================================================+
> |       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     |
> |
>
> +-----------------------------------------------------------------------------+
> | Video: "vid help" for more info
> |
>
> +-----------------------------------------------------------------------------+
> |  q  QUIT   L  ReLoad   sleep MS   echo [0|1|txt]     n: detect NAT type
> |
>
> +=============================================================================+
> | Video will be enabled in the next offer/answer
> |
>
> +=============================================================================+
> >>> a
> No pending incoming call
> >>> q
> 12:36:26.218   pjsua_core.c !Shutting down, flags=0...
>
>
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>



[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