chuky,
have you copied the "ciapalo" file at its place? Is it in your configuration? Its the place written in configuration the same place where you copied it? It is executable by the user that executes asterisk?
In the mean time, I would suggest you read a book on Linux and linux administration, it will give you a lot of information that is needed if you want to deal with asterisk and co. This not to say I don't like to answer questions, but just because seems reading it would be very useful to you.
Thanks for the response. I am actually a little offended by your response. As a matter of fact I just finished a 5 day linux training last week, and left Linux+ Certified. Not only did I complete the training, I finished top of the class, and passed the test with a 875 of 900. I actually have 8 years of linux administration, and took this coarse simply as a way to fill in some learning gaps that are created when one has learned simply from experience, and to finally take the test to have proof on my resume of my experience.
When I post a message I do so only after exhausting other possibilites. Secondly, I see it as a why to save many hours of troubleshooting as someone else may have had the same issue.
Lastly, I always approach receiving help from forum users with complete naiveté, I have found that this produces the best results, as there is no need to 'flex' my muscles when asking for help.
However, I can see where you would have gathered this from my posts, and understand where you are coming from.
That said, yes I have ensured all permissions are correct, that it is executable, and executable by the user running asterisk (asterisk in my case), it is in the same location specified in the celliax.conf config file.
Is there any logging being done that you are aware of that would show what is happening when celliax tries to pass the file to ciapalo?
Currently with debugging turned on and set to 100, I do show a notice (in yellow) when it passes the file to ciaplo, but it looks just fine. (other than a couple of unreadable characters that I have been attributing to no UTF8 support, which I have'nt verified yet, but in any case should not hinder its ability to pass the file onto ciaplo.
I deeply apologize for having offended you, it was absolutely not in my intentions. Probably just the shortness of the report and the "bona fide" of your approach made me think you was a beginner in linux (there is no bad in being a beginner) and that an introduction to linux could be of help.
I really really apologize for offending you: sorry.
The characters that does not appears are exactly utf8, as you said, and are not displayed in console for the limitations of the console itself, but would be written correctly on the file in /tmp.
Is the file working if you send it something from command line?
I through 7777 at it, but it was giving an error that it did not like that the whole world could write to the script.
Now that that is straightened out! Any sugestions on how to grab the phone number and message into variables? There doesnt seem to be any identifying aspects about the string that I can use to que a grep.
It wrote the following:
---REC UNREAD|||---|||---00310038003100350037003100380035003000380039|||---1815XXXXXXX|||---10/01/28,09:26:08-24|||---ကĨ ☀ࠤ|||---004300720061007A00790020006200690074006300680021|||---Hello World|||
I would like to modify the perl script to not only to append to smses_received, but to also put the from phone number and message content into variables, and validate the information, and execute another program.
I WILL tell you I am a PERL noobie!!!!
I guess I will have to count the delimiter "---" and "|||" to find the feild I want.
I will do some reading and find out what I can do, I guess its time to learn perl. But suggestions are always welcome! :)
Please dont hate me, but how do I get the variable to INCLUDE the \ character, because it normally means do not process the next character. This is what I have:
This works, but only sends the First word in a txt. I know this is newbie stuff, but im not sure if its even possible. Maybe I have to add to string together with . or something like that......hmmm
Would it work to do something like this?
System ('asterisk -rx \"celliax_sendsms line0/' . $word[3] . '\"Good Password\"\"');
No sms output file?
From what I can gather it should be calling the /usr/sbin/caipalo script which outputs the file to /tmp/smses_received
However, nothing is being outputed, the asterisk cli is showing its receiving the message. What could be wrong?
SMS output
chuky,
have you copied the "ciapalo" file at its place? Is it in your configuration? Its the place written in configuration the same place where you copied it? It is executable by the user that executes asterisk?
In the mean time, I would suggest you read a book on Linux and linux administration, it will give you a lot of information that is needed if you want to deal with asterisk and co. This not to say I don't like to answer questions, but just because seems reading it would be very useful to you.
Have gone through all possiblities.
gmaruzz,
Thanks for the response. I am actually a little offended by your response. As a matter of fact I just finished a 5 day linux training last week, and left Linux+ Certified. Not only did I complete the training, I finished top of the class, and passed the test with a 875 of 900. I actually have 8 years of linux administration, and took this coarse simply as a way to fill in some learning gaps that are created when one has learned simply from experience, and to finally take the test to have proof on my resume of my experience.
When I post a message I do so only after exhausting other possibilites. Secondly, I see it as a why to save many hours of troubleshooting as someone else may have had the same issue.
Lastly, I always approach receiving help from forum users with complete naiveté, I have found that this produces the best results, as there is no need to 'flex' my muscles when asking for help.
However, I can see where you would have gathered this from my posts, and understand where you are coming from.
That said, yes I have ensured all permissions are correct, that it is executable, and executable by the user running asterisk (asterisk in my case), it is in the same location specified in the celliax.conf config file.
Is there any logging being done that you are aware of that would show what is happening when celliax tries to pass the file to ciapalo?
Currently with debugging turned on and set to 100, I do show a notice (in yellow) when it passes the file to ciaplo, but it looks just fine. (other than a couple of unreadable characters that I have been attributing to no UTF8 support, which I have'nt verified yet, but in any case should not hinder its ability to pass the file onto ciaplo.
Thank you for any help you can provide,
Adam
SMS output 2
Dear Adam,
I deeply apologize for having offended you, it was absolutely not in my intentions. Probably just the shortness of the report and the "bona fide" of your approach made me think you was a beginner in linux (there is no bad in being a beginner) and that an introduction to linux could be of help.
I really really apologize for offending you: sorry.
The characters that does not appears are exactly utf8, as you said, and are not displayed in console for the limitations of the console itself, but would be written correctly on the file in /tmp.
Is the file working if you send it something from command line?
eg:
echo "ciao"| /usr/local/asterisk14/sbin/ciapalo
Also, can you verify that the asterisk user can execute it (not a permission level, but as a user - maybe it has no shell or whatever other problem):
su root
su - asterisk
echo "ciao"| /usr/local/asterisk14/sbin/ciapalo
We'll found the problem! :)
-giovanni
-bash: !": event not found
Giovanni,
No problem, I by no means feel that I am an expert either. Hence my asking for help, :)
When executing echo "Hello World" | /usr/sbin/ciapalo
I receive
-bash: !": event not found
I will go through the program to see if I am missing something in the script, or if I am missing something in my bash.
However, any suggestions are welcome.
Adam
SMS output 3
maybe you just have perl installed in another location, or no perl....
It does look like it is a
It does look like it is a permissions problem........*doh*
Let me hash this out and I will repost my results.
Yes, it was permissions. I
Yes, it was permissions.
I through 7777 at it, but it was giving an error that it did not like that the whole world could write to the script.
Now that that is straightened out! Any sugestions on how to grab the phone number and message into variables? There doesnt seem to be any identifying aspects about the string that I can use to que a grep.
SMS output 4
Happy to know it now works for you.
maybe I don't get this new question. What it write to the file?
Grabbing info from file
It wrote the following:
---REC UNREAD|||---|||---00310038003100350037003100380035003000380039|||---1815XXXXXXX|||---10/01/28,09:26:08-24|||---ကĨ ☀ࠤ|||---004300720061007A00790020006200690074006300680021|||---Hello World|||
I would like to modify the perl script to not only to append to smses_received, but to also put the from phone number and message content into variables, and validate the information, and execute another program.
I WILL tell you I am a PERL noobie!!!!
I guess I will have to count the delimiter "---" and "|||" to find the feild I want.
I will do some reading and find out what I can do, I guess its time to learn perl. But suggestions are always welcome! :)
Adam
SMS output 5
Yes, you will have to find wjhat you want and put it in variables, then you can use them
I'll post here an example in some minutes...
How to have incoming SMSs splitted in fields
You can test this one, and adapt it to your needs.
#!/usr/bin/perl
open(FILEOUT, ">> /tmp/smses_received");
while(<>){
print FILEOUT $_ ;
printf FILEOUT "\n" ;
chomp();
@word = split /\|\|\|---/ ;
printf FILEOUT "NUMBER: ";
print FILEOUT $word[3];
printf FILEOUT "\n";
printf FILEOUT "DATE: ";
print FILEOUT $word[4];
printf FILEOUT "\n";
$word[7] =~ s/\|\|\|//g;
printf FILEOUT "TEXT: ";
print FILEOUT $word[7];
printf FILEOUT "\n";
printf FILEOUT "\n";
printf FILEOUT "\n";
}
close(FILEOUT);
SMS Perl Outputs
Great!
Thanks for the example. This will help me greatly in learning how to script with perl!
I really do appreciate your time.
Nice words, thanks
Thanks for your words, very well received!
CelliaxSendsms() from a shell
Any suggestion on how to call CelliaxSendsms() from a shell?
how to send SMS from shell
can I counseil you the Asterisk book from O'Reilly? :)
you can call:
/usr/local/asterisk/sbin/asterisk -rx "celliax_sendsms interface_name receiver_number \"Text of the SMS\""
That is exactly what I was
That is exactly what I was doing, but didnot correlate celliax_sendsms with CelliaxSendsms()
Makes sense. Thanks!
Please dont hate me
Please dont hate me, but how do I get the variable to INCLUDE the \ character, because it normally means do not process the next character. This is what I have:
#!/usr/bin/perl
open(FILEOUT, "> /tmp/smses_received");
while(<>){
print FILEOUT $_ ;
printf FILEOUT "\n" ;
chomp();
@word = split /\|\|\|---/;
printf FILEOUT "NUMBER: ";
print FILEOUT $word[3];
printf FILEOUT "\n";
printf FILEOUT "DATE: ";
print FILEOUT $word[4];
printf FILEOUT "\n";
$word[7] =~ s/\|\|\|//g;
printf FILEOUT "TEXT: ";
print FILEOUT $word[7];
printf FILEOUT "\n";
printf FILEOUT "\n";
printf FILEOUT "\n";
}
close(FILEOUT);
$startcmd = "/usr/activate_relay/activate_relay 1 0";
$goodtxt = "asterisk -rx "celliax_sendsms line0/$word[3] \"Good Password\"\"";
$badtxt = "asterisk -rx "celliax_sendsms line0/$word[3] \"Bad Password\"\"";
if ($word[7] == 1234){
system($startcmd);
system($startcmd);
system($startcmd);
system($goodtxt);
} else {
system($badtxt);
This works, but only sends the First word in a txt. I know this is newbie stuff, but im not sure if its even possible. Maybe I have to add to string together with . or something like that......hmmm
Would it work to do something like this?
System ('asterisk -rx \"celliax_sendsms line0/' . $word[3] . '\"Good Password\"\"');
no hate at all :)
Adam,
I don't hate you in the little.
But this is becoming to be a consulting gig, that's happens to be my job, the job that's paying the bills for me ;).
Sorry, I'm sure you can find a lot of information about programming and administering around the net, I cannot use my time for free for this.
I'm sure you understand me.