pjsua automation

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

 



Hi Mark!

Thank's for you 2c.

Using FIFOs is indeed a solution for my problem.

regards
Klaus

Am 23.02.2010 14:07, schrieb Mark Webster:
> Hi Klaus, it seems you've had no replies yet so I'll just add my 2c.
>
> I haven't used pjsua much so I'm not sure how much control you have over
> each message in the SIP dialog. However, you can automate it pretty
> easily on the commandline. Here's an example shell script:
>
> #!/bin/sh
> params="--app-log-level=3 --local-port=5060 --null-audio"
> dest="sip:destination at host"
> output=`cat commands.txt | ./pjsua $params $dest` || (echo Error:
> $output; exit 1);
>
> # process the $output here, for example if i want to determine whether
> the call was successful
> confirmed=`echo $output | grep -oE 'Call .*CONFIRMED'`
> sipcode=`echo $output | grep -oE 'reason=[0-9]+' | grep -oE '[0-9]+'`
> [ "$confirmed" ] && echo -n "Call succeeded" || echo -n "Call failed"
> echo ", SIP code=$sipcode"
>
>
> Then in commands.txt you can list the in-call commands you want to run.
> This example would be something simple:
> //sleep 10
> q
>
> If you need to do more complicated logic than just a sequential set of
> commands (eg, you want to read the output in real  time), you could
> learn how to use fifo pipes in linux, and the shell "read" command.
>
> Hope that helps a little.
> -Mark
>
> On Fri, Feb 19, 2010 at 12:58 PM, Klaus Darilion
> <klaus.mailinglists at pernau.at <mailto:klaus.mailinglists at pernau.at>> wrote:
>
>     Hi!
>
>     For testing early media I often use pjsua with --play-file=
>     --auto-play and --auto-answer=183.
>
>     Is there a method to automate pjsua even more, e.g. to tell pjsua to:
>     wait 1 second, send 183 and early media, wait 3 seconds, send 200,
>     wait 10 seconds, hangup.
>
>     thanks
>     Klaus
>
>     _______________________________________________
>     Visit our blog: http://blog.pjsip.org
>
>     pjsip mailing list
>     pjsip at lists.pjsip.org <mailto:pjsip at lists.pjsip.org>
>     http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>
>
>
>
> _______________________________________________
> 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