[SR-Users] Parmas in lcr_gw

2018-08-28 Thread Ashutosh chaubey
Hi,

How to give username and password for the gateway in params column in
lcr_gw?


Regards,
Ashutosh
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Adding strip and preix attribute to Dispatcher table

2017-11-21 Thread Ashutosh chaubey
Hi

Thanks it helped.

Regards,
Ashutosh Chaubey

On Tue, Nov 21, 2017 at 8:04 PM, Dmitri Savolainen <savolai...@erinaco.ru>
wrote:

> for example:
>
> $rU = $(rU{s.substr,$(avp(dsattrs){param.value,strip}{s.int}),0});
>
> 2017-11-21 16:56 GMT+03:00 Ashutosh chaubey <ashutoshkrchau...@gmail.com>:
>
>> Hi,
>> Thanks for the help I am now able to add prefix this way to my request
>> however can you please tell me how to use strip as i have to strip few
>> numbers before i send out request from kamailio.
>>
>> Regards,
>> Ashutosh Chaubey
>>
>> On Tue, Nov 21, 2017 at 6:32 PM, Dmitri Savolainen <savolai...@erinaco.ru
>> > wrote:
>>
>>> Hi.
>>>
>>> Attributes should be ";" separeted:
>>> attributes: extra fields in form of name1=value1;...;nameN=valueN.
>>>
>>> Also prefix/strip are not in  "predefined names" in dispatcher doc  ,
>>> so it is possible:
>>>
>>> modparam("dispatcher", "attrs_avp", "$avp(dsattrs)")
>>> 
>>> $rU =$(avp(dsattrs){param.value,prefix}) + $rU;
>>>
>>> 2017-11-21 15:02 GMT+03:00 Ashutosh chaubey <ashutoshkrchau...@gmail.com
>>> >:
>>>
>>>> Hi,
>>>>
>>>> Is there a way to add prefix and strip in dispatcher table attribute
>>>> column. I have tried prefix=11,strip=3 but this seems to not work.
>>>> Any help?
>>>>
>>>>
>>>>
>>>> Regards,
>>>> Ashutosh Chaubey
>>>>
>>>> ___
>>>> Kamailio (SER) - Users Mailing List
>>>> sr-users@lists.kamailio.org
>>>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>>>
>>>>
>>>
>>>
>>> --
>>> Savolainen Dmitri
>>>
>>> ___
>>> Kamailio (SER) - Users Mailing List
>>> sr-users@lists.kamailio.org
>>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>>
>>>
>>
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>>
>
>
> --
> Savolainen Dmitri
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Adding strip and preix attribute to Dispatcher table

2017-11-21 Thread Ashutosh chaubey
Hi,
Thanks for the help I am now able to add prefix this way to my request
however can you please tell me how to use strip as i have to strip few
numbers before i send out request from kamailio.

Regards,
Ashutosh Chaubey

On Tue, Nov 21, 2017 at 6:32 PM, Dmitri Savolainen <savolai...@erinaco.ru>
wrote:

> Hi.
>
> Attributes should be ";" separeted:
> attributes: extra fields in form of name1=value1;...;nameN=valueN.
>
> Also prefix/strip are not in  "predefined names" in dispatcher doc  , so
> it is possible:
>
> modparam("dispatcher", "attrs_avp", "$avp(dsattrs)")
> 
> $rU =$(avp(dsattrs){param.value,prefix}) + $rU;
>
> 2017-11-21 15:02 GMT+03:00 Ashutosh chaubey <ashutoshkrchau...@gmail.com>:
>
>> Hi,
>>
>> Is there a way to add prefix and strip in dispatcher table attribute
>> column. I have tried prefix=11,strip=3 but this seems to not work.
>> Any help?
>>
>>
>>
>> Regards,
>> Ashutosh Chaubey
>>
>> ___
>> Kamailio (SER) - Users Mailing List
>> sr-users@lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>>
>
>
> --
> Savolainen Dmitri
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Adding strip and preix attribute to Dispatcher table

2017-11-21 Thread Ashutosh chaubey
Hi,

Is there a way to add prefix and strip in dispatcher table attribute
column. I have tried prefix=11,strip=3 but this seems to not work.
Any help?



Regards,
Ashutosh Chaubey
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Load Gateway according hostname

2017-11-13 Thread Ashutosh chaubey
Hi,

I am trying to find a way to load a specific gateway but instead of lcr_id
i want it load gateways according to the hostname. I am passing Hostname as
a header to kamailio so its easy to access that but unabale to load
gateways according to it.

Any help?

Regards,
Ashutosh Chaubey
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamailio cannot be installed in ubuntu

