顯示具有 sip 標籤的文章。 顯示所有文章
顯示具有 sip 標籤的文章。 顯示所有文章

2008年11月17日 星期一

SIP Register with authentication required (using eXosip2)

->Send Register

->Receive SIP/2.0 407 Proxy Authentication Required with header
Proxy-Authenticate: Digest realm="W.X.Y.Z", nonce="YYYY0992000000046dd64e657218e5a77472ae059c69XXXX"

->Send Register with header
Proxy-Authorization: Digest username="XXXXX", realm="W.X.Y.Z", nonce="YYYY0992000000046dd64e657218e5a77472ae059c69XXXX", uri="sip:W.X.Y.Z", response="ZZZZe5d430141e984ff50fa560bWWWW", algorithm=MD5 ==>1st try

->Receive SIP/2.0 407 Proxy Authentication Required with header
Proxy-Authenticate: Digest realm="W.X.Y.Z", nonce="YYYY0992000000046dd64e657218e5a77472ae059c69XXXX"

->Send Register with header
Proxy-Authorization: Digest username="XXXXX", realm="W.X.Y.Z", nonce="YYYY0992000000046dd64e657218e5a77472ae059c69XXXX", uri="sip:W.X.Y.Z", response="ZZZZe5d430141e984ff50fa560bWWWW", algorithm=MD5 ==>2nd try

->Receive SIP/2.0 407 Proxy Authentication Required with header
Proxy-Authenticate: Digest realm="W.X.Y.Z", nonce="YYYY0992000000046dd64e657218e5a77472ae059c69XXXX"

->Send Register with header
Proxy-Authorization: Digest username="XXXXX", realm="W.X.Y.Z", nonce="YYYY0992000000046dd64e657218e5a77472ae059c69XXXX", uri="sip:W.X.Y.Z", response="ZZZZe5d430141e984ff50fa560bWWWW", algorithm=MD5 ==>3rd try

->Receive SIP/2.0 407 Proxy Authentication Required with header
Proxy-Authenticate: Digest realm="W.X.Y.Z", nonce="YYYY0992000000046dd64e657218e5a77472ae059c69XXXX"

2008年11月9日 星期日

kamctl usage

usr/local/sbin/kamctl

Existing commands:

-- command 'start|stop|restart'

restart ............................ restart Kamailio
start .............................. start Kamailio
stop ............................... stop Kamailio

-- command 'acl' - manage access control lists (acl)

acl show [] .............. show user membership
acl grant ....... grant user membership (*)
acl revoke [] .... grant user membership(s) (*)

-- command 'lcr' - manage least cost routes (lcr)

* IP addresses must be entered in dotted quad format e.g. 1.2.3.4 *
* and must be entered in integer or text,*
* e.g. transport '2' is identical to transport 'tcp'. *
* scheme: 1=sip, 2=sips; transport: 1=udp, 2=tcp, 3=tls *
* Examples: lcr addgw level3 1.2.3.4 5080 sip tcp 1 *
* lcr addroute +1 '' 1 1 *
lcr show .....................................................................
............. show routes, gateways and groups
lcr reload ...................................................................
............. reload lcr gateways
lcr addgw
............... add a gateway with flags, tag and strip ............
................(flags, tag, and strip are optional arguments) .....
lcr rmgw ..........................................................
............... delete a gateway
lcr addroute .................................
.............. add a route ( use '' to match anything in )
lcr rmroute .................................
.............. delete a route

-- command 'cr' - manage carrierroute tables

cr show ....................................................... show tables
cr reload ..................................................... reload tables
cr dump ....................................................... show in memory tables
cr addrt ..................... add a tree
cr rmrt ....................................... rm a tree
cr addcarrier ................
...............
.........................add a carrier
(prob, strip, rewrite_prefix, rewrite_suffix,...................
flags, mask and comment are optional arguments) ...............
cr rmcarrier ................ rm a carrier

-- command 'rpid' - manage Remote-Party-ID (RPID)

