Project

General

Profile

Sip session » History » Version 14

Adrian Georgescu, 03/31/2009 02:59 PM

1 2 Adrian Georgescu
== sip_session ==
2 1 Adrian Georgescu
3 2 Adrian Georgescu
[[TOC(SipTesting*, sip_*, depth=2)]]
4
5
To use this script you must to have a valid [wiki:SipSettingsAPI configuration].
6 1 Adrian Georgescu
7 4 Adrian Georgescu
=== Description ===
8 5 Adrian Georgescu
9 7 Adrian Georgescu
This script can be used to establish SIP sessions with more than one media type. One can add and remove RTP audio and MSRP chat to the same SIP session usine re-INVITE. The defaul behaviour is to establish outgoing session with both audio and chat media.
10 5 Adrian Georgescu
11 6 Adrian Georgescu
[[Image(http://www.tech-invite.com/img/cf3665/cf3665-37.gif)]]
12
13 1 Adrian Georgescu
{{{
14
Usage: sip_session [options] [target-user@target-domain.com]
15
16
This script will either sit idle waiting for an incoming MSRP session, or
17
start a MSRP session with the specified target SIP address. The program will
18
close the session and quit when CTRL+D is pressed.
19
20
Options:
21
  -h, --help            show this help message and exit
22
  -a ACCOUNT_ID, --account-id=ACCOUNT_ID
23 3 Adrian Georgescu
  -c [FILE], --config_file=[FILE]
24
                        The path to a configuration file to use. This
25
                        overrides the default location of the configuration
26
                        file.
27
  -S, --disable-sound   Disables initializing the sound card.
28 1 Adrian Georgescu
  -s, --trace-sip       Dump the raw contents of incoming and outgoing SIP
29
                        messages.
30
  -j, --trace-pjsip     Print PJSIP logging output.
31
  --trace-engine        Print core's events.
32 3 Adrian Georgescu
  -m, --trace-msrp      Log the raw contents of incoming and outgoing MSRP
33
                        messages.
34
  --no-relay            Don't use the MSRP relay.
35
  --msrp-tcp            Use TCP for MSRP connections.
36 4 Adrian Georgescu
}}}
37
38 11 Adrian Georgescu
=== Available commands  ===
39
40
{{{
41
adigeo@ag-imac3:~/work/python-sipsimple$sip_session 
42
Using account 31208005169@ag-projects.com
43
Type :help to get information about commands and shortcuts
44
Waiting for incoming SIP session requests...
45
Registering "Adrian G." <sip:31208005169@ag-projects.com> at 81.23.228.129:5060
46
Registered SIP contact address: sip:mdbwqhek@192.168.1.6:61453 (expires in 600 seconds)
47
31208005169@ag-projects.com> :help
48
:add audio|chat             Add a new stream to the current session.
49
:call URI [audio|chat]      Make an outgoing call. By default, use audio+chat
50
:dtmf DIGITS                Send DTMF digits. Also try CTRL-SPACE for virtual numpad
51
:help                       Print this help message
52
:hold                       Put the current session on hold
53
:remove audio|chat          Remove the stream from the current session
54
:switch  (or CTRL-N)        Switch between active sessions
55
:unhold                     Un-hold the current session
56
}}}
57
58 4 Adrian Georgescu
59 8 Adrian Georgescu
=== Example of audio only session ===
60 4 Adrian Georgescu
61
{{{
62
adigeo@ag-imac3:~$sip_session   
63
Using account 31208005169@ag-projects.com
64
Press Ctrl-d to quit or Control-n to switch between active sessions
65
Waiting for incoming SIP session requests...
66
Registering "Adrian G." <sip:31208005169@ag-projects.com> at 81.23.228.150:5060
67
Registered SIP contact address: sip:hctoyfvx@192.168.1.6:61277 (expires in 600 seconds)
68
Incoming Audio request from "Adrian G." <sip:31208005169@ag-projects.com>, do you accept? (y/n) y
69
Connecting SIP session to "Adrian G." <sip:31208005169@ag-projects.com>
70
Session established, using "speex" codec at 32000Hz
71
Audio RTP endpoints 192.168.1.6:50018 <-> 81.23.228.150:58260
72
Remote SIP User Agent is "sip2sip-0.9.0-pjsip-1.0.2-trunk-r2553"
73
Detected NAT type: Port Restricted
74
Audio to Adrian G. (31208005169@ag-projects.com): 
75 1 Adrian Georgescu
76 8 Adrian Georgescu
}}}
77
78
79
=== Example of chat only session ===
80
81
{{{
82
adigeo@ag-imac3:~$sip_session room1@chatserver.ag-projects.com
83
Using account 31208005169@ag-projects.com
84
Press Ctrl-d to quit or Control-n to switch between active sessions
85
Registering "Adrian G." <sip:31208005169@ag-projects.com> at 85.17.186.7:5060
86 10 Adrian Georgescu
Initiating SIP session from "Adrian G." <sip:31208005169@ag-projects.com> 
87
to sip:room1@chatserver.ag-projects.com via udp:81.23.228.146:6060 ...
88 8 Adrian Georgescu
Registered SIP contact address: sip:lpgdqwes@192.168.1.6:61392 (expires in 600 seconds)
89
Connecting SIP session to sip:room1@chatserver.ag-projects.com
90
Remote SIP User Agent is "sip-chatserver-0.9.1"
91
10:38:55 room1@chatserver.ag-projects.com: Welcome to the room, Adrian G.. You are the only participant in the room
92
Chat to room1@chatserver.ag-projects.com: 
93
}}}
94
95 14 Adrian Georgescu
=== Example of SIP trace with RTP and MSRP offer/answer ===
96 8 Adrian Georgescu
97 13 Adrian Georgescu
* See [wiki:sip_trace_msrp_rtp]