With the help of members from this mailing list (many thanks!), I finally
got Asterisk fronted by Kamailio for LB and REGISTERs and I am able to make
a call using the setup that looks like this:
[Kamailio 4.4.2]<->[Asterisk 13.7.2]
Kamailio manages REGISTERs, but also forwarding them to Asterisk.
I am able to make a call, but I get only one way audio or no audio
depending on which client made the call (SipDroid->Zoiper I hear one way
audio on Zoiper, but no audio if the call is made the other way). I noticed
that Kamailio forced direct media between the endpoints in this situation,
but my application really needs Asterisk to handle it.
How do I do this? Should I start by forwarding INVITEs to Asterisk? How do
I do that?
Any help is appreciated.
Thanks!
Hi,
I am trying to use kamailio as an edge proxy to forward requests and media to an sbc. when compiling the cfg file included on the examples. i get:
undefined symbol: EVP_sha1
I believe this problem is being caused by the outbound module and after some research i managed to read that it is caused by the linking between the gcc libcrypto. I would like some help since this project requires urgency. Thanks in advance.
Dear Kamailio users,
Ref: http://kamailio.org/docs/modules/4.2.x/modules/tm.html#tm.f.t_relay
Using t_relay([host, port]) to relay messages to a specific host does
not seem to generate DNS queries to the said host after Kamailio has
initially processed the configuration file.
It resolves the host once at startup then continues using the same IP after.
Is that expected behavior? Anyone has had this issue before and found a
way to work around it?
Note that for this specific application, messages need to be relayed to
a specified host (different from current R-URI) and this host needs to
be resolved by DNS during normal operation, not only at startup.
Thanks!
Louis-Olivier
Hi Guys,
So currently on our network we have a kamailio server which users register against, we then replicate the register messages to 2 Asterisk boxes sat behind it so that all entities are aware of the registration state of the users.
REGISTER--->KAMAILIO---->ASTERISK A ---->ASTERISK B
With a REGISTER---200OK exchange between Kamailio and Asterisk.
We have an issue where at some points the Asterisk servers when under load dont respond with a 200 ok(something being investigated) to the register messages sent to kamailio, so I am just working on some logic for the register message to be resent using the t_replicate and t_set_fr functions.
This works well should both Asterisk servers not respond, however, as I am using replicate and it is parallel forking, if say Asterisk A answers first and is available with a 200ok then that in turn cancels the register message branch being sent to Asterisk B(which I know is fine), however there could be a scenario where Asterisk B doesnt respond, and we wont know about it to try and resend the Register message, as the branch is cancelled.
Hope that makes sense?
I am looking at checking that both the Asterisk servers have responded and sent a 200ok, which I can grab in an onreply route but Im just wondering if someone has done something similar or has any suggestions as it is tricky to achieve currently.
I have also thought about stateless working but I really need kamailio to keep retransmitting the register until it gets a response.
Many thanks
Jon
Hi,
Running Kamailio on Debian from the Kamailio repository with 4.4.2
stable (unpatched). Getting some random segfaults with it now, here's
the relevant backtrace from the generated core.
Core was generated by `/usr/sbin/kamailio -f /etc/kamailio/kamailio.cfg
-P /var/run/kamailio/kamailio.'.
Program terminated with signal 11, Segmentation fault.
#0 run_dlg_callbacks (type=type@entry=64, dlg=dlg@entry=0x7fceb400e2f0,
req=req@entry=0x7fced4f093c8, rpl=rpl@entry=0x0, dir=<optimized out>,
dlg_data=dlg_data@entry=0x0) at dlg_cb.c:253
253 if ( (cb->types)&type ) {
(gdb) bt
#0 run_dlg_callbacks (type=type@entry=64, dlg=dlg@entry=0x7fceb400e2f0,
req=req@entry=0x7fced4f093c8, rpl=rpl@entry=0x0, dir=<optimized out>,
dlg_data=dlg_data@entry=0x0) at dlg_cb.c:253
#1 0x00007fcead3648f9 in dlg_terminated (dir=<optimized out>,
dlg=0x7fceb400e2f0, req=0x7fced4f093c8) at dlg_handlers.c:368
#2 dlg_onroute (req=0x7fced4f093c8, route_params=<optimized out>,
param=<optimized out>) at dlg_handlers.c:1354
#3 0x00007fceb10ab0e2 in run_rr_callbacks
(req=req@entry=0x7fced4f093c8, rr_param=rr_param@entry=0x7fceb12b77a0)
at rr_cb.c:96
#4 0x00007fceb10952c5 in after_loose (_m=0x7fced4f093c8, preloaded=0)
at loose.c:919
#5 0x000000000042b618 in do_action (h=h@entry=0x7ffeb0b3ed80,
a=a@entry=0x7fced4cb4338, msg=msg@entry=0x7fced4f093c8) at action.c:1060
#6 0x000000000042a10a in run_actions (h=h@entry=0x7ffeb0b3ed80,
a=0x7fced4cb4338, msg=0x7fced4f093c8) at action.c:1549
#7 0x0000000000437544 in run_actions_safe (h=h@entry=0x7ffeb0b402b0,
a=<optimized out>, msg=<optimized out>) at action.c:1614
#8 0x000000000053b2e8 in rval_get_int (h=0x7ffeb0b402b0, msg=<optimized
out>, i=0x7ffeb0b3f1e0, rv=rv@entry=0x7fced4cb4d58,
cache=cache@entry=0x0) at rvalue.c:912
#9 0x000000000054261c in rval_expr_eval_int (h=h@entry=0x7ffeb0b402b0,
msg=msg@entry=0x7fced4f093c8, res=res@entry=0x7ffeb0b3f1e0,
rve=rve@entry=0x7fced4cb4d50) at rvalue.c:1910
#10 0x000000000042bc91 in do_action (h=h@entry=0x7ffeb0b402b0,
a=a@entry=0x7fced4cb8f88, msg=msg@entry=0x7fced4f093c8) at action.c:1030
#11 0x000000000042a10a in run_actions (h=h@entry=0x7ffeb0b402b0,
a=0x7fced4cb8f88, msg=msg@entry=0x7fced4f093c8) at action.c:1549
#12 0x000000000042bcf2 in do_action (h=h@entry=0x7ffeb0b402b0,
a=a@entry=0x7fced4cb91e8, msg=msg@entry=0x7fced4f093c8) at action.c:1049
#13 0x000000000042a10a in run_actions (h=h@entry=0x7ffeb0b402b0,
a=0x7fced4cb3f48, msg=msg@entry=0x7fced4f093c8) at action.c:1549
#14 0x000000000042bde0 in do_action (h=h@entry=0x7ffeb0b402b0,
a=a@entry=0x7fced4ac3d70, msg=msg@entry=0x7fced4f093c8) at action.c:678
#15 0x000000000042a10a in run_actions (h=h@entry=0x7ffeb0b402b0,
a=a@entry=0x7fced4ac1698, msg=msg@entry=0x7fced4f093c8) at action.c:1549
#16 0x00000000004375d0 in run_top_route (a=0x7fced4ac1698,
msg=msg@entry=0x7fced4f093c8, c=c@entry=0x0) at action.c:1635
#17 0x0000000000504386 in receive_msg (buf=<optimized out>,
len=<optimized out>, rcv_info=<optimized out>) at receive.c:240
#18 0x00000000005f5bd4 in udp_rcv_loop () at udp_server.c:495
#19 0x00000000004b2625 in main_loop () at main.c:1600
#20 0x0000000000427e2b in main (argc=<optimized out>, argv=<optimized
out>) at main.c:2616
And from syslog the relevant messages before this dump:
Jul 15 08:55:03 server /usr/sbin/kamailio[16470]: WARNING: dialog
[dlg_handlers.c:1219]: dlg_onroute(): unable to find dialog for BYE with
route param 'd4c.26d1' [3149:7522]
Jul 15 08:56:01 server /usr/sbin/kamailio[16481]: WARNING: dialog
[dlg_handlers.c:1219]: dlg_onroute(): unable to find dialog for BYE with
route param 'fc.99f1' [207:8089]
Jul 15 08:56:27 server /usr/sbin/kamailio[16470]: CRITICAL: dialog
[dlg_timer.c:200]: update_dlg_timer(): Trying to update a bogus dlg
tl=0x7fceb3f7d920 tl->next=(nil) tl->prev=(nil)
Jul 15 08:56:27 server /usr/sbin/kamailio[16470]: ERROR: dialog
[dlg_handlers.c:1377]: dlg_onroute(): failed to update dialog lifetime
Jul 15 08:57:01 server /usr/sbin/kamailio[16482]: ERROR: db_mysql
[km_dbase.c:128]: db_mysql_submit_query(): driver error on query:
Duplicate entry '9584-3854-435' for key 'hash_index' (1062)
Jul 15 08:57:01 server /usr/sbin/kamailio[16482]: ERROR: <core>
[db_query.c:181]: db_do_raw_query(): error while submitting query
Jul 15 08:57:01 server /usr/sbin/kamailio[16482]: ERROR: sqlops
[sql_api.c:265]: sql_do_query(): cannot do the query [INSERT INTO
`dialog_extra` (`h_i]
Jul 15 08:57:01 server /usr/sbin/kamailio[16482]: ERROR: auth
[api.c:119]: auth_check_hdr_md5(): auth:pre_auth: Credentials are not
filled properly
Jul 15 08:57:01 server /usr/sbin/kamailio[16483]: ERROR: auth
[api.c:119]: auth_check_hdr_md5(): auth:pre_auth: Credentials are not
filled properly
Jul 15 08:57:54 server /usr/sbin/kamailio[16506]: NOTICE: dialog
[dlg_hash.c:245]: dlg_clean_run(): dialog in delete state is too old
(0x7fceb3f64470 ref 4)
Jul 15 08:57:54 server /usr/sbin/kamailio[16473]: WARNING: dialog
[dlg_handlers.c:1348]: dlg_onroute(): inconsitent dlg timer data on dlg
0x7fceb3f64470 [1182:5803] with clid
'09ad128753e2535d24bde58e3d7eda04@192.168.10.232:5060' and tags
'as1b497b34' '5788890C-EC6F55F-3E86ED0C'
Jul 15 08:57:54 server /usr/sbin/kamailio[16469]: ERROR: dialog
[dlg_handlers.c:334]: dlg_terminated_confirmed(): failed to get dialog
from params!
Jul 15 08:58:49 server /usr/sbin/kamailio[16467]: WARNING: dialog
[dlg_handlers.c:1219]: dlg_onroute(): unable to find dialog for BYE with
route param '6d2.2581' [726:6226]
Jul 15 08:59:24 server /usr/sbin/kamailio[16506]: NOTICE: dialog
[dlg_hash.c:245]: dlg_clean_run(): dialog in delete state is too old
(0x7fceb400e2f0 ref 4)
Jul 15 08:59:25 server /usr/sbin/kamailio[16464]: WARNING: dialog
[dlg_handlers.c:1219]: dlg_onroute(): unable to find dialog for BYE with
route param '3e4.b5c1' [1251:7259]
Jul 15 08:59:25 server /usr/sbin/kamailio[16465]: WARNING: dialog
[dlg_handlers.c:1348]: dlg_onroute(): inconsitent dlg timer data on dlg
0x7fceb400e2f0 [1251:7259] with clid '87791a#015#012Call-ID:
25750e286a5654361ef9405d72edbc' and tags '' 'as148f41b1'
Jul 15 08:59:25 server kernel: [203670.830521] kamailio[16465] general
protection ip:7fcead34b3a5 sp:7ffeb0b3e220 error:0 in
dialog.so[7fcead330000+88000]
Jul 15 08:59:26 server /usr/sbin/kamailio[16511]: CRITICAL: <core>
[pass_fd.c:275]: receive_fd(): EOF on 33
Jul 15 08:59:26 server /usr/sbin/kamailio[16458]: ALERT: <core>
[main.c:739]: handle_sigs(): child process 16465 exited by a signal 11
Jul 15 08:59:26 server /usr/sbin/kamailio[16458]: ALERT: <core>
[main.c:742]: handle_sigs(): core was generated
Jul 15 08:59:26 server /usr/sbin/kamailio[16458]: INFO: <core>
[main.c:754]: handle_sigs(): terminating due to SIGCHLD
Any insight would be appreciated!
Cheers,
Dirk
Hi,
We tested the following on Kamailio 3.x and 4.x and observed the same behavior.
INVITE and CANCEL are sent to Kamailo from the same source within the same transaction. (branch value in the first via header are the same in both INVITE and CANCEL message. Also FROM and TO header are same as well).
However, Kamailio does not relay CANCEL message. UAC keep sending CANCEL till timeout. Apparently, t_check_trans() returns false.
Can anyone help me on this issue on why Kamailio does not relay CANCEL message?
Thanks,
AS
INVITE received by Kamailio
INVITE sip:1111111@10.10.10.10:5060;user=phone SIP/2.0
Via: SIP/2.0/UDP 20.20.20.20:5060;branch=z9hG4bKkjhg4n100gagvkoup741.1
Max-Forwards: 69
From: <sip:2222222@20.20.20.20>;tag=SDl9eu701-1c1026774897
To: <sip:1111111@10.10.10.10;user=phone>
Call-ID: SDl9eu701-36d75c874d3f463f6c83c5c94cc98b77-8q7ug02
CSeq: 1 INVITE
Contact: <sip:2222222@20.20.20.20:5060;transport=udp>
Supported: em,timer,replaces,path,resource-priority,sdp-anat
Allow: REGISTER,OPTIONS,INVITE,ACK,CANCEL,BYE,NOTIFY,PRACK,REFER,INFO,SUBSCRIBE,UPDATE
User-Agent: CS-CustomerName/v.6.60A.274
Content-Type: application/sdp
Content-Length: 237
P-Asserted-Identity: tel:2222222
P-Asserted-Identity: sip:2222222@192.168.0.1
after 70 msec CANCEL received by Kamailio in the same transaction
CANCEL sip:1111111@10.10.10.10:5060;user=phone SIP/2.0
Via: SIP/2.0/UDP 20.20.20.20:5060;branch=z9hG4bKkjhg4n100gagvkoup741.1
CSeq: 1 CANCEL
Max-Forwards: 69
From: <sip:2222222@20.20.20.20>;tag=SDl9eu701-1c1026774897
To: <sip:1111111@10.10.10.10.;user=phone>
Call-ID: SDl9eu701-36d75c874d3f463f6c83c5c94cc98b77-8q7ug02
Content-Length: 0
Reason: Q.850 ;cause=16
hi i m a new user of kamailio
i have sertup kamailio SIP to SIP call going well
but now i m tring to impliment Music On Hold
i m this
http://www.kamailio.org/docs/modules/devel/modules/mohqueue.html#table.parms
but unable to impliment plz help me
Hare i attache my kamailio config file
--
*Regards:*
Gaurav Bmotra
Smith Infotech
E-46, phase 8 , Indus Area S.A.S Nagar Mohali 160071
Hi,
looks like in your script, in the SENDPUSH route, you set the luaret var to
0 then you check if it's value is != 1, in which case you reply 501,
Unknown Destination. Since you never change the var value you are always
hitting this case.
Regards,
Federico
On 24 Jul 2016 14:25, "Nahum Nir" <hello.shalom.hi(a)gmail.com> wrote:
> Hello Fredrico,
>
> Please see the attached cfg. I tried to add the fragments you published
> and to add a suspension at SENDPUSH but I am getting Desitnation Unknow.
>
> Thank you so much,
> Nir
>
> On Thu, Jul 21, 2016 at 10:03 PM, Federico Cabiddu <
> federico.cabiddu(a)gmail.com> wrote:
>
>> Hi Nir,
>> all you should do upon receiving B's REGISTER, after saving the contact
>> (by calling save function) is either resume the transaction, perform a
>> lookup and relay or call ts_append (if you already relayed the INVITE). If
>> you get "unavailable" (I guess that this means that you are receiving a
>> 404) probably the user is not being found in the location. Check if you are
>> doing these steps in your config and if it doesn't work try to send the
>> relevant part of the config and the kamailio's logs. I'm currently away and
>> almost without network but I'll try to have a look as soon as possible.
>>
>> Regards,
>>
>> Federico
>>
>> On 21 Jul 2016 16:09, "Nahum Nir" <hello.shalom.hi(a)gmail.com> wrote:
>>
>> Thanks,
>>
>> I was able to suspend the transaction and wait for the register but the
>> client that sends the INVITE get unavailable right after the other side
>> joins.
>> Here is my debug flow:
>> Client A sends the INVITES.
>>
>> Use case 1: Client B register one time. Then I turn off the WiFi in
>> client B so it will not recieve the push notification. Client A sends the
>> INVITE, server sends the PUSH and Client A is waiting for 5 seconds.
>>
>> Use case 3: Same as before but now client B get the push. This time
>> client A that sends the INVITE gets from the server unavailable as soon as
>> client B register.
>>
>> I did as you suggested and suspend the trunsaction before sending the
>> push. Probably a second suspend is needed when client B sends the REGISTER?
>>
>> Thanks and regards,
>> Nir
>>
>> On Wed, Jul 20, 2016 at 4:06 PM, Federico Cabiddu <
>> federico.cabiddu(a)gmail.com> wrote:
>>
>>> Hi,
>>> to set the timeout for a specific transaction you can use tm module
>>> function t_set_fr (
>>> http://www.kamailio.org/docs/modules/devel/modules/tm.html#tm.f.t_set_fr
>>> ).
>>> For example you could call it before suspending the transaction setting
>>> a short timeout and then call it again in the reply route when receiving
>>> the first provisional response from the client.
>>>
>>> Regards,
>>>
>>> Federico
>>> On 20 Jul 2016 2:50 pm, "Nahum Nir" <hello.shalom.hi(a)gmail.com> wrote:
>>>
>>>> Hello,
>>>>
>>>> How can I chage the timer waiting for the client to send the register.
>>>> i.e. how much time to wait for the push?
>>>>
>>>> Thanks,
>>>> Nir
>>>>
>>>>
>>>> _______________________________________________
>>>> 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
>>>>
>>>>
>>> _______________________________________________
>>> 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
>>>
>>>
>>
>>
>
Hello,
When using Kamailio with the dispatcher module for Asterisk load balancing,
I am offloading REGISTERs to Kamailio (works fine), but would like to
forward the REGISTERs to Asterisk so that outgoing calls from Asterisk will
be possible. I know this is not strictly necessary (e.g., just use Kamailio
to forward everything), but I have a lot of application logic behind my
Asterisk boxes (using ARI) and so I don't want that to break. Thereby, I do
need this information in Asterisk as soon as possible from Kamailio.
Let's say I have three boxes Asterisk_1, Asterisk_2 and Asterisk_3 in the
dispatcher module like so:
1 sip:192.168.1.201:5060;transport=tcp
1 sip:192.168.1.202:5060;transport=tcp
1 sip:192.168.1.203:5060;transport=tcp
My system has endpoints as numerical extensions, from 101 to 110. When a
new endpoint registers with kamailio (and authenticates), I would like to
send the REGISTER to Asterisk. But I have the following questions:
(a) Which Asterisk? I could send it to a round-robinned Asterisk (say,
Asterisk_2), but that Asterisk may not be the one responsible for handling
calls outbound for the endpoint that just registered. Even if I use "hash
over auth username" instead of round-robin (In
http://www.kamailio.org/docs/modules/4.0.x/modules/dispatcher.html#idp16940…,
choose 5 for "alg", for example) that wont solve this problem as an
outbound request may come from another Asterisk box which won't have the
requisite registration information. Should I forward REGISTERs to all
Asterisk boxes? Maybe I won't have to deal with this issue as I use
realtime and so the REGISTER information, sent to one Asterisk box, is
available to all Asterisk boxes after the write to the realtime DB. Is my
understanding correct?
(b) How do I do this in kamailio.cfg? With some examples on the Internet
for WITH_ASTERISK directive, I see that you do
route[REGFWD] {
if(!is_method("REGISTER"))
{
return;
}
$var(rip) = $sel(cfg_get.asterisk.bindip);
$uac_req(method)="REGISTER";
$uac_req(ruri)="sip:" + $var(rip) + ":" +
$sel(cfg_get.asterisk.bindport) + ";transport=tcp";
$uac_req(furi)="sip:" + $au + "@" + $var(rip);
$uac_req(turi)="sip:" + $au + "@" + $var(rip);
$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();
}
What is the equivalent for when you are using the dispatcher module and the
kamailio.bindip and asterisk.bindip etc. are not set in the configuration,
but instead should be procured from elsewhere?
Any help is appreciated.