Hello,
I have a need to pass info contained in a X-header within a 300 message to
the failure-route or branch-route for inclusion in a new INVITE which
results from the redirect. Is there a mechanism available that would allow
me to do this? AVPs are not available in the reply route.
Thanks,
T.R.
Hi everybody,
Following some discussions with Juha regarding some extension for the
branch flags, we decided it is better to have a re-design of flags in
openser to allow a better flexibility and extensibility without any
consistency penalties.
What we had so far:
- message flags (or transaction flags) which are transaction persistent
- pseudo-branch flags - a set of flags from the message flags were
handled by TM as branch flags
(saved per branch and not only per transaction).
What we have now:
- message flags (or transaction flags) will works as they do now,
but the branch mask will be removed (rolling back as in 0.9.x versions).
These flags are transaction persistent.
- branch flags (NEW) are saved also in transaction, but per branch;
also they will be saved in usrloc (per contact). A new set of functions
were added for manipulating these flags from script. So, there flags
will be registration persistent and branch persistent.
- script flags (NEW) are no-message-related flags - they are only
script persistent and you can strictly use them for scripting. Once you
exit a top level route, they will be lost. These flags are useful and
they offer an option to de-congest the message flags - many flags have
no need to be saved as they just reflect some scripting status.
What changes brings this:
- NAT flag will become a branch flag all the time.
- you can have custom flags to be saved into usrloc (via branch flags).
- more flags in script (via script flags).
Corresponding Functions:
Message/transaction flags:
setflag(flag_idx)
resetflag(flag_idx)
isflagset(flag_idx)
Branch flags:
setbflag/setbranchflag(branch_idx,flag_idx)
resetbflag/resetbranchflag(branch_idx,flag_idx)
isbflagset/isbranchflagset(branch_idx,flag_idx)
or, the shorter format, working on the default (branch 0) flags:
setbflag(flag_idx)
resetbflag(flag_idx)
isbflagset(flag_idx)
Script flags:
setsflag/setscriptflag(flag_idx)
resetsflag/resetscriptflag(flag_idx)
issflagset/isscriptflagset(flag_idx)
Flags and Pseudo Variables
Message/transaction flags
$mf (decimal) , $mF (hexa)
Branch flags
$bf (decimal) , $bF (hexa)
Script flags
$sf (decimal) , $sF (hexa)
Flags and routes:
Message/transaction flags
These flags will show up in all routes where messages related to
the initial request are processed. So, they will be visible and
changeable in onbranch, failure and onreply routes; the flags will be
visible in all branch routes; if you change a flag in a branch route,
the next branch routes will inherit the change.
Branch flags
There flags will show up in all routes where messages related to
initial branch request are processed. So, in branch route you will see
different sets of flags (as they are different branches); in onreply
route yo will see the branch flags corresponding to the branch the reply
belongs to; in failure route, the branch flags corresponding to the
branch the winning reply belongs to will be visible.
In request route, you can have multiple branches (as a result of a
lookup(), enum query, append_branch(), etc) - the default branch is 0
(corresponding to the RURI); In reply routes there will be only one
branch , the 0 one. In branch route the default branch is the current
process branch (having index 0); In failure route, initialy there is
only one branch (index 0), corresponding the the failed branch.
Script flags
There flags are available only in script and are reset after each
top level route execution (routes internally triggered by OpenSER). They
will be persistent per main route, onreply_route, branch_route,
failure_route. Note they will be inherit in routes called from other routes.
Example: nat flag handling
..........
# 3 - the nat flag
modparam("usrloc","nat_bflag",3)
..........
route {
..........
if (nat detected)
setbflag(3); # set branch flag 3 for the branch 0
..........
if (is_method("REGISTER")) {
# the branch flags (including 3) will be saved into location
save("location");
exit;
} else {
# lookup will load the branch flag from location
if (!lookup("location")) {
sl_send_reply("404","Not Found");
exit;
}
t_on_branch("1")
t_relay();
}
}
onbranch_route[1] {
xlog("-------branch=$T_branch_idx, branch flags=$bF\n");
if (isbflagset(3)) {
#current branch is marked as natted
.........
}
}
if no parallel forking is done, you can get rid of the branch route and
add instead of t_on_branch():
........
if (isbflagset(3)) {
#current branch is marked as natted
.........
}
.........
I will upload this description on the wiki page to be more accessible -
in the mean while, any feedback (reports, better ideas, bugd) are welcome!
Regards,
Bogdan
I want to add something...
the IM sends an text which is an txtfile, generated with an java
program, started by the shell script...
exec_msg->shell script-> java->txtfile (the characters are replaced
already here not in IM)->Instant Message
But starting the java program direct or with the shell script the
characters are not replaced..only with SER the problem occurs
Hope someone give me some hint.
Thanks
Hello !
I got an problem with the exec_msg function.
When I use it to start an shell script which sends an Instant Message
with german characters the Instant Message arrives to the UA with
special german characters replaced with "?" symbol ...
When I start the shell script manually on the shell , the error does
not occur.
I dont know , whether there exists special parameters for exec module or
the the exec_msg function to set.
Can someone tell me, hoe I can solve the problem with , that the SER
doesnt replace special german characters with an "?"
.
Thanks
___________________________________________________________
Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de
Firstly, Happy New Year to all,
I am seeing quite a few of these memory errors in the openser log
file: *build_contact():
No memory left*. These seem to be occurring when the UA tries to register
with Openser. In the last instance I saw, this lasted almost half an hour
before clearing up.
So I guess what I am trying to find out really is:
1. Is this related to the Private memory size issue I remember reading about
a while ago? I am using Openser 1.0.1 and so far have not messed with the
default memory size settings from the sources I downloaded.
The link on the Openser website about increasing Private memory seems to
imply that this could be what is producing these errors. (I refer to this
link -
http://openser.org/dokuwiki/doku.php/troubleshooting:private-memory-size).
2. Also, if I really have to increase the private memory, I would like to
know how to go about it. Since I already have openser installed and the
server is already in use, do I have to wipe the server and partitions and
re-install the modified Openser or is there an easier way? Can I just
recompile the sources and re-install openser over the previous one and get
it to overwrite the existing directory (without experiencing any problems
with left over files)?
3. How much Private memory is enough to stop these errors? For example,
for a system with 1GB of installed RAM should it be using say 768MB?
4. Finally, can anyone tell me the difference between *private memory*
and *share
memory* in this context? The only difference I am aware of is to do with,
for example, shared graphics memory (e.g. for onboard graphics cards on some
systems which use up some amount of installed physical RAM memory instead of
their own onboard graphics memory). Is this the same thing?
Sorry if some of these questions sound a bit basic but I'm coming from a
Windows background.
Thanks in advance.
hi,I meet trouble about the installing of OpenSER.when I download the code with CVS,I use 'make all',a moment later,there is something happened:
openserunix.o(.text+0x8f): In function `main':
/usr/local/src/openser-1.0.1/sip-server/utils/openserunix/openserunix.c:73: warning: the use of `tmpnam' is dangerous, better use `mkstemp'
make[1]: Leaving directory `/usr/local/src/openser-1.0.1/sip-server/utils/openserunix'
How can I do ? Need your help,my friends.
hi,my friends,I want to ask you a question,when I exec thish command '/usr/local/sbin/openser_mysql.sh create',then it has something wrong that '
ERROR 2002(HY000):Cannot connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock
',I do not know how to do with it,need your help.
hello,
I tried to test SER with GettingStarted.pdf document,
But now I have trouble on "Chapter 9. PSTN Gateway Connectivity".
I made ser.cfg like this chapter.
Then I try to restart SER, SIP clients didn't authorize.
Here is trace log.
2(3926) SIP Request:
2(3926) method: <REGISTER>
2(3926) uri: <sip:191.0.0.2>
2(3926) version: <SIP/2.0>
2(3926) parse_headers: flags=1
2(3926) Found param type 232, <branch> =
<z9hG4bK-d87543-3e309a0333127c58-1--d87543->; state=6
2(3926) Found param type 235, <rport> = <n/a>; state=17
2(3926) end of header reached, state=5
2(3926) parse_headers: Via found, flags=1
2(3926) parse_headers: this is the first via
2(3926) After parse_msg...
2(3926) preparing to run routing scripts...
2(3926) parse_headers: flags=128
2(3926) DEBUG:maxfwd:is_maxfwd_present: value = 70
2(3926) DBG:maxfwd:process_maxfwd_header: value 70 decreased to 16
2(3926) parse_headers: flags=256
2(3926) end of header reached, state=9
2(3926) DEBUG: get_hdr_field: <To> [40]; uri=[sip:8580002@191.0.0.2]
2(3926) DEBUG: to body ["8580002"<sip:8580002@191.0.0.2>
]
2(3926) get_hdr_field: cseq <CSeq>: <1> <REGISTER>
2(3926) DEBUG: get_hdr_body : content_length=0
2(3926) found end of header
2(3926) find_first_route: No Route headers found
2(3926) loose_route: There is no Route HF
2(3926) is_local(): Realm '191.0.0.2' is not local
2(3926) DEBUG: add_param: tag=f7391c78
2(3926) end of header reached, state=29
2(3926) is_local(): Realm '191.0.0.2' is not local
2(3926) parse_headers: flags=-1
2(3926) check_via_address(1910.0.2, 192.168.1.20, 0)
2(3926) DEBUG:destroy_avp_list: destroying list (nil)
2(3926) receive_msg: cleaning up
Ip address 192.168.1.20 is SIP client (CounterPath X-Lite) and 191.0.0.2 is
SER's.
And I added "191.0.0.2" ip address for "trusted" table (MySQL database).
Someone can help me?
Thanks
---------
Aihara
sahria.hao(a)gmail.com