In sms_at.c, the following function looks not make the good thing :

static int at2_login_device(PrivAT2data *privdata)
{
    info(0, "AT2[%s]: Logging in", octstr_get_cstr(privdata->name));

    at2_read_buffer(privdata, 0);
    gwthread_sleep(0.5);
    at2_read_buffer(privdata, 0);

    if((octstr_len(privdata->username) == 0 ) &&
(octstr_len(privdata->password)> 0)) {
        at2_wait_modem_command(privdata, 10, 3, NULL);  /* wait for
Password: prompt */
        at2_send_modem_command(privdata,
octstr_get_cstr(privdata->password), 2,0); /* wait for OK: */
        at2_send_modem_command(privdata, "AT", 2,0); /* wait for OK: */
    }
    else if((octstr_len(privdata->username) > 0 ) &&
(octstr_len(privdata->password)> 0)) {
        at2_wait_modem_command(privdata, 10, 2, NULL);  /* wait for Login:
prompt */
        at2_send_modem_command(privdata,
octstr_get_cstr(privdata->username), 10,3); /* wait fo Password: */
        at2_send_modem_command(privdata,
octstr_get_cstr(privdata->password), 2,0); /* wait for OK: */
        at2_send_modem_command(privdata, "AT", 2,0); /* wait for OK: */
    }

    return 0;
}

In my case the telnet device is the 'else if' case, looking first for a
carriage return then the login prompt, then the password prompt and then
send the first 'AT'. For an unknown reason, it send the first 'AT4 too
early.

Soes someone got idea of modification to be made ?

thanks

-----Original Message-----
From: users-boun...@kannel.org [mailto:users-boun...@kannel.org] On Behalf
Of info.ubichip
Sent: mercredi 17 février 2010 22:07
To: 'Alvaro Cornejo'; users@kannel.org
Subject: RE: Telnet device

 Hello all,

Just to make an update, I still got my two issues. It appears the modem
generated a carriage return before the login string 'username:', it should
disturb the login process. If someone got any clue or idea to make
modification ?

The ^M looks not working as well to insert a carriage return in the
different init-string. Does anyone have been got similar need to integrate
with telnet device or so ?

Thanks in advance

-----Original Message-----
From: users-boun...@kannel.org [mailto:users-boun...@kannel.org] On Behalf
Of info.ubichip
Sent: mardi 16 février 2010 22:00
To: 'Alvaro Cornejo'
Cc: users@kannel.org
Subject: RE: Telnet device

Yes, I tried it but it looks I got issue before because the login/password
is not filled in the protocol. I was wondering if something is not well
implemented in the telnet dialogue. Do you have any clue on this before ?

>> 2010-02-15 13:43:50 [32013] [8] INFO: AT2[portech]: opening device
>> 2010-02-15 13:43:50 [32013] [8] DEBUG: Connecting to <192.168.1.121>
>> 2010-02-15 13:43:50 [32013] [8] DEBUG: AT2[portech]: device opened.
>> Telnet mode = 1
>> 2010-02-15 13:43:50 [32013] [8] DEBUG: AT2[portech]: --> ^M
>> 2010-02-15 13:43:52 [32013] [8] DEBUG: AT2[portech]: --> AT^M
>> 2010-02-15 13:43:57 [32013] [8] DEBUG: AT2[portech]: <-- username: AT
>> 2010-02-15 13:44:03 [32013] [8] DEBUG: AT2[portech]: --> AT^M
>> 2010-02-15 13:44:08 [32013] [8] DEBUG: AT2[portech]: <-- password: **
>> 2010-02-15 13:44:08 [32013] [8] DEBUG: AT2[portech]: <-- bad username

The 'username:' string is not recognize, I took a look on hte source code in
smsc_at.c but there is nothing that could explain that.


 

-----Original Message-----
From: Alvaro Cornejo [mailto:cornejo.alv...@gmail.com]
Sent: mardi 16 février 2010 20:57
To: info.ubichip
Cc: users@kannel.org
Subject: Re: Telnet device

Did you tried "^M"  carret char plus M char ?? This is a sort of character
representation of a carriage return...

Regards

Alvaro

