Sip message
Version 8 (Adrian Georgescu, 03/12/2009 08:06 pm) → Version 9/15 (Adrian Georgescu, 03/23/2009 07:05 pm)
== sip_message ==
[[TOC(SipTesting*, sip_*, depth=2)]]
To use this script you must to have a valid [wiki:SipSettingsAPI configuration].
=== Description ===
Source code: [source:scripts/sip_message.py scripts/sip_message.py]
{{{
Usage: sip_message [options] [target-user@target-domain.com]
This will either sit idle waiting for an incoming MESSAGE request, or send a
MESSAGE request to the specified SIP target. In outgoing mode the program will
read the contents of the messages to be sent from standard input, Ctrl+D
signalling EOF as usual. In listen mode the program will quit when Ctrl+D is
pressed.
Options:
-h, --help show this help message and exit
-a NAME, --account=NAME ACCOUNT_NAME, --account-name=ACCOUNT_NAME
The account name from which to use for any outgoing traffic. If read account settings.
not supplied, Corresponds to section Account_NAME in the default
configuration file.
--sip-address=SIP_ADDRESS
SIP login account will be used.
-c [FILE], --config_file=[FILE] -p PASSWORD, --password=PASSWORD
The path Password to a configuration file use to use. authenticate the local account.
This overrides the setting from the config file.
-n DISPLAY_NAME, --display-name=DISPLAY_NAME
Display name to use for the local account. This
overrides the setting from the config file.
-o IP[:PORT], --outbound-proxy=IP[:PORT]
Outbound SIP proxy to use. By default location of a lookup is
performed based on SRV and A records. This overrides
the configuration
setting from the config file.
-s [stdout|file|all|none], --trace-sip=[stdout|file|all|none]
-s, --trace-sip Dump the raw contents of incoming and outgoing SIP
messages. The argument specifies where the messages
are to be dumped. (disabled by default).
-j [stdout|file|all|none], --trace-pjsip=[stdout|file|all|none]
Print PJSIP logging output. The argument specifies
where the messages are to be dumped.
-m MESSAGE, --message=MESSAGE
Contents of the message to send. This disables reading
the message from standard input.
-l, --log-pjsip Print PJSIP logging output (disabled by default).
}}}
=== Example for receiving a message ===
{{{
adigeo@ag-imac3:~$sip_message
Accounts available: 'alice', 'ew', 'mrg', 'pbx', 'tf', 'umts', 'unet', default
Using default account: 31208005169@ag-projects.com
Registering ""Adrian G." <sip:31208005169@ag-projects.com>" at 81.23.228.150:5060
REGISTER was successful
Contact: <sip:4f855cb09b@192.168.1.6:51408> (expires in 300 seconds)
Other registered contacts:
<sip:31208005169@192.168.1.122:5062;line=634g6j67> (expires in 480 seconds)
<sip:5dac4295e9@192.168.1.6:51375> (expires in 95 seconds)
<sip:31208005169@192.168.1.123:5060> (expires in 77 seconds)
<sip:31208005169@192.168.1.1;uniq=5B2860C44383A3D6705629A7E1FB8> (expires in 1563 seconds)
<sip:31208005169@80.101.96.20:61578> (expires in 3069 seconds)
Press Ctrl+D to stop the program.
Received MESSAGE from ""Adi UMTS" <sip:adi@umts.ro>", Content-Type: text/plain
dsgsgddsgs
Received MESSAGE from ""Adi UMTS" <sip:adi@umts.ro>", Content-Type: text/plain
Testing short text messages in page mode!
}}}
=== Example for sending a message ===
{{{
adigeo@ag-imac3:~$sip_message -a umts ag@ag-projects.com
Accounts available: 'alice', 'ew', 'mrg', 'pbx', 'tf', 'umts', 'unet', default
Using account 'umts': adi@umts.ro
Press Ctrl+D on an empty line to end input and send the MESSAGE request.
dsgsgddsgs
Sending MESSAGE from ""Adi UMTS" <sip:adi@umts.ro>" to "<sip:ag@ag-projects.com>" using proxy 81.23.228.150:5060
MESSAGE was accepted by remote party.
adigeo@ag-imac3:~$sip_message -a umts ag@ag-projects.com
Accounts available: 'alice', 'ew', 'mrg', 'pbx', 'tf', 'umts', 'unet', default
Using account 'umts': adi@umts.ro
Press Ctrl+D on an empty line to end input and send the MESSAGE request.
Testing short text messages in page mode!
Sending MESSAGE from ""Adi UMTS" <sip:adi@umts.ro>" to "<sip:ag@ag-projects.com>" using proxy 81.23.228.150:5060
MESSAGE was accepted by remote party.
}}}
[[TOC(SipTesting*, sip_*, depth=2)]]
To use this script you must to have a valid [wiki:SipSettingsAPI configuration].
=== Description ===
Source code: [source:scripts/sip_message.py scripts/sip_message.py]
{{{
Usage: sip_message [options] [target-user@target-domain.com]
This will either sit idle waiting for an incoming MESSAGE request, or send a
MESSAGE request to the specified SIP target. In outgoing mode the program will
read the contents of the messages to be sent from standard input, Ctrl+D
signalling EOF as usual. In listen mode the program will quit when Ctrl+D is
pressed.
Options:
-h, --help show this help message and exit
-a NAME, --account=NAME ACCOUNT_NAME, --account-name=ACCOUNT_NAME
The account name from which to use for any outgoing traffic. If read account settings.
not supplied, Corresponds to section Account_NAME in the default
configuration file.
--sip-address=SIP_ADDRESS
SIP login account will be used.
-c [FILE], --config_file=[FILE] -p PASSWORD, --password=PASSWORD
The path Password to a configuration file use to use. authenticate the local account.
This overrides the setting from the config file.
-n DISPLAY_NAME, --display-name=DISPLAY_NAME
Display name to use for the local account. This
overrides the setting from the config file.
-o IP[:PORT], --outbound-proxy=IP[:PORT]
Outbound SIP proxy to use. By default location of a lookup is
performed based on SRV and A records. This overrides
the configuration
setting from the config file.
-s [stdout|file|all|none], --trace-sip=[stdout|file|all|none]
-s, --trace-sip Dump the raw contents of incoming and outgoing SIP
messages. The argument specifies where the messages
are to be dumped. (disabled by default).
-j [stdout|file|all|none], --trace-pjsip=[stdout|file|all|none]
Print PJSIP logging output. The argument specifies
where the messages are to be dumped.
-m MESSAGE, --message=MESSAGE
Contents of the message to send. This disables reading
the message from standard input.
-l, --log-pjsip Print PJSIP logging output (disabled by default).
}}}
=== Example for receiving a message ===
{{{
adigeo@ag-imac3:~$sip_message
Accounts available: 'alice', 'ew', 'mrg', 'pbx', 'tf', 'umts', 'unet', default
Using default account: 31208005169@ag-projects.com
Registering ""Adrian G." <sip:31208005169@ag-projects.com>" at 81.23.228.150:5060
REGISTER was successful
Contact: <sip:4f855cb09b@192.168.1.6:51408> (expires in 300 seconds)
Other registered contacts:
<sip:31208005169@192.168.1.122:5062;line=634g6j67> (expires in 480 seconds)
<sip:5dac4295e9@192.168.1.6:51375> (expires in 95 seconds)
<sip:31208005169@192.168.1.123:5060> (expires in 77 seconds)
<sip:31208005169@192.168.1.1;uniq=5B2860C44383A3D6705629A7E1FB8> (expires in 1563 seconds)
<sip:31208005169@80.101.96.20:61578> (expires in 3069 seconds)
Press Ctrl+D to stop the program.
Received MESSAGE from ""Adi UMTS" <sip:adi@umts.ro>", Content-Type: text/plain
dsgsgddsgs
Received MESSAGE from ""Adi UMTS" <sip:adi@umts.ro>", Content-Type: text/plain
Testing short text messages in page mode!
}}}
=== Example for sending a message ===
{{{
adigeo@ag-imac3:~$sip_message -a umts ag@ag-projects.com
Accounts available: 'alice', 'ew', 'mrg', 'pbx', 'tf', 'umts', 'unet', default
Using account 'umts': adi@umts.ro
Press Ctrl+D on an empty line to end input and send the MESSAGE request.
dsgsgddsgs
Sending MESSAGE from ""Adi UMTS" <sip:adi@umts.ro>" to "<sip:ag@ag-projects.com>" using proxy 81.23.228.150:5060
MESSAGE was accepted by remote party.
adigeo@ag-imac3:~$sip_message -a umts ag@ag-projects.com
Accounts available: 'alice', 'ew', 'mrg', 'pbx', 'tf', 'umts', 'unet', default
Using account 'umts': adi@umts.ro
Press Ctrl+D on an empty line to end input and send the MESSAGE request.
Testing short text messages in page mode!
Sending MESSAGE from ""Adi UMTS" <sip:adi@umts.ro>" to "<sip:ag@ag-projects.com>" using proxy 81.23.228.150:5060
MESSAGE was accepted by remote party.
}}}