Sip session » History » Version 10
Adrian Georgescu, 03/30/2009 11:41 AM
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 | |||
39 | 8 | Adrian Georgescu | === Example of audio only session === |
40 | 4 | Adrian Georgescu | |
41 | {{{ |
||
42 | adigeo@ag-imac3:~$sip_session |
||
43 | Using account 31208005169@ag-projects.com |
||
44 | Press Ctrl-d to quit or Control-n to switch between active sessions |
||
45 | Waiting for incoming SIP session requests... |
||
46 | Registering "Adrian G." <sip:31208005169@ag-projects.com> at 81.23.228.150:5060 |
||
47 | Registered SIP contact address: sip:hctoyfvx@192.168.1.6:61277 (expires in 600 seconds) |
||
48 | Incoming Audio request from "Adrian G." <sip:31208005169@ag-projects.com>, do you accept? (y/n) y |
||
49 | Connecting SIP session to "Adrian G." <sip:31208005169@ag-projects.com> |
||
50 | Session established, using "speex" codec at 32000Hz |
||
51 | Audio RTP endpoints 192.168.1.6:50018 <-> 81.23.228.150:58260 |
||
52 | Remote SIP User Agent is "sip2sip-0.9.0-pjsip-1.0.2-trunk-r2553" |
||
53 | Detected NAT type: Port Restricted |
||
54 | Audio to Adrian G. (31208005169@ag-projects.com): |
||
55 | 1 | Adrian Georgescu | |
56 | 8 | Adrian Georgescu | }}} |
57 | |||
58 | |||
59 | === Example of chat only session === |
||
60 | |||
61 | {{{ |
||
62 | adigeo@ag-imac3:~$sip_session room1@chatserver.ag-projects.com |
||
63 | Using account 31208005169@ag-projects.com |
||
64 | Press Ctrl-d to quit or Control-n to switch between active sessions |
||
65 | Registering "Adrian G." <sip:31208005169@ag-projects.com> at 85.17.186.7:5060 |
||
66 | 10 | Adrian Georgescu | Initiating SIP session from "Adrian G." <sip:31208005169@ag-projects.com> |
67 | to sip:room1@chatserver.ag-projects.com via udp:81.23.228.146:6060 ... |
||
68 | 8 | Adrian Georgescu | Registered SIP contact address: sip:lpgdqwes@192.168.1.6:61392 (expires in 600 seconds) |
69 | Connecting SIP session to sip:room1@chatserver.ag-projects.com |
||
70 | Remote SIP User Agent is "sip-chatserver-0.9.1" |
||
71 | 10:38:55 room1@chatserver.ag-projects.com: Welcome to the room, Adrian G.. You are the only participant in the room |
||
72 | Chat to room1@chatserver.ag-projects.com: |
||
73 | }}} |
||
74 | |||
75 | === Example of SDP with RTP and MSRP proposal === |
||
76 | |||
77 | {{{ |
||
78 | INVITE sip:61@ag-projects.com SIP/2.0 |
||
79 | Via: SIP/2.0/UDP 192.168.1.6:61335;rport;branch=z9hG4bKPjTgHt1tWJgdV0tXsSCX.h9EJBZneF1134 |
||
80 | Max-Forwards: 70 |
||
81 | From: "Adrian G." <sip:31208005169@ag-projects.com>;tag=yf.gdZqZwOE5qcCB02qcKL9tdjtHK3-r |
||
82 | To: sip:61@ag-projects.com |
||
83 | Contact: <sip:rlafgmkq@192.168.1.6:61335> |
||
84 | Call-ID: slXPhUalLN3tiJYDKI5UnNOspHkV4PNb |
||
85 | CSeq: 16232 INVITE |
||
86 | Route: <sip:85.17.186.7:5060;lr> |
||
87 | Allow: SUBSCRIBE, NOTIFY, PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, MESSAGE |
||
88 | Supported: 100rel |
||
89 | User-Agent: sip2sip-0.9.0-pjsip-1.0.2-trunk-r2553 |
||
90 | 9 | Adrian Georgescu | Proxy-Authorization: Digest username="31208005169", realm="ag-projects.com", |
91 | nonce="49d092ef3dd41223af53ece9bc1b5ce903898ece", uri="sip:61@ag-projects.com", response="6baaa853d66bc376e8e56acbd512d16b" |
||
92 | 8 | Adrian Georgescu | Content-Type: application/sdp |
93 | Content-Length: 592 |
||
94 | |||
95 | v=0 |
||
96 | o=- 3447394641 3447394641 IN IP4 192.168.1.6 |
||
97 | s= |
||
98 | c=IN IP4 192.168.1.6 |
||
99 | t=0 0 |
||
100 | m=audio 50048 RTP/AVP 104 103 102 0 8 117 3 9 101 |
||
101 | a=rtcp:50049 IN IP4 192.168.1.6 |
||
102 | a=rtpmap:104 speex/32000 |
||
103 | a=rtpmap:103 speex/16000 |
||
104 | a=rtpmap:102 speex/8000 |
||
105 | a=rtpmap:0 PCMU/8000 |
||
106 | a=rtpmap:8 PCMA/8000 |
||
107 | a=rtpmap:117 iLBC/8000 |
||
108 | a=fmtp:117 mode=20 |
||
109 | a=rtpmap:3 GSM/8000 |
||
110 | a=rtpmap:9 G722/8000 |
||
111 | a=rtpmap:101 telephone-event/8000 |
||
112 | a=fmtp:101 0-15 |
||
113 | a=sendrecv |
||
114 | m=message 2855 TCP/TLS/MSRP * |
||
115 | a=path:msrps://192.168.1.6:2855/f2a8d0dcf07af4869cdd;tcp |
||
116 | a=accept-types:message/cpim text/* |
||
117 | a=accept-wrapped-types:* |
||
118 | 1 | Adrian Georgescu | }}} |