Project

General

Profile

Sip session » History » Revision 15

Revision 14 (Adrian Georgescu, 03/31/2009 02:59 PM) → Revision 15/44 (Adrian Georgescu, 03/31/2009 03:00 PM)

== sip_session == 

 [[TOC(SipTesting*, sip_*, depth=2)]] 

 To use this script you must to have a valid [wiki:SipSettingsAPI configuration]. 

 === Description === 

 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 default defaul behaviour is to establish outgoing session with both audio and chat media. 

 [[Image(http://www.tech-invite.com/img/cf3665/cf3665-37.gif)]] 

 {{{ 
 adigeo@ag-imac3:~$sip_session -h 
 Usage: sip_session [options] [target-user@target-domain.com] [audio|chat] 

 This script will either sit idle waiting for an incoming MSRP session, or 
 start a 
 new MSRP session with the specified target SIP address. The program will 
 close the 
 session and quit when CTRL-D CTRL+D is pressed. This scripts supports RTP audio and 
 MSRP chat sessions. 

 Options: 
   -h, --help              show this help message and exit 
   -a ACCOUNT_NAME, --account-name=ACCOUNT_NAME 
                         The name of the account to use. ACCOUNT_ID, --account-id=ACCOUNT_ID 
   --no-register           Bypass registration. 
   -c FILE, --config_file=FILE [FILE], --config_file=[FILE] 
                         The path to a configuration file to use. This 
                         overrides the default location of the configuration 
                         file. 
   -S, --disable-sound     Disables initializing the sound card. 
   -s, --trace-sip         Dump the raw contents of incoming and outgoing SIP 
                         messages. 
   -j, --trace-pjsip       Print PJSIP logging output. 
   --trace-engine          Print core's events. 
   -m, --trace-msrp        Log the raw contents of incoming and outgoing MSRP 
                         messages. 
   --no-relay              Don't use the MSRP relay. 
   --msrp-tcp              Use TCP for MSRP connections. 
 }}} 

 === Available commands    === 

 {{{ 
 adigeo@ag-imac3:~/work/python-sipsimple$sip_session  
 Using account 31208005169@ag-projects.com 
 Type :help to get information about commands and shortcuts 
 Waiting for incoming SIP session requests... 
 Registering "Adrian G." <sip:31208005169@ag-projects.com> at 81.23.228.129:5060 
 Registered SIP contact address: sip:mdbwqhek@192.168.1.6:61453 (expires in 600 seconds) 
 31208005169@ag-projects.com> :help 
 :add audio|chat               Add a new stream to the current session. 
 :call URI [audio|chat]        Make an outgoing call. By default, use audio+chat 
 :dtmf DIGITS                  Send DTMF digits. Also try CTRL-SPACE for virtual numpad 
 :help                         Print this help message 
 :hold                         Put the current session on hold 
 :remove audio|chat            Remove the stream from the current session 
 :switch    (or CTRL-N)          Switch between active sessions 
 :unhold                       Un-hold the current session 
 }}} 


 === Example of audio only session === 

 {{{ 
 adigeo@ag-imac3:~$sip_session    
 Using account 31208005169@ag-projects.com 
 Press Ctrl-d to quit or Control-n to switch between active sessions 
 Waiting for incoming SIP session requests... 
 Registering "Adrian G." <sip:31208005169@ag-projects.com> at 81.23.228.150:5060 
 Registered SIP contact address: sip:hctoyfvx@192.168.1.6:61277 (expires in 600 seconds) 
 Incoming Audio request from "Adrian G." <sip:31208005169@ag-projects.com>, do you accept? (y/n) y 
 Connecting SIP session to "Adrian G." <sip:31208005169@ag-projects.com> 
 Session established, using "speex" codec at 32000Hz 
 Audio RTP endpoints 192.168.1.6:50018 <-> 81.23.228.150:58260 
 Remote SIP User Agent is "sip2sip-0.9.0-pjsip-1.0.2-trunk-r2553" 
 Detected NAT type: Port Restricted 
 Audio to Adrian G. (31208005169@ag-projects.com):  

 }}} 


 === Example of chat only session === 

 {{{ 
 adigeo@ag-imac3:~$sip_session room1@chatserver.ag-projects.com 
 Using account 31208005169@ag-projects.com 
 Press Ctrl-d to quit or Control-n to switch between active sessions 
 Registering "Adrian G." <sip:31208005169@ag-projects.com> at 85.17.186.7:5060 
 Initiating SIP session from "Adrian G." <sip:31208005169@ag-projects.com>  
 to sip:room1@chatserver.ag-projects.com via udp:81.23.228.146:6060 ... 
 Registered SIP contact address: sip:lpgdqwes@192.168.1.6:61392 (expires in 600 seconds) 
 Connecting SIP session to sip:room1@chatserver.ag-projects.com 
 Remote SIP User Agent is "sip-chatserver-0.9.1" 
 10:38:55 room1@chatserver.ag-projects.com: Welcome to the room, Adrian G.. You are the only participant in the room 
 Chat to room1@chatserver.ag-projects.com:  
 }}} 

 === Example of SIP trace with RTP and MSRP offer/answer === 

 * See [wiki:sip_trace_msrp_rtp]