2017-07-28 Thread Ashutosh chaubey
CK;
# must be an ACK after a 487
# or e.g. 404 from upstream server
route(RELAY);
exit;
} else {
# ACK without matching transaction ... ignore and discard
exit;
}
}
sl_send_reply("404","Not here");
exit;
}

# Handle SIP registrations
route[REGISTRAR] {
if (!is_method("REGISTER")) return;

if(isflagset(FLT_NATS)) {
setbflag(FLB_NATB);
#!ifdef WITH_NATSIPPING
# do SIP NAT pinging
setbflag(FLB_NATSIPPING);
#!endif
}
if (!save("location"))
sl_reply_error();
exit;
}

# User location service
route[LOCATION] {

#!ifdef WITH_SPEEDDIAL
# search for short dialing - 2-digit extension
if($rU=~"^[0-9][0-9]$")
if(sd_lookup("speed_dial"))
route(SIPOUT);
#!endif

#!ifdef WITH_ALIASDB
# search in DB-based aliases
if(alias_db_lookup("dbaliases"))
route(SIPOUT);
#!endif

$avp(oexten) = $rU;
if (!lookup("location")) {
$var(rc) = $rc;
route(TOVOICEMAIL);
t_newtran();
switch ($var(rc)) {
case -1:
case -3:
send_reply("404", "Not Found");
exit;
case -2:
send_reply("405", "Method Not Allowed");
exit;
}
}

# when routing via usrloc, log the missed calls also
if (is_method("INVITE")) {
setflag(FLT_ACCMISSED);
}

route(RELAY);
exit;
}

# Presence server processing
route[PRESENCE] {
if(!is_method("PUBLISH|SUBSCRIBE"))
return;

if(is_method("SUBSCRIBE") && $hdr(Event)=="message-summary") {
route(TOVOICEMAIL);
# returns here if no voicemail server is configured
sl_send_reply("404", "No voicemail service");
exit;
}

#!ifdef WITH_PRESENCE
if (!t_newtran()) {
sl_reply_error();
exit;
}

if(is_method("PUBLISH")) {
handle_publish();
t_release();
} else if(is_method("SUBSCRIBE")) {
handle_subscribe();
t_release();
}
exit;
#!endif
# if presence enabled, this part will not be executed
if (is_method("PUBLISH") || $rU==$null) {
sl_send_reply("404", "Not here");
exit;
}
return;
}

# IP authorization and user authentication
route[AUTH] {
#!ifdef WITH_AUTH

#!ifdef WITH_IPAUTH
if((!is_method("REGISTER")) && allow_source_address()) {
# source IP allowed
return;
}
#!endif

if (is_method("REGISTER") || from_uri==myself)
{
# authenticate requests
if (!auth_check("$fd", "subscriber", "1")) {
auth_challenge("$fd", "0");
exit;
}
# user authenticated - remove auth header
if(!is_method("REGISTER|PUBLISH"))
consume_credentials();
}
# if caller is not local subscriber, then check if it calls
# a local destination, otherwise deny, not an open relay here
if (from_uri!=myself && uri!=myself) {
sl_send_reply("403","Not relaying");
exit;
}

#!endif
return;
}

# Caller NAT detection
route[NATDETECT] {
#!ifdef WITH_NAT
force_rport();
if (nat_uac_test("19")) {
if (is_method("REGISTER")) {
fix_nated_register();
} else {
if(is_first_hop())
set_contact_alias();
}
setflag(FLT_NATS);
}
#!endif
return;
}

# RTPProxy control and signaling updates for NAT traversal
route[NATMANAGE] {
#!ifdef WITH_NAT
if (is_request()) {
if(has_totag()) {
if(check_route_param("nat=yes")) {
setbflag(FLB_NATB);
}
}
}
if (!(isflagset(FLT_NATS) || isbflagset(FLB_NATB)))
return;

rtpproxy_manage("co");

if (is_request()) {
if (!has_totag()) {
if(t_is_branch_route()) {
add_rr_param(";nat=yes");
}
}
}
if (is_reply()) {
if(isbflagset(FLB_NATB)) {
if(is_first_hop())
set_contact_alias();
}
}
#!endif
return;
}

# URI update for dialog requests
route[DLGURI] {
#!ifdef WITH_NAT
if(!isdsturiset()) {
handle_ruri_alias();
}
#!endif
return;
}

# Routing to foreign domains
route[SIPOUT] {
if (uri==myself) return;

append_hf("P-hint: outbound\r\n");
route(RELAY);
exit;
}