On Tue, Feb 16, 2010 at 5:01 PM, info.ubichip <info.ubic...@free.fr> wrote:
> In this modem, you could have both in the same telnet session, you 
> just have to tell to the modem to go in the AT mode, which is done by 
> entering the command 'module' and then we are in full AT command.
>
> So I got two issues :
>        - first to tell kannel to connect to it with the correct 
> login/password which looks to be not the cas
>        - second, I have to tell the modem to go in the AT mode, which 
> I assume I could do it by passing the command in the init-string of 
> the modem (as soon as the init-string accept the carriage return).
>
> If you have any tricks to help me for the first point ?
>
> Thanks in advance
>
> -----Original Message-----
> From: Alvaro Cornejo [mailto:cornejo.alv...@gmail.com]
> Sent: mardi 16 février 2010 11:02
> To: info.ubichip
> Cc: users@kannel.org
> Subject: Re: Telnet device
>
> I don´t know your modem, but in the cases I know, port 23 is for 
> managing the modem configs and such.
>
> For using AT interface they usually use a different port. with the 
> same Telnet protocol... something like Telnet host:2100
>
> Regards
>
> |---------------------------------------------------------------------
> |------
> --------------------------------------|
> Envíe y Reciba Datos y mensajes de Texto (SMS) hacia y desde cualquier 
> celular y Nextel en el Perú, México y en mas de 180 paises. Use 
> aplicaciones
> 2 vias via SMS y GPRS online
>              Visitenos en www.perusms.NET www.smsglobal.com.mx y 
> www.pravcom.com
>
>
>
> On Tue, Feb 16, 2010 at 1:06 PM, info.ubichip <info.ubic...@free.fr>
wrote:
>> Hello,
>>
>> Does someone got similar issue ?
>>
>> Regards
>>
>>
>> -----Original Message-----
>> From: users-boun...@kannel.org [mailto:users-boun...@kannel.org] On 
>> Behalf Of info.ubichip
>> Sent: lundi 15 février 2010 13:49
>> To: users@kannel.org
>> Subject: Using Portech modem
>>
>> Hello All,
>>
>> I would like to use a portech GSM gateway MV-370 on a kannel 1.4.3 
>> version, I'm able to send basic sms by hand using telnet as the 
>> following
> example :
>>
>> Telnet 192.168.1.121
>>
>> username:voip
>> password:****
>> User level = admin
>>
>> Command : logout,module,module1,module2
>>>module
>> Getting module 1..
>> Got!! Press 'ctrl-x' to release module 1.
>>
>> at+cmgf=1
>> OK
>> At+cmgs="1122334455"
>>>test
>> +CMGS:30
>>
>>
>> So I make a configuration in kannel as follow :
>> group = smsc
>> smsc = at
>> smsc-id = portech
>> allowed-smsc-id = portech
>> log-level = 0
>> log-file = "/var/log/kannel/portech.log"
>> device = telnet
>> host = 192.168.1.121
>> port = 23
>> login-prompt = "username:"
>> password-prompt = "password:"
>> smsc-username = "voip"
>> smsc-password = "1234"
>> modemtype = portech
>> validityperiod = 172
>> keepalive = 10
>> my-number = 0012345678
>> sim-buffering = true
>>
>>
>> I got the following error, it is like the telnet session is not 
>> initialized correctly :
>>
>> 2010-02-15 13:43:50 [32013] [8] INFO: AT2[portech]: trying to use 
>> speed <115200> from modem definition
>> 2010-02-15 13:43:50 [32013] [8] INFO: AT2[portech]: opening device
>> 2010-02-15 13:43:50 [32013] [8] DEBUG: Connecting to <192.168.1.121>
>> 2010-02-15 13:43:50 [32013] [8] DEBUG: AT2[portech]: device opened.
>> Telnet mode = 1
>> 2010-02-15 13:43:50 [32013] [8] DEBUG: AT2[portech]: --> ^M
>> 2010-02-15 13:43:52 [32013] [8] DEBUG: AT2[portech]: --> AT^M
>> 2010-02-15 13:43:57 [32013] [8] DEBUG: AT2[portech]: <-- username: AT
>> 2010-02-15 13:44:03 [32013] [8] DEBUG: AT2[portech]: --> AT^M
>> 2010-02-15 13:44:08 [32013] [8] DEBUG: AT2[portech]: <-- password: **
>> 2010-02-15 13:44:08 [32013] [8] DEBUG: AT2[portech]: <-- bad username 
>> or password!!!
>> 2010-02-15 13:44:08 [32013] [8] DEBUG: AT2[portech]: <-- exit...
>> 2010-02-15 13:44:12 [32013] [8] DEBUG: AT2[portech]: --> AT^M
>> 2010-02-15 13:44:21 [32013] [8] INFO: AT2[portech]: Closing device
>> 2010-02-15 13:44:21 [32013] [8] INFO: AT2[portech]: speed in modem 
>> definition don't work, will autodetect
>>
>>
>> Does someone got similar issue with this type of modem ?
>>
>> My second question is : as you could see after the telnet connection, 
>> I have to specify the command 'module' to get full access to the AT 
>> command of the modem, does there is a way to put it in the 
>> init-string in the modem definition ? If yes how to send a carriage 
>> return in the init-string parameter (I have already some AT+CNMI....'
>> command to
> process.
>>
>>
>> Thanks in advance for your help
>>
>>
>>
>>
>>
>>
>>
>
>



-- 
|-----------------------------------------------------------------------
|----
--------------------------------------|
Envíe y Reciba Datos y mensajes de Texto (SMS) hacia y desde cualquier
celular y Nextel en el Perú, México y en mas de 180 paises. Use aplicaciones
2 vias via SMS y GPRS online
              Visitenos en www.perusms.NET www.smsglobal.com.mx y
www.pravcom.com






Reply via email to