Hi all,
I'm using kamailio 3.1 and I have some problems with parallel forking.
I need to implement parallel forking to different users registered on
kamailio.
So, when call arrives with R-URI= sip:003912345678@<IP_server>, I need
to fork te call to (for example) 2 users: 1001 and 1001.
To do that, I've created my usr_preferences table like this:
+----+------+------------------+--------+-----------+------+-------+---------------------+
|/ id | uuid | username | domain | attribute | type | value | /last_modified |
+----+------+------------------+--------+-----------+------+-------+---------------------+
|/ 1 | | /003912345678/ | | fork | 0 | 1001 | |
/|/ 2 | | /003912345678/ | | fork | 0 | 1002 | |
/+----+------+------------------+--------+-----------+------+-------+---------------------+
and I've added a code to my kam.cfg like this:
if (is_method("INVITE"))
{
xlog("L_INFO", "REQUEST Invite - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
if(avp_db_load("$ru/username","$avp(s:fork)"))
{
avp_pushto("$ru/username","$avp(s:fork)/g");
}
if(!lookup("location"))
{
xlog("L_INFO", "Local user offline - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
sl_send_reply("404", "User Offline");
exit;
}
else
{
xlog("L_INFO", "Local user online - M=$rm RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");
t_relay();
}
}
If 1001 and 1002 are registered everything works fine (1001 Ringing and
1002 ringing).
Ifonly 1001 registered everything works fine (1001 ringing and 1002 is
offline.).
But when 1002 is registered and 1001 in offline, kamailio try to call
1001, find that it's offline ( and I get 404 User Offline") but no call
to 1002 is attempted.
What's wrong ?
Regards,
Daniel
A large bunch of recent email on this list got consigned to the spam bin
by my Thunderbird.
This hasn't happened before.
Is there some list change that triggered this?
Regards
Jeremy A
Hello,
The diagram below shows the SIP message flow in our setup when Softphone
A places a call to Softphone B.
----------- ----- ---------- ----- -----------
|Softphone A|-<->-|Proxy|-<->-|Sip Server|-<->-|Proxy|-<->-|Softphone B|
----------- ----- ---------- ----- -----------
IP: a.b.c.d IP: a.b.c.d
Proxies shown in the diagram above are physically the same entity. For
convenience of diagrammatic representation the figure above has been
unwrapped.
Both Softphone A and Softphone B (hereafter referred to as A,B) are
behind a NAT and are registered to the Sip Server through the same proxy
(IP: a.b.c.d). Proxy runs Kamailio v3.0.1.
When A places a call to B, an INVITE is proxied to the Sip Server from
A. The Sip Server now sends another INVITE to the proxy, however the
R-URI of this INVITE does not contain the port number that the INVITE is
supposed to be sent to. Hence the proxy sends the INVITE to the default
SIP port 5060. This port is not open in the firewall hence Softphone B
never receives the INVITE.
My questions are
1) Is it mandatory for R-URI of the INVITE to contain the port number ?
2) If not, is there something that can be added to the config script in
Kamailio so that the proxy forwards the INVITE to the appropriate port?
(maybe by keeping track of the rcv port of the REGISTER message that
Softphone B sends...) ?
Thanks and Regards,
Vikram.
PS : The Sip Server in the above discussion is Voipswitch.
private mails are simply ignored after first advise in this regard,
please CC the mailing list always.
If you read the config from the tutorial, you see how the invite is
relayed to asterisk. Refer should go to asterisk in the same way if it
is an out of dialog request, or follow record route/contact address for
within dialog requests.
Cheers,
Daniel
On 1/20/11 11:37 AM, David J. wrote:
> could you point me to the docs?
>
> just use forward() or rewritehostport()?
>
>
>
> On 1/20/11 5:15 AM, Daniel-Constantin Mierla wrote:
>> If asterisk is in the path of the call, then just forward the REFER
>> to it, there is no need to generate a new one.
>>
>> Also, note that REFER is many times part of a dialog, uac_req_send()
>> creates requests out of the dialog.
>>
>> Cheers,
>> Daniel
>>
>> On 1/16/11 11:37 PM, David J. wrote:
>>> I realize that kamailio is not a b2bua;
>>> But because we are using Asterisk in the path;
>>>
>>> To extend the Asterisk Realtime Tutorial;
>>>
>>> I was wondering if I could do something like this...
>>>
>>> Kind of like how we use UAC to send a register to Asterisk;
>>> Could we do the same and modify the method to use REFER instead?
>>>
>>> I know it is more complex; but I am not sure where to handle this case;
>>>
>>> Thanks for any pointers.
>>>
>>> if(is_method("REFER")){
>>> $var(rip) = $sel(cfg_get.asterisk.bindip);
>>> $uac_req(method)="REFER";
>>> $uac_req(ruri)="sip:" + $var(rip) + ":" +
>>> $sel(cfg_get.asterisk.bindport);
>>> $uac_req(furi)="sip:" + $au + "@" + $var(rip) + ";tag=" + $ft;
>>> $uac_req(turi)="sip:" + $au + "@" + $var(rip) + ";tag=" + $tt;
>>> $uac_req(hdrs)="Contact: <sip:" + $au + "@"
>>> + $sel(cfg_get.kamailio.bindip)
>>> + ":" +
>>> $sel(cfg_get.kamailio.bindport) + ">\r\n";
>>> if($sel(contact.expires) != $null)
>>> $uac_req(hdrs)= $uac_req(hdrs) + "Expires: " +
>>> $sel(contact.expires) + "\r\n";
>>> else
>>> $uac_req(hdrs)= $uac_req(hdrs) + "Expires: " +
>>> $hdr(Expires) + "\r\n";
>>>
>>>
>>> uac_req_send();
>>>
>>>
>>> }
>>>
>>> _______________________________________________
>>> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>>> sr-users(a)lists.sip-router.org
>>> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>
>
--
Daniel-Constantin Mierla
Kamailio (OpenSER) Advanced Training
Jan 24-26, 2011, Irvine, CA, USA
http://www.asipto.com
Not sure how todo this SIP capture. Can you give me an hand and explain how
can I get this trace.
I can post my configuration if it's necesary. But I'use the default NAT
setup that comes with Debian package.
2011/1/19 Alex Balashov <abalashov(a)evaristesys.com>
You'd need to post the SIP capture, but it sounds like Kamailio is not
> associating the ACK with any known transaction, perhaps because the ACK has
> an unexpected RURI, Via branch parameter, or CSeq number.
>
> --
> Alex Balashov - Principal
> Evariste Systems LLC
> 260 Peachtree Street NW
> Suite 2200
> Atlanta, GA 30303
> Tel: +1-678-954-0670
> Fax: +1-404-961-1892
> Web: http://www.evaristesys.com/
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users(a)lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
I am trying to add support for call transfer in the Asterisk realtime
tutorial on Asipto;
I am not sure what I would have to do to get this feature working;
Perhaps I have to handle "refer" messages; but I am not sure how I send
that to Asterisk;
Any advice would be greatly appreciated.
I realize that kamailio is not a b2bua;
But because we are using Asterisk in the path;
To extend the Asterisk Realtime Tutorial;
I was wondering if I could do something like this...
Kind of like how we use UAC to send a register to Asterisk;
Could we do the same and modify the method to use REFER instead?
I know it is more complex; but I am not sure where to handle this case;
Thanks for any pointers.
if(is_method("REFER")){
$var(rip) = $sel(cfg_get.asterisk.bindip);
$uac_req(method)="REFER";
$uac_req(ruri)="sip:" + $var(rip) + ":" +
$sel(cfg_get.asterisk.bindport);
$uac_req(furi)="sip:" + $au + "@" + $var(rip) + ";tag=" + $ft;
$uac_req(turi)="sip:" + $au + "@" + $var(rip) + ";tag=" + $tt;
$uac_req(hdrs)="Contact: <sip:" + $au + "@"
+ $sel(cfg_get.kamailio.bindip)
+ ":" + $sel(cfg_get.kamailio.bindport)
+ ">\r\n";
if($sel(contact.expires) != $null)
$uac_req(hdrs)= $uac_req(hdrs) + "Expires: " +
$sel(contact.expires) + "\r\n";
else
$uac_req(hdrs)= $uac_req(hdrs) + "Expires: " +
$hdr(Expires) + "\r\n";
uac_req_send();
}
Hi list
we have been testing the mtree module. We do periodical reloads of the mtree
table with the "mi mt_reload" command through xmlrpc. It works fine except
when the db is restarted. If we manually restart the db and then try the
mt_reload commands we get this error:
Jan 4 09:13:17 server /usr/local/kamailio-3.1.1/sbin/kamailio[28534]:
ERROR: db_postgres [km_dbase.c:152]: 0xa6a490 PQsendQuery Error: server
closed the connection unexpectedly#012#011This probably means the server
terminated abnormally#012#011before or while processing the request.#012
Query: select partition,prefix,route from trees order by partition
Jan 4 09:13:17 server /usr/local/kamailio-3.1.1/sbin/kamailio[28534]:
ERROR: <core> [db_query.c:101]: error while submitting query
Jan 4 09:13:17 server /usr/local/kamailio-3.1.1/sbin/kamailio[28534]:
ERROR: mtree [mtree_mod.c:622]: Error while querying db
Jan 4 09:13:17 server /usr/local/kamailio-3.1.1/sbin/kamailio[28534]:
ERROR: mtree [mtree_mod.c:738]: cannot re-load info from database
Is there a way to reconnect to the db before sending that command?
Thanks in advance
Regards
Javi
Hello
avp_db_query(query[,dest]) can get a database query and store the results in the avps.
But what if the results returns many rows,and how can I get all the results? How to set the [dest] parameter ?
I've tried the method describered inhttp://www.kamailio.org/docs/avp_db_query.html,but it doesn't work.
like below
mysql<select mem_user from tgroup where grp_name='1234';
+----------+
| mem_user |
+----------+
| 1013 |
| 2013 |
+----------+
2 rows in set (0.00 sec)
kamailio.cfg
if(avp_db_query("select mem_user from tgroup where grp_name='1234'","$avp(name)"))
{
xlog("L_INFO","query results[1] :$avp(name[1])\n");
xlog("L_INFO","query results[2] :$avp(name[2])\n");
}
syslog
<INFO> query results[1] :<null>
<INFO> query results[2] :<null>
version: kamailio 3.0.2 MySQL 5.0
thank you very much!