# PSTN GW routing
route[PSTN] {
#!ifdef WITH_PSTN
# check if PSTN GW IP is defined
if (strempty($sel(cfg_get.pstn.gw_ip))) {
xlog("SCRIPT: PSTN routing enabled but pstn.gw_ip not defined\n");
return;
}

# route to PSTN dialed numbers starting with '+' or '00'
# (international format)
# - update the condition to match your dialing rules for PSTN routing
if(!($rU=~"^(\+|00)[1-9][0-9]{3,20}$"))
return;

# only local users allowed to call
if(from_uri!=myself) {
sl_send_reply("403", "Not Allowed");
exit;
}

if (strempty($sel(cfg_get.pstn.gw_port))) {
$ru = "sip:" + $rU + "@" + $sel(cfg_get.pstn.gw_ip);
} else {
$ru = "sip:" + $rU + "@" + $sel(cfg_get.pstn.gw_ip) + ":"
+ $sel(cfg_get.pstn.gw_port);
}

route(RELAY);
exit;
#!endif

return;
}

# XMLRPC routing
#!ifdef WITH_XMLRPC
route[XMLRPC] {
# allow XMLRPC from localhost
if ((method=="POST" || method=="GET")
&& (src_ip==127.0.0.1)) {
# close connection only for xmlrpclib user agents (there is a bug in
# xmlrpclib: it waits for EOF before interpreting the response).
if ($hdr(User-Agent) =~ "xmlrpclib")
set_reply_close();
set_reply_no_connect();
dispatch_rpc();
exit;
}
send_reply("403", "Forbidden");
exit;
}
#!endif

# Routing to voicemail server
route[TOVOICEMAIL] {
#!ifdef WITH_VOICEMAIL
if(!is_method("INVITE|SUBSCRIBE"))
return;

# check if VoiceMail server IP is defined
if (strempty($sel(cfg_get.voicemail.srv_ip))) {
xlog("SCRIPT: VoiceMail routing enabled but IP not defined\n");
return;
}
if(is_method("INVITE")) {
if($avp(oexten)==$null)
return;
$ru = "sip:" + $avp(oexten) + "@" + $sel(cfg_get.voicemail.srv_ip)
+ ":" + $sel(cfg_get.voicemail.srv_port);
} else {
if($rU==$null)
return;
$ru = "sip:" + $rU + "@" + $sel(cfg_get.voicemail.srv_ip)
+ ":" + $sel(cfg_get.voicemail.srv_port);
}
route(RELAY);
exit;
#!endif

return;
}

# Manage outgoing branches
branch_route[MANAGE_BRANCH] {
xdbg("new branch [$T_branch_idx] to $ru\n");
route(NATMANAGE);
}

# Manage incoming replies
onreply_route[MANAGE_REPLY] {
xdbg("incoming reply\n");
if(status=~"[12][0-9][0-9]")
route(NATMANAGE);
}