rpid add ......... add rpid for a user (*)
rpid rm ................. set rpid to NULL for a user (*)
rpid show ............... show rpid of a user

-- command 'add|passwd|rm' - manage subscribers

add .......... add a new subscriber (*)
passwd ......... change user's password (*)
rm ...................... delete a user (*)

-- command 'add|dump|reload|rm|show' - manage trusted

trusted show ...................... show db content
trusted dump ...................... show cache content
trusted reload .................... reload db table into cache
trusted add
....................... add a new entry
....................... (from_pattern and tag are optional arguments)
trusted rm ............... remove all entres for the given src_ip

-- command 'dispatcher' - manage dispatcher

* Examples: dispatcher addgw 1 sip:1.2.3.1:5050 1 'outbound gateway'
* dispatcher addgw 2 sip:1.2.3.4:5050 3 ''
* dispatcher rmgw 4
dispatcher show ..................... show dispatcher gateways
dispatcher reload ................... reload dispatcher gateways

dispatcher dump ..................... show in memory dispatcher gateways
dispatcher addgw
.......................... add gateway
dispatcher rmgw ................ delete gateway

-- command 'db' - database operations

db exec ..................... execute SQL query
db roexec ................. execute read-only SQL query
db run ......................... execute SQL query from $id variable
db rorun ....................... execute read-only SQL query from
$id variable
db show ..................... display table content

-- command 'speeddial' - manage speed dials (short numbers)

speeddial show ....... show speeddial details
speeddial list ............. list speeddial for uri
speeddial add [] ...
........................... add a speedial (*)
speeddial rm ....... remove a speeddial (*)
speeddial help ...................... help message
- , must be an AoR (username@domain)
- must be an AoR (username@domain)
- must be a SIP AoR (sip:username@domain)
- a description for speeddial

-- command 'avp' - manage AVPs

avp list [-T table] [-u ]
[-a attribute] [-v value] [-t type] ... list AVPs
avp add [-T table]
............ add AVP (*)
avp rm [-T table] [-u ]
[-a attribute] [-v value] [-t type] ... remove AVP (*)
avp help .................................. help message
- -T - table name
- -u - SIP id or unique id
- -a - AVP name
- -v - AVP value
- -t - AVP name and type (0 (str:str), 1 (str:int),
2 (int:str), 3 (int:int))
- must be an AoR (username@domain)
- must be a string but not AoR

-- command 'alias_db' - manage database aliases

alias_db show .............. show alias details
alias_db list ............. list aliases for uri
alias_db add ...... add an alias (*)
alias_db rm ................ remove an alias (*)
alias_db help ...................... help message
- must be an AoR (username@domain)"
- must be an AoR (username@domain)"

-- command 'domain' - manage local domains

domain reload ....................... reload domains from disk
domain show ......................... show current domains in memory
domain showdb ....................... show domains in the database
domain add ................. add the domain to the database
domain rm .................. delete the domain from the database

SIP attribute meaning

Contact is the location where UA can receive the message from the SIP Server (Registrar)
Contact:

Original from sip-ua the contact is private address, like the following describes
Contact:

After the openser processing, it will modify to the public one (e.g. 1.2.3.4)
Contact: ;expires=240

2008年10月29日 星期三

osip2 experience

Some state definitions in the osip2 header file
ICT_XXXX means invite client transaction
IST_XXXX means invite server transaction
NICT_XXXX means NON-invite client transaction
NIST_XXXX means NON-invite server transaction

defined in the libosip2-3.1.0/include/osip2/osip.h

2007年12月20日 星期四

SIP Transaction and Dialog parameters

Transaction:
Via - Must contain a branch parameter to identify the transaction created by that request. The branch ID must always begin with the characters “z9hG4bK” as a magic cookie.
Branch parameter “branch=z9hG4bK776asdhds” to identify the transaction


Dialog:
The combination of the “To tag”, “From tag”, and “Call-ID” completely defines a peer-to-peer SIP relationship between Alice and Bob and is referred to as a dialog.