Hello everyone,
After looking everywhere in the docs and ML archives, I couldn't find a
way to solve my problem, so I would appreciate any help.
We have several iPBX servers sending REGISTERs to a SER registrar. Some
of those servers send us the numbers to register as aor in the form
0XXXXXXXXX (local numbering plan), some other in the form 33XXXXXXXXX
(local country code prefix). For various reasons, we need to handle
those different REGISTERs simultaneously, and be able to lookup both
formats in the location database.
What I'm looking for is a way to "duplicate" the REGISTER entries, i.e.
when ser receives a REGISTER for 33XXXXXXXXX, I'd like it to save() the
33XXXXXXXXX, but also create an entry for the corresponding 0XXXXXXXXX.
Example : SER receives a REGISTER request for 33122334455. I'd like to
have two aors in the location database, so that lookup("33122334455")
and lookup("0123344556") would both return the same thing.
What I have in mind is something like this :
if (method=="REGISTER") {
# Always save the original aor
save("location");
# If the number starts with 33, also save a duplicate aor in the
0XXXXXXXXX format
if (search("^From.*sip:33.*")) {
# Insert some code to alter the received SIP message and change the
# number in order to save the 0XXXXXXXXX aor
# ...
# ...
# ...
save("location");
break;
}
break;
};
Can anyone help ?
Best Regards,
Jerome Martin
Show replies by date
Hi guys,
I would like to run an external application when the call was right setup
and when to run another application or the same application when the call
was successfully hanged up. Can you please send me a snip of code of it?
Thanks.
route {
if (method=="INVITE")
record_route();
t_on_reply("1");
...
}
if (method=="BYE") {
EXEC() # HangedUp
...
}
...
}
onreply_route[1] {
if (status=~"2[0-9][0-9]") {
EXEC() # Answered Call
}
----- Original Message -----
From: "Elton Machado" <elton.machado(a)gmail.com>
To: <serusers(a)lists.iptel.org>
Sent: Wednesday, May 04, 2005 2:39 PM
Subject: [Serusers] Sip accounting
| Hi guys,
|
| I would like to run an external application when the call was right setup
| and when to run another application or the same application when the call
| was successfully hanged up. Can you please send me a snip of code of it?
|
| Thanks.
|
|
|
| _______________________________________________
| Serusers mailing list
| serusers(a)lists.iptel.org
|
http://lists.iptel.org/mailman/listinfo/serusers
|