Hi All
I do forward calls to a DID number to my openser box, if my softphone is online it rings directly because I am using the DID number as an alias. However I want the call to be forwarded to my asterisk box if the user is not online. What statement should I use ?
THanks
With Regards
Ali Jawad
System Administrator
Splendor Telecom (www.splendor.net)
Beirut, Lebanon
Phone: +961 1 373725
Fax: + 961 1 375554
Hi I got the below fixed, however I do need to achieve something else as well. When I forward the call to asterisk I need asterisk to forward it in turn to my cellphone number. Where an how should I re-write the DID number of my SIP packet that acts as the destination URI to my cell phone number.
With Regards
Ali Jawad
System Administrator
Splendor Telecom (www.splendor.net)
Beirut, Lebanon
Phone: +961 1 373725
Fax: + 961 1 375554
________________________________
From: users-bounces@lists.kamailio.org [mailto:users-bounces@lists.kamailio.org] On Behalf Of Ali Jawad Sent: 2008-09-22 16:14 To: users@lists.openser.org; users Subject: [Kamailio-Users] Question about redirect if user is not online
Hi All
I do forward calls to a DID number to my openser box, if my softphone is online it rings directly because I am using the DID number as an alias. However I want the call to be forwarded to my asterisk box if the user is not online. What statement should I use ?
THanks
With Regards
Ali Jawad
System Administrator
Splendor Telecom (www.splendor.net)
Beirut, Lebanon
Phone: +961 1 373725
Fax: + 961 1 375554
Hello,
On 09/22/08 16:16, Ali Jawad wrote:
Hi I got the below fixed, however I do need to achieve something else as well. When I forward the call to asterisk I need asterisk to forward it in turn to my cellphone number. Where an how should I re-write the DID number of my SIP packet that acts as the destination URI to my cell phone number.
to be sure I understand your needs, if the user is not online, you want to send the call to user's mobile.
Perhaps you already have the mobile number in some table in database. You can use avp_db_query() to load it in an AVP (see avpops module for more).
avp_db_query("select __gsm_number__ from __your_table__ where username='$rU'", "$avp(s:gsm_number)");
if(is_avp_set("$avp(s:gsm_number)")) { $rU = $avp(s:gsm_number); $rd = "__your_pstn_gw_ip__"; t_relay(); exit; }
Hope it helps, Daniel
Hi Thanks for your suggestion
I did enter the username and the mobile number into the usr_preferences table and tried the below
####### AVPOPS Section modparam("avpops","avp_url","mysql://openser:xyxyxy@xxxxxxxxxxxx/openser ") modparam("avpops","avp_table","usr_preferences")
In the route statement I did add
if(avp_db_load("$ruri/username","s:callfwd")){ avp_pushto("$ruri","s:callfwd"); route(8); exit; };
I got this error
Sep 23 09:21:03 [340] ERROR:avpops:parse_avp_db: error - bad avp flags Sep 23 09:21:03 [340] ERROR:avpops:fixup_db_avp: parse failed Sep 23 09:21:03 [340] ERROR:core:fix_actions: fixing failed (code=-1) at cfg line 307 Sep 23 09:21:03 [340] CRITICAL:core:fix_expr: fix_actions error
Did I miss anything >?
-----Original Message----- From: Daniel-Constantin Mierla [mailto:miconda@gmail.com] Sent: 2008-09-23 11:53 To: Ali Jawad Cc: users Subject: Re: [Kamailio-Users] Question about redirect if user is not online
Hello,
On 09/22/08 16:16, Ali Jawad wrote:
Hi I got the below fixed, however I do need to achieve something else as well. When I forward the call to asterisk I need asterisk to forward it in turn to my cellphone number. Where an how should I re-write the DID number of my SIP packet that acts as the destination URI to my cell phone number.
to be sure I understand your needs, if the user is not online, you want to send the call to user's mobile.
Perhaps you already have the mobile number in some table in database. You can use avp_db_query() to load it in an AVP (see avpops module for more).
avp_db_query("select __gsm_number__ from __your_table__ where username='$rU'", "$avp(s:gsm_number)");
if(is_avp_set("$avp(s:gsm_number)")) { $rU = $avp(s:gsm_number); $rd = "__your_pstn_gw_ip__"; t_relay(); exit; }
Hope it helps, Daniel
Hello,
On 09/23/08 12:07, Ali Jawad wrote:
Hi Thanks for your suggestion
I did enter the username and the mobile number into the usr_preferences table and tried the below
####### AVPOPS Section modparam("avpops","avp_url","mysql://openser:xyxyxy@xxxxxxxxxxxx/openser ") modparam("avpops","avp_table","usr_preferences")
In the route statement I did add
if(avp_db_load("$ruri/username","s:callfwd")){ avp_pushto("$ruri","s:callfwd"); route(8); exit; };
I got this error
Sep 23 09:21:03 [340] ERROR:avpops:parse_avp_db: error - bad avp flags Sep 23 09:21:03 [340] ERROR:avpops:fixup_db_avp: parse failed Sep 23 09:21:03 [340] ERROR:core:fix_actions: fixing failed (code=-1) at cfg line 307 Sep 23 09:21:03 [340] CRITICAL:core:fix_expr: fix_actions error
Did I miss anything >?
it should be:
if(avp_db_load("$ruri/username","$avp(s:callfwd)")){ avp_pushto("$ruri","$avp(s:callfwd)"); route(8); exit; };
insetead of avp_pushto("$ruri","$avp(s:callfwd)") you can do: $ru = $avp(s:callfwd);
I assume $avp(s:callfwd) has a complete sip uri as value, if it is just the number, then use:
avp_pushto("$ruri/username","$avp(s:callfwd)");
or
$rU = $avp(s:callfwd);
Cheers, Daniel
-----Original Message----- From: Daniel-Constantin Mierla [mailto:miconda@gmail.com] Sent: 2008-09-23 11:53 To: Ali Jawad Cc: users Subject: Re: [Kamailio-Users] Question about redirect if user is not online
Hello,
On 09/22/08 16:16, Ali Jawad wrote:
Hi I got the below fixed, however I do need to achieve something else as well. When I forward the call to asterisk I need asterisk to forward it in turn to my cellphone number. Where an how should I re-write the DID number of my SIP packet that acts as the destination URI to my cell phone number.
to be sure I understand your needs, if the user is not online, you want to send the call to user's mobile.
Perhaps you already have the mobile number in some table in database. You can use avp_db_query() to load it in an AVP (see avpops module for more).
avp_db_query("select __gsm_number__ from __your_table__ where username='$rU'", "$avp(s:gsm_number)");
if(is_avp_set("$avp(s:gsm_number)")) { $rU = $avp(s:gsm_number); $rd = "__your_pstn_gw_ip__"; t_relay(); exit; }
Hope it helps, Daniel
Hi Thanks for the help and insight so far.
I did try your corrected version and I got this error:
Sep 23 10:21:09 [555] ERROR:avpops:fixup_pushto_avp: bad param 1; expected :$pseudo-variable ... Sep 23 10:21:09 [555] ERROR:core:fix_actions: fixing failed (code=-1) at cfg line 311 Sep 23 10:21:09 [555] ERROR:core:main: failed to fix configuration with err code -1
-----Original Message----- From: Daniel-Constantin Mierla [mailto:miconda@gmail.com] Sent: 2008-09-23 12:22 To: Ali Jawad Cc: users Subject: Re: [Kamailio-Users] Question about redirect if user is not online
Hello,
On 09/23/08 12:07, Ali Jawad wrote:
Hi Thanks for your suggestion
I did enter the username and the mobile number into the
usr_preferences
table and tried the below
####### AVPOPS Section
modparam("avpops","avp_url","mysql://openser:xyxyxy@xxxxxxxxxxxx/openser
") modparam("avpops","avp_table","usr_preferences")
In the route statement I did add
if(avp_db_load("$ruri/username","s:callfwd")){ avp_pushto("$ruri","s:callfwd"); route(8); exit; };
I got this error
Sep 23 09:21:03 [340] ERROR:avpops:parse_avp_db: error - bad avp flags Sep 23 09:21:03 [340] ERROR:avpops:fixup_db_avp: parse failed Sep 23 09:21:03 [340] ERROR:core:fix_actions: fixing failed (code=-1) at cfg line 307 Sep 23 09:21:03 [340] CRITICAL:core:fix_expr: fix_actions
error
Did I miss anything >?
it should be:
if(avp_db_load("$ruri/username","$avp(s:callfwd)")){ avp_pushto("$ruri","$avp(s:callfwd)"); route(8); exit; };
insetead of avp_pushto("$ruri","$avp(s:callfwd)") you can do: $ru = $avp(s:callfwd);
I assume $avp(s:callfwd) has a complete sip uri as value, if it is just the number, then use:
avp_pushto("$ruri/username","$avp(s:callfwd)");
or
$rU = $avp(s:callfwd);
Cheers, Daniel
-----Original Message----- From: Daniel-Constantin Mierla [mailto:miconda@gmail.com] Sent: 2008-09-23 11:53 To: Ali Jawad Cc: users Subject: Re: [Kamailio-Users] Question about redirect if user is not online
Hello,
On 09/22/08 16:16, Ali Jawad wrote:
Hi I got the below fixed, however I do need to achieve something else as
well. When I forward the call to asterisk I need asterisk to forward it in turn to my cellphone number. Where an how should I re-write the
DID number of my SIP packet that acts as the destination URI to my cell phone number.
to be sure I understand your needs, if the user is not online, you
want
to send the call to user's mobile.
Perhaps you already have the mobile number in some table in database. You can use avp_db_query() to load it in an AVP (see avpops module for
more).
avp_db_query("select __gsm_number__ from __your_table__ where username='$rU'", "$avp(s:gsm_number)");
if(is_avp_set("$avp(s:gsm_number)")) { $rU = $avp(s:gsm_number); $rd = "__your_pstn_gw_ip__"; t_relay(); exit; }
Hope it helps, Daniel
Hello,
can you doublce check the second parameter of avp_pushto() is $avp(s:callfwd)?
Cheers, Daniel
On 09/23/08 12:26, Ali Jawad wrote:
Hi Thanks for the help and insight so far.
I did try your corrected version and I got this error:
Sep 23 10:21:09 [555] ERROR:avpops:fixup_pushto_avp: bad param 1; expected :$pseudo-variable ... Sep 23 10:21:09 [555] ERROR:core:fix_actions: fixing failed (code=-1) at cfg line 311 Sep 23 10:21:09 [555] ERROR:core:main: failed to fix configuration with err code -1
-----Original Message----- From: Daniel-Constantin Mierla [mailto:miconda@gmail.com] Sent: 2008-09-23 12:22 To: Ali Jawad Cc: users Subject: Re: [Kamailio-Users] Question about redirect if user is not online
Hello,
On 09/23/08 12:07, Ali Jawad wrote:
Hi Thanks for your suggestion
I did enter the username and the mobile number into the
usr_preferences
table and tried the below
####### AVPOPS Section
modparam("avpops","avp_url","mysql://openser:xyxyxy@xxxxxxxxxxxx/openser
") modparam("avpops","avp_table","usr_preferences")
In the route statement I did add
if(avp_db_load("$ruri/username","s:callfwd")){ avp_pushto("$ruri","s:callfwd"); route(8); exit; };
I got this error
Sep 23 09:21:03 [340] ERROR:avpops:parse_avp_db: error - bad avp flags Sep 23 09:21:03 [340] ERROR:avpops:fixup_db_avp: parse failed Sep 23 09:21:03 [340] ERROR:core:fix_actions: fixing failed (code=-1) at cfg line 307 Sep 23 09:21:03 [340] CRITICAL:core:fix_expr: fix_actions
error
Did I miss anything >?
it should be:
if(avp_db_load("$ruri/username","$avp(s:callfwd)")){ avp_pushto("$ruri","$avp(s:callfwd)"); route(8); exit; };
insetead of avp_pushto("$ruri","$avp(s:callfwd)") you can do: $ru = $avp(s:callfwd);
I assume $avp(s:callfwd) has a complete sip uri as value, if it is just the number, then use:
avp_pushto("$ruri/username","$avp(s:callfwd)");
or
$rU = $avp(s:callfwd);
Cheers, Daniel
-----Original Message----- From: Daniel-Constantin Mierla [mailto:miconda@gmail.com] Sent: 2008-09-23 11:53 To: Ali Jawad Cc: users Subject: Re: [Kamailio-Users] Question about redirect if user is not online
Hello,
On 09/22/08 16:16, Ali Jawad wrote:
Hi I got the below fixed, however I do need to achieve something else as
well. When I forward the call to asterisk I need asterisk to forward it in turn to my cellphone number. Where an how should I re-write the
DID number of my SIP packet that acts as the destination URI to my cell phone number.
to be sure I understand your needs, if the user is not online, you
want
to send the call to user's mobile.
Perhaps you already have the mobile number in some table in database. You can use avp_db_query() to load it in an AVP (see avpops module for
more).
avp_db_query("select __gsm_number__ from __your_table__ where username='$rU'", "$avp(s:gsm_number)");
if(is_avp_set("$avp(s:gsm_number)")) { $rU = $avp(s:gsm_number); $rd = "__your_pstn_gw_ip__"; t_relay(); exit; }
Hope it helps, Daniel
Hello,
On 09/22/08 16:14, Ali Jawad wrote:
Hi All
I do forward calls to a DID number to my openser box, if my softphone is online it rings directly because I am using the DID number as an alias. However I want the call to be forwarded to my asterisk box if the user is not online. What statement should I use ?
after doing lookup("location"), on the false branch rewrite the domain part of R-URI with the IP address of the asterisk box and relay.
Cheers, Daniel
THanks
With Regards
Ali Jawad
System Administrator
Splendor Telecom (www.splendor.net)
Beirut, Lebanon
Phone: +961 1 373725
Fax: + 961 1 375554
Users mailing list Users@lists.kamailio.org http://lists.kamailio.org/cgi-bin/mailman/listinfo/users