Hi
Im trying to modify example for Asterisk/Kamailio integration that miconda
did, and trying to handle Forwarded register to Asterisk in an
authenticated way instead removing secret in asterisk.
I have made this changes
route[REGFWD] {
if(!is_method("REGISTER"))
{
return;
}
$var(rip) = $var(astip);
$uac_req(method)="REGISTER";
$uac_req(ruri)="sip:" + $var(rip) + ":" + $var(astport);
$uac_req(furi)="sip:" + $(au{s.substr,8,0}) + "@" + $var(rip);
$uac_req(turi)="sip:" + $(au{s.substr,8,0}) + "@" + $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";
xlog("Dentro de REGFWD");
t_on_failure("REG_AST");
uac_req_send();
}
failure_route[REG_AST] {
if (t_is_canceled()) {
exit;
}
xlog("Dentro de REG AST");
if(t_check_status("401|407")) {
xlog("Dentro de 401");
$avp(auser) = "test";
$avp(apass) = "test";
uac_auth();
t_relay();
exit;
}
}
What i see on traces:
U x.x.x..240:5060 -> x.x.x..56:5060
REGISTER sip:x.x.x.56:5060 SIP/2.0.
Via: SIP/2.0/UDP
x.x.x.240;branch=z9hG4bKfb46.a47535d4000000000000000000000000.0.
To: <sip:200@x.x.x.56>.
From: <sip:200@x.x.x.56>;tag=533cb9e91f4b999cf76861cbb9ed54ed-6a4f.
CSeq: 10 REGISTER.
Call-ID: 09dc120d65932ed7-16044(a)127.0.0.1.
Max-Forwards: 70.
Content-Length: 0.
User-Agent: ANY.
Contact: <sip:emp_001_200@x.x.x.240:5060>.
Expires: 3600.
.
#
U x.x.x.56:5060 -> x.x.x..240:5060
SIP/2.0 401 Unauthorized.
Via: SIP/2.0/UDP x.x.x..240
;branch=z9hG4bKfb46.a47535d4000000000000000000000000.0;received=x.x.x..240
;rport=5060.
From: <sip:200@x.x.x.56>;tag=533cb9e91f4b999cf76861cbb9ed54ed-6a4f.
To: <sip:200@x.x.x.56>;tag=as62b47138.
Call-ID: 09dc120d65932ed7-16044(a)127.0.0.1.
CSeq: 10 REGISTER.
Server: FPBX-2.11.0(11.17.1).
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO,
PUBLISH, MESSAGE.
Supported: replaces, timer.
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="59e39692".
Content-Length: 0.
.
But Kamailio is not sending authentication .
Any idea what could be wrong? Or any tip to do what i try.
The idea is that a sip endpoint register with authentication on kamailio
and it sends register with authentication to asterisk.
Thanks in advance
Hi everyone
At my workplace there's plenty of hardphone directly connected to an hosted sbc in the cloud.
As an added value i proposed to add locally Kamailio as a proxy server to 'federate' all the sip traffic.
ipphone behind nat (A) <---> sip proxy local 192.168.x.x (B)<----> sbc registrar (mydomain.com) and sip proxy with public IP (C)
when hardphone try to register, B rewrite (with rewritehost) the ip public of (C). B then uses exported function of TM to t_relay_to(C).
to route INVITE from A to C i use proxy_authenticate("mydomain.com") function (on B) from auth_db to pass the calls inbetween.
This works well, but i am wondering if that makes sense if i get several phones behind B.
Should stateless forward works better in this kind of scenario?
In a near future i plan to offer disaster recovery, and i want all users binding to C (users(a)mydomain.com)instead bind on B (in case link B---C get down)and assume some kind of telephone functionnality
Is that possible ?
Do you have some sort of example Kamailio do it good On-premise/localy ?
How to deal with nat since all hardphones have rfc1918 address?
,
thx you
PS: as an sbc (C) i did setup kamailio/asterisk in a real-time configuration.
Sébastien BRICE VoIP, Support et Intégration
Hello,
Is it possible to use kamailio to be a stateful outbound proxy ?
The use case is kamailio is an outbound proxy for multiple instances of Asterisk.
Thus all responses need to go back to the same instance of Asterisk that generated them.
After the call is established.
How can I ensure that the Re-Invites, BYEs, etc are sent to the same instance of Asterisk that generated the outbound Invite ?
Any help is appreciated.
Thanks,
--Jignesh
Hi,
The destination node is down. By adding the following code Kamailo re-routing INVITE to a new destination after getting 408 timeout (as below).
failure_route[MANAGE_FAILURE]{ if (t_branch_timeout()) { # change to new destination IP $rd = "10.10.10.10"; t_relay(); exit; }...}
However, the ACK message coming from source is still being send to the old destination. How can I reroute other messages in the dialog to be sent to this new destination..
Thank,
AS
Hi all,
We had a few GSoC applications[1] from students who would like to do
work relating to SIP and WebRTC this summer.
The students have a range of skills. Some are interested in the server
side (C, C++) code. Some are interested in Android and Java projects
(e.g. the Lumicall and CSipSimple dialers) and some are web developers,
interested in making practical use of WebRTC.
Would anybody else from the community be interested in helping to mentor
one of these projects? Prospective mentors can review the proposals
privately before making any firm commitment, please contact me for
details. Mentors can have some input in the direction of the students'
work, just as long as all code is released publicly.
Regards,
Daniel
1. http://danielpocock.com/gsoc-2016-voice-video-chat
Hi guys!
We have an issue with XML-RPC module.
>From this doc: http://kamailio.org/docs/modules/4.3.x/modules/xmlrpc.html
"Success replies always contain at least one return value. In our case the
simplest success replies contain single boolean with value 1"
We are trying to reload domain module after adding/removing new domain, so
we send the following request:
XX - web server; YY - kamailio
T XX.XX.XX.XX:55028 -> YY.YY.YY.YY:8080 [AP]
POST /RPC2 HTTP/1.1.
Host: YY.YY.YY.YY:8080.
Accept: */*.
Accept-Encoding: deflate, gzip.
User-Agent: cURL.
Accept-Charset: UTF-8.
Content-Length: 120.
Content-Type: application/x-www-form-urlencoded.
.
<?xml version="1.0" encoding="iso-8859-1"?>
<methodCall>
<methodName>domain.reload</methodName>
<params/>
</methodCall>
T YY.YY.YY.YY:8080 -> XX.XX.XX.XX:55028 [AP]
HTTP/1.1 200 OK.
Sia: SIP/2.0/TCP XX.XX.XX.XX:55028.
Server: kamailio (4.3.4 (x86_64/linux)).
Content-Length: 108.
.
<?xml version="1.0"?>
<methodResponse>
<params>
<param>
<value></value>
</param>
</params>
</methodResponse>
As you can see in the response from the kamailio there is no any data, so
our script is waiting until timeout...
Please advice.
Thanks,
--
Regards,
Arsen.
Hi,
I am trying to re-route to a different $ru after timeout and right before Kamailio reply with a 408.I made the changes right before sl_reply_error(), however it does not work as I expected. Any help will be appreciated.
Also, $rm represents the request message received by Kamailio. Is there a variable represents the messages leaving Kamailio?.
route[RELAY] {
# enable additional event routes for forwarded requests # - serial forking, RTP relaying handling, a.s.o. if (is_method("INVITE|SUBSCRIBE")) { t_on_branch("MANAGE_BRANCH"); t_on_reply("MANAGE_REPLY"); } if (is_method("INVITE")) { t_on_failure("MANAGE_FAILURE"); }
if (!t_relay()) { // re-route to a new $ru before sending 408 sl_reply_error(); } exit;}
Thanks,AS