# Manage failure routing cases
failure_route[MANAGE_FAILURE] {
route(NATMANAGE);

if (t_is_canceled()) {
exit;
}

#!ifdef WITH_BLOCK3XX
# block call redirect based on 3xx replies.
if (t_check_status("3[0-9][0-9]")) {
t_reply("404","Not found");



On Fri, Jul 28, 2017 at 1:27 PM, Sebastian Damm <d...@sipgate.de> wrote:

> Hi,
>
> On Fri, Jul 28, 2017 at 8:25 AM, Ashutosh chaubey
> <ashutoshkrchau...@gmail.com> wrote:
> > Jul 28 11:37:22 coditas-Vostro-3446 kamailio[5293]: ERROR: loading config
> > file(/usr/local/kamailio-4.4/etc/kamailio/kamailio.cfg): No such file or
> > directory
>
> That's the actual error. Looks to me as if the $CFGFILE variable just
> points to a non-existant configuration file.
>
> Maybe you want to use the official Kamailio repositories, there are
> Xenial packages available. Add this line to your sources.list:
>
> deb http://deb.kamailio.org/kamailio xenial main
>
> That's the current stable relase (5.0). If you really need the 4.4
> release, use this repository:
>
> deb http://deb.kamailio.org/kamailio44 xenial main
>
> I would hope, that the error you experienced is fixed in the official
> sources.
>
> Best Regards,
> Sebastian
>
> ___
> Kamailio (SER) - Users Mailing List
> sr-users@lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] Kamailio cannot be installed in ubuntu

2017-07-28 Thread Ashutosh chaubey
Hi,
I have been trying to install kamaiio and its dependencies but its giving
the same error everytime i try to install it via apt. Following is my
terminal error message.


sudo apt install kamailio kamailio-mysql-modules
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer
required:
  apache2-data apache2-utils
Use 'sudo apt autoremove' to remove them.
Suggested packages:
  kamailio-berkeley-modules kamailio-carrierroute-modules
kamailio-cpl-modules kamailio-ldap-modules kamailio-lua-modules
kamailio-mono-modules kamailio-perl-modules kamailio-postgres-modules
  kamailio-presence-modules kamailio-python-modules kamailio-radius-modules
kamailio-redis-modules kamailio-snmpstats-modules kamailio-unixodbc-modules
kamailio-xml-modules kamailio-xmpp-modules
  stun-server | turn-server
The following NEW packages will be installed:
  kamailio kamailio-mysql-modules
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 6,859 kB of archives.
After this operation, 20.7 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu xenial/universe amd64 kamailio amd64
4.3.4-1.1ubuntu2 [6,772 kB]
Get:2 http://archive.ubuntu.com/ubuntu xenial/universe amd64
kamailio-mysql-modules amd64 4.3.4-1.1ubuntu2 [87.8 kB]

Fetched 6,859 kB in 28s (240 kB/s)


Selecting previously unselected package kamailio.
(Reading database ... 249000 files and directories currently installed.)
Preparing to unpack .../kamailio_4.3.4-1.1ubuntu2_amd64.deb ...
Unpacking kamailio (4.3.4-1.1ubuntu2) ...
Selecting previously unselected package kamailio-mysql-modules:amd64.
Preparing to unpack .../kamailio-mysql-modules_4.3.4-1.1ubuntu2_amd64.deb
...
Unpacking kamailio-mysql-modules:amd64 (4.3.4-1.1ubuntu2) ...
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Processing triggers for systemd (229-4ubuntu17) ...
Processing triggers for ureadahead (0.100.0-19) ...
ureadahead will be reprofiled on next reboot
Processing triggers for man-db (2.7.5-1) ...
Setting up kamailio (4.3.4-1.1ubuntu2) ...
Job for kamailio.service failed because the control process exited with
error code. See "systemctl status kamailio.service" and "journalctl -xe"
for details.
invoke-rc.d: initscript kamailio, action "start" failed.
● kamailio.service - Kamailio (OpenSER) - the Open Source SIP Server
   Loaded: loaded (/etc/systemd/system/kamailio.service; enabled; vendor
preset: enabled)
   Active: failed (Result: exit-code) since Fri 2017-07-28 11:37:22 IST;
24ms ago
  Process: 5293 ExecStart=/usr/sbin/kamailio -P
/var/run/kamailio/kamailio.pid -f $CFGFILE -m $SHM_MEMORY -M $PKG_MEMORY -u
$USER -g $GROUP (code=exited, status=255)

Jul 28 11:37:22 coditas-Vostro-3446 systemd[1]: Starting Kamailio (OpenSER)
- the Open Source SIP Server...
Jul 28 11:37:22 coditas-Vostro-3446 kamailio[5293]: ERROR: loading config
file(/usr/local/kamailio-4.4/etc/kamailio/kamailio.cfg): No such file or
directory
Jul 28 11:37:22 coditas-Vostro-3446 systemd[1]: kamailio.service: Control
process exited, code=exited status=255
Jul 28 11:37:22 coditas-Vostro-3446 systemd[1]: Failed to start Kamailio
(OpenSER) - the Open Source SIP Server.
Jul 28 11:37:22 coditas-Vostro-3446 systemd[1]: kamailio.service: Unit
entered failed state.
Jul 28 11:37:22 coditas-Vostro-3446 systemd[1]: kamailio.service: Failed
with result 'exit-code'.
dpkg: error processing package kamailio (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of
kamailio-mysql-modules:amd64:
 kamailio-mysql-modules:amd64 depends on kamailio (= 4.3.4-1.1ubuntu2);
however:
  Package kamailio is not configured yet.

dpkg: error processing package kamailio-mysql-modules:amd64 (--configure):
 dependency problems - leaving unconfigured
Processing triggers for libc-bin (2.23-0ubuntu9) ...
No apport report written because the error message indicates its a followup
error from a previous failure.

  Errors were encountered while processing:
 kamailio
 kamailio-mysql-modules:amd64
E: Sub-process /usr/bin/dpkg returned an error code (1)



And following is my output when i try to reconfiggure dpkg


 sudo dpkg --configure -a
Setting up kamailio (4.3.4-1.1ubuntu2) ...
Job for kamailio.service failed because the control process exited with
error code. See "systemctl status kamailio.service" and "journalctl -xe"
for details.
invoke-rc.d: initscript kamailio, action "start" failed.
● kamailio.service - Kamailio (OpenSER) - the Open Source SIP Server
   Loaded: loaded (/etc/systemd/system/kamailio.service; enabled; vendor
preset: enabled)
   Active: failed (Result: exit-code) since Fri 2017-07-28 11:39:48 IST;
9ms ago
  Process: 5527 ExecStart=/usr/sbin/kamailio -P
/var/run/kamailio/kamailio.pid -f $CFGFILE -m $SHM_MEMORY -M $PKG_MEMORY -u
$USER -g $GROUP (code=exited, status=255)

Jul 28 11:39:48