Re: [Users] Mbuni try to send POST MMS before GPRS connection is established

2010-08-05 Thread Emmanuel CHANSON
Wil try this advise.

Many thanks Piotr for your help, you sort me out from a big issue.

Regards,

Emmanuel

2010/8/5 Piotr Isajew p...@ex.com.pl

 With settings similar to yours I get the behaviour when mbuni sends
 everything that is queued and then disconnects. Maybe if you patch
 mmsbox_mm1.c to add a 2 second sleep at end of inner loop in
 handle_mm1 function that will solve your problem.

 On Thu, Aug 05, 2010 at 02:55:16PM +1100, Emmanuel CHANSON wrote:
  Yes, by default mmsbox.conf has the following config:
 
  group = mbuni
  storage-directory = /var/spool/mbuni
  max-send-threads = 5
  maximum-send-attempts = 50
  default-message-expiry = 36
  queue-run-interval = 5
  send-attempt-back-off = 300
  sendmms-port = 10001
 
  max-send-threads set to 5 but Mbuni connect and disconnect for each MMS
 
  If this is normal behavior of Mbuni, need to check for a patch or a
 script
  that handle pppd
 
  Emmanuel
 
  2010/8/5 Piotr Isajew p...@ex.com.pl
 
   On Thu, Aug 05, 2010 at 04:59:59AM +0200, Emmanuel CHANSON wrote:
I forgot to add
   
/sbin before 'ip route' in ip-up script, now it is Ok
   
Things is Mbuni connect to GPRS, send the MMS and disconnect just
 after
although a second MMS has to be sent, reconnect, send it and
 disconnect?
  
   have you tried to set max-send-threads to something greater than 1?
  
   Also take a look at queue-run-interval and send-attempt-back-off
   settings.
  
   
Is it a normal behavior ? or is it possible to keep the ppp0 open and
   send
all MMS stored in spool before closing it ?
  
   You can always play with gprs-on and pid stuff; that would include
   setting idle timer in pppd and playing somehow with pids you pass to
   mbuni (you would need to create a kind of shielding script that
   manages pppd and ignores SIGTERM's from mbuni)
  
  
  
  
   
Many thanks Piotr for your support, you helped me to solve this :)
   
I plan to developp a web interface that can use mbuni to send MMS.
   
BR,
   
Emmanuel
   
2010/8/5 Piotr Isajew p...@ex.com.pl
   
 On Thu, Aug 05, 2010 at 01:29:24PM +1100, Emmanuel CHANSON wrote:
  Yeah, thanks Piotr,
 
  It seems better using 'nodetach', mbuni does not block anymore
 but
   retry
 to
  send MMS
  but I have an issue with routing to reach MMS-C, when pppd is
   established
 it
  should set the route in ip-up script: ip route to 192.168.39.201
 dev
   ppp0
 I
  guess?
  Can I use route add -host 192.168.39.201 gw ppp...@10.152.149.196
   show
  below somewhere ?

 Sure. In basic configuration I used /sbin/route add -host $PROXY
 dev
 ppp0 in ip-up, but for me proxy was directly reachable from IP
 assigned by pppd. You may need to use 192.168.254.254 as gateway
 here.
 
  #!/bin/sh
  IFNAME=$1
  LOCAL_IP=$4
  REMOTE_IP=$5
  IPPARAM=$6
  *MMS_PROXY=192.168.39.201
  ip route add to $MMS_PROXY dev $IFNAME*
  # routing has been set up, so:
  ln -sf /var/run/ppp0.pid /var/run/ppp0-mbuni.pid
 
 
  but I saw in the netstat -rn output (stay few second): coming
 from
   pppd
  process?
  *192.168.254.254 0.0.0.0 255.255.255.255 UH0 0
  0
  ppp0
 
  # cat /etc/ppp/peers/options-mobile
  *ttyACM1
  115200
  lock
  crtscts
  modem
  passive
  novj
  nodefaultroute
  nodetach
  noipdefault
  usepeerdns
  noauth
  hide-password
  persist
  holdoff 10
  maxfail 0
  debug*
 
  *
  mmsbox.log:
  --
  2010-08-05 13:15:35 [3941] [3] DEBUG: HTTP: Creating HTTPClient
 for
  `127.0.0.1'.
  2010-08-05 13:15:35 [3941] [3] DEBUG: HTTP: Created HTTPClient
 area
  0xb5900d20.
  2010-08-05 13:15:35 [3941] [14] DEBUG: WSP: Mapping `text/plain',
 WSP
   1.2
 to
  0x0003.
  2010-08-05 13:15:35 [3941] [14] INFO: mmsbox.c:1366
   make_and_queue_msg
  [mmsbox] [n/a] MMSBox: Queued message from service
 [sendmms-user],
 [transid
  [Mbuni-msg.4535.x2.41.34]: 6-qf4535.2.x941.9
  2010-08-05 13:15:35 [3941] [14] DEBUG: HTTP: Destroying
 HTTPClient
   area
  0xb5900d20.
  2010-08-05 13:15:35 [3941] [14] DEBUG: HTTP: Destroying
 HTTPClient
   for
  `127.0.0.1'.
  2010-08-05 13:15:35 [3941] [14] INFO: mmsbox.c:1613
 dispatch_sendmms_recv
  [mmsbox] [n/a] MMSBox.mmssend: u=tester, Queued [Accepted:
  Mbuni-msg.4535.x2.41.34]
  2010-08-05 13:15:37 [3941] [7] DEBUG: Queued to thread 1 for
  /var/spool/mbuni/mmsbox_outgoing/6/qf4535.2.x941.9,
 sendt=1280974535,
  tnow=1280974537
  arg 0: pppd
  arg 1: call
  arg 2: mobile-auth
 
 
  Script /usr/sbin/chat -v -t15 -f
   /etc/ppp/chatscripts/mobile-modem.chat
  finished (pid 4006), status = 0x5
  Connect script failed
 
 
  cat: /var/run/ppp0-mbuni.pid: Aucun fichier ou dossier de ce type
  

Re: [Users] Mbuni try to send POST MMS before GPRS connection is established

2010-08-04 Thread Emmanuel CHANSON
*Hello Piotr,

Still Mbuni does not want to wait after GPRS connection even with ip-up
script, do I miss something?

Following your advises I have configured:

in /etc/ppp/ip-up symlink to ip-up.sh:*
*#!/bin/sh

IFNAME=$1
LOCAL_IP=$4
REMOTE_IP=$5
IPPARAM=$6
MMS_PROXY=192.168.39.201

ip route add to $MMS_PROXY dev $IFNAME
# routing has been set up, so:
ln -sf /var/run/ppp-0.pid /var/run/ppp0-mbuni.pid
*


*Then in mmsbox.conf:*
*custom-settings = gprs-on=pppd call mobile-auth;gprs-pid=cat
/var/run/ppp0-mbuni.pid|head -1;port=3130;mmsc-url=
http://mms.xx.xx/mmsc;proxy=192.168.39.201:3130;msisdn=100*

*Intial ip routing:*
--
# ifconfig;netstat -rn

eth1  Link encap:Ethernet  HWaddr 00:16:E6:4E:0C:2B
  inet adr:192.168.0.2  Bcast:192.168.0.255  Masque:255.255.255.0
  adr inet6: fe80::216:e6ff:fe4e:c2b/64 Scope:Lien
  UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
  RX packets:1707 errors:0 dropped:0 overruns:0 frame:0
  TX packets:1589 errors:0 dropped:0 overruns:0 carrier:0

  collisions:0 lg file transmission:1000
  RX bytes:1445194 (1.3 MiB)  TX bytes:542026 (529.3 KiB)
  Interruption:20 Adresse de base:0x8000

loLink encap:Boucle locale
  inet adr:127.0.0.1  Masque:255.0.0.0
  adr inet6: ::1/128 Scope:Hôte
  UP LOOPBACK RUNNING  MTU:16436  Metric:1
  RX packets:210 errors:0 dropped:0 overruns:0 frame:0
  TX packets:210 errors:0 dropped:0 overruns:0 carrier:0

  collisions:0 lg file transmission:0
   RX bytes:17962 (17.5 KiB)  TX bytes:17962 (17.5 KiB)


Table de routage IP du noyau
Destination Passerelle  Genmask Indic   MSS Fenêtre irtt
Iface
 192.168.0.0 0.0.0.0 255.255.255.0   U 0 0  0
eth1
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0  0
eth1
0.0.0.0 192.168.0.1 0.0.0.0 UG0 0  0
eth1
#

*Then the test:*
# lynx -dump 
http://localhost:10003/?username=testerpassword=foobarmmsc=modemto=%2B/TYPE=PLMNsubject=Test-mediacomtext=TEST-MMS-depuis-MBUNI-2


*but mbuni still complain about:* (no pid file found if I translate)
*cat: /var/run/ppp0-mbuni.pid: Aucun fichier ou dossier de ce type
2010-08-05 08:36:11 [2580] [5] INFO: mmsbox_mm1.c:659 start_gprs
[mmsbox-mm1] [n/a] waiting for connection: 0, pid=2607 cpid=2607,
ifexited=1, exitstatus=0
2010-08-05 08:36:11 [2580] [5] WARNING: mmsbox_mm1.c:375 handle_mm1
[mmsbox-mm1] [n/a] failed to start GPRS connection. waiting...*


/var/log/mbuni/*log:

2010-08-05 08:23:53 [2403] [3] DEBUG: HTTP: Creating HTTPClient for
`127.0.0.1'.
2010-08-05 08:23:53 [2403] [3] DEBUG: HTTP: Created HTTPClient area
0xb57005b0.
2010-08-05 08:23:53 [2403] [14] DEBUG: WSP: Mapping `text/plain', WSP 1.2 to
0x0003.
2010-08-05 08:23:53 [2403] [14] INFO: mmsbox.c:1366 make_and_queue_msg
[mmsbox] [n/a] MMSBox: Queued message from service [sendmms-user], [transid
[Mbuni-msg.7033.x1.3.40]: qf7033.1.x403.79
2010-08-05 08:23:53 [2403] [14] DEBUG: HTTP: Destroying HTTPClient area
0xb57005b0.
2010-08-05 08:23:53 [2403] [14] DEBUG: HTTP: Destroying HTTPClient for
`127.0.0.1'.
2010-08-05 08:23:53 [2403] [14] INFO: mmsbox.c:1613 dispatch_sendmms_recv
[mmsbox] [n/a] MMSBox.mmssend: u=tester, Queued [Accepted:
Mbuni-msg.7033.x1.3.40]

2010-08-05 08:23:57 [2403] [7] DEBUG: Queued to thread 0 for
/var/spool/mbuni/mmsbox_
outgoing/qf7033.1.x403.79, sendt=1280957033, tnow=1280957037

arg 0: pppd
arg 1: call
arg 2: mobile-auth

cat: /var/run/ppp0.pid: Aucun fichier ou dossier de ce type
- Afficher le texte des messages précédents -
2010-08-05 08:24:02 [2403] [5] INFO: mmsbox_mm1.c:659 start_gprs
[mmsbox-mm1] [n/a] waiting for connection: 0, pid=2427 cpid=2427,
ifexited=1, exitstatus=0
2010-08-05 08:24:02 [2403] [5] WARNING: mmsbox_mm1.c:375 handle_mm1
[mmsbox-mm1] [n/a] failed to start GPRS connection. waiting...

/var/log/message:
--
Aug  5 08:23:57 navette kernel: PPP generic driver version 2.4.2
Aug  5 08:23:57 navette pppd[2430]: pppd 2.4.5 started by admin, uid 0
Aug  5 08:23:58 navette chat[2431]: abort on (BUSY)
Aug  5 08:23:58 navette chat[2431]: abort on (NO CARRIER)
Aug  5 08:23:58 navette chat[2431]: abort on (VOICE)
Aug  5 08:23:58 navette chat[2431]: abort on (NO DIALTONE)
Aug  5 08:23:58 navette chat[2431]: abort on (NO DIAL TONE)
Aug  5 08:23:58 navette chat[2431]: abort on (NO ANSWER)
Aug  5 08:23:58 navette chat[2431]: abort on (DELAYED)
Aug  5 08:23:58 navette chat[2431]: report (CONNECT)
Aug  5 08:23:58 navette chat[2431]: timeout set to 6 seconds
Aug  5 08:23:58 navette chat[2431]: send (ATQ0^M)
Aug  5 08:23:58 navette chat[2431]: expect (OK)
Aug  5 08:23:58 navette chat[2431]: ^M
Aug  5 08:23:58 navette chat[2431]: NO CARRIER
Aug  5 08:23:58 navette chat[2431]:  -- failed
Aug  5 08:23:58 navette chat[2431]: Failed (NO CARRIER)
Aug  5 08:23:58 navette pppd[2430]: Connect 

Re: [Users] Mbuni try to send POST MMS before GPRS connection is established

2010-08-04 Thread Piotr Isajew
Hi.

From what I see you miss the following options to pppd (unless they
are present in config file):

nodefaultroute
nodetach

nodetach is important here since it stops grps-on process from
quitting (pppd daemonizes) before it has a chance to set-up the
connection. Other way would be to provide a shell script for
gprs-on. A very simple example would be something like:

#!/bin/sh
pppd call your_mmsc
while [ ! -r /var/run/ppp0-mbuni.pid ]; do
 sleep 5
done
exit 0

When everything is correctly configured mbuni stops on SIGTERM and
SIGINT, so CTRL+C should work here. However you may need to check
your privilege set-up: pppd needs to be run with root privileges, so
it should be setuid root or run via sudo; mbuni tries to stop pppd by
sending SIGTERM with kill() call, and that means that in your
configuration mbuni should be run with root privileges too.


Hope that helps,

Piotr

On Thu, Aug 05, 2010 at 08:53:30AM +1100, Emmanuel CHANSON wrote:
 *Hello Piotr,
 
 Still Mbuni does not want to wait after GPRS connection even with ip-up
 script, do I miss something?
 
 Following your advises I have configured:
 
 in /etc/ppp/ip-up symlink to ip-up.sh:*
 *#!/bin/sh
 
 IFNAME=$1
 LOCAL_IP=$4
 REMOTE_IP=$5
 IPPARAM=$6
 MMS_PROXY=192.168.39.201
 
 ip route add to $MMS_PROXY dev $IFNAME
 # routing has been set up, so:
 ln -sf /var/run/ppp-0.pid /var/run/ppp0-mbuni.pid
 *
 
 
 *Then in mmsbox.conf:*
 *custom-settings = gprs-on=pppd call mobile-auth;gprs-pid=cat
 /var/run/ppp0-mbuni.pid|head -1;port=3130;mmsc-url=
 http://mms.xx.xx/mmsc;proxy=192.168.39.201:3130;msisdn=100*
 
 *Intial ip routing:*
 --
 # ifconfig;netstat -rn
 
 eth1  Link encap:Ethernet  HWaddr 00:16:E6:4E:0C:2B
   inet adr:192.168.0.2  Bcast:192.168.0.255  Masque:255.255.255.0
   adr inet6: fe80::216:e6ff:fe4e:c2b/64 Scope:Lien
   UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
   RX packets:1707 errors:0 dropped:0 overruns:0 frame:0
   TX packets:1589 errors:0 dropped:0 overruns:0 carrier:0
 
   collisions:0 lg file transmission:1000
   RX bytes:1445194 (1.3 MiB)  TX bytes:542026 (529.3 KiB)
   Interruption:20 Adresse de base:0x8000
 
 loLink encap:Boucle locale
   inet adr:127.0.0.1  Masque:255.0.0.0
   adr inet6: ::1/128 Scope:Hôte
   UP LOOPBACK RUNNING  MTU:16436  Metric:1
   RX packets:210 errors:0 dropped:0 overruns:0 frame:0
   TX packets:210 errors:0 dropped:0 overruns:0 carrier:0
 
   collisions:0 lg file transmission:0
RX bytes:17962 (17.5 KiB)  TX bytes:17962 (17.5 KiB)
 
 
 Table de routage IP du noyau
 Destination Passerelle  Genmask Indic   MSS Fenêtre irtt
 Iface
  192.168.0.0 0.0.0.0 255.255.255.0   U 0 0  0
 eth1
 169.254.0.0 0.0.0.0 255.255.0.0 U 0 0  0
 eth1
 0.0.0.0 192.168.0.1 0.0.0.0 UG0 0  0
 eth1
 #
 
 *Then the test:*
 # lynx -dump 
 http://localhost:10003/?username=testerpassword=foobarmmsc=modemto=%2B/TYPE=PLMNsubject=Test-mediacomtext=TEST-MMS-depuis-MBUNI-2
 
 
 *but mbuni still complain about:* (no pid file found if I translate)
 *cat: /var/run/ppp0-mbuni.pid: Aucun fichier ou dossier de ce type
 2010-08-05 08:36:11 [2580] [5] INFO: mmsbox_mm1.c:659 start_gprs
 [mmsbox-mm1] [n/a] waiting for connection: 0, pid=2607 cpid=2607,
 ifexited=1, exitstatus=0
 2010-08-05 08:36:11 [2580] [5] WARNING: mmsbox_mm1.c:375 handle_mm1
 [mmsbox-mm1] [n/a] failed to start GPRS connection. waiting...*
 
 
 /var/log/mbuni/*log:
 
 2010-08-05 08:23:53 [2403] [3] DEBUG: HTTP: Creating HTTPClient for
 `127.0.0.1'.
 2010-08-05 08:23:53 [2403] [3] DEBUG: HTTP: Created HTTPClient area
 0xb57005b0.
 2010-08-05 08:23:53 [2403] [14] DEBUG: WSP: Mapping `text/plain', WSP 1.2 to
 0x0003.
 2010-08-05 08:23:53 [2403] [14] INFO: mmsbox.c:1366 make_and_queue_msg
 [mmsbox] [n/a] MMSBox: Queued message from service [sendmms-user], [transid
 [Mbuni-msg.7033.x1.3.40]: qf7033.1.x403.79
 2010-08-05 08:23:53 [2403] [14] DEBUG: HTTP: Destroying HTTPClient area
 0xb57005b0.
 2010-08-05 08:23:53 [2403] [14] DEBUG: HTTP: Destroying HTTPClient for
 `127.0.0.1'.
 2010-08-05 08:23:53 [2403] [14] INFO: mmsbox.c:1613 dispatch_sendmms_recv
 [mmsbox] [n/a] MMSBox.mmssend: u=tester, Queued [Accepted:
 Mbuni-msg.7033.x1.3.40]
 
 2010-08-05 08:23:57 [2403] [7] DEBUG: Queued to thread 0 for
 /var/spool/mbuni/mmsbox_
 outgoing/qf7033.1.x403.79, sendt=1280957033, tnow=1280957037
 
 arg 0: pppd
 arg 1: call
 arg 2: mobile-auth
 
 cat: /var/run/ppp0.pid: Aucun fichier ou dossier de ce type
 - Afficher le texte des messages précédents -
 2010-08-05 08:24:02 [2403] [5] INFO: mmsbox_mm1.c:659 start_gprs
 [mmsbox-mm1] [n/a] waiting for connection: 0, pid=2427 cpid=2427,
 ifexited=1, exitstatus=0
 2010-08-05 08:24:02 [2403] [5] WARNING: mmsbox_mm1.c:375 handle_mm1
 [mmsbox-mm1] 

Re: [Users] Mbuni try to send POST MMS before GPRS connection is established

2010-08-04 Thread Emmanuel CHANSON
Yeah, thanks Piotr,

It seems better using 'nodetach', mbuni does not block anymore but retry to
send MMS
but I have an issue with routing to reach MMS-C, when pppd is established it
should set the route in ip-up script: ip route to 192.168.39.201 dev ppp0 I
guess?
Can I use route add -host 192.168.39.201 gw ppp0IP@ 10.152.149.196 show
below somewhere ?

#!/bin/sh
IFNAME=$1
LOCAL_IP=$4
REMOTE_IP=$5
IPPARAM=$6
*MMS_PROXY=192.168.39.201
ip route add to $MMS_PROXY dev $IFNAME*
# routing has been set up, so:
ln -sf /var/run/ppp0.pid /var/run/ppp0-mbuni.pid


but I saw in the netstat -rn output (stay few second): coming from pppd
process?
*192.168.254.254 0.0.0.0 255.255.255.255 UH0 0  0
ppp0

# cat /etc/ppp/peers/options-mobile
*ttyACM1
115200
lock
crtscts
modem
passive
novj
nodefaultroute
nodetach
noipdefault
usepeerdns
noauth
hide-password
persist
holdoff 10
maxfail 0
debug*

*
mmsbox.log:
--
2010-08-05 13:15:35 [3941] [3] DEBUG: HTTP: Creating HTTPClient for
`127.0.0.1'.
2010-08-05 13:15:35 [3941] [3] DEBUG: HTTP: Created HTTPClient area
0xb5900d20.
2010-08-05 13:15:35 [3941] [14] DEBUG: WSP: Mapping `text/plain', WSP 1.2 to
0x0003.
2010-08-05 13:15:35 [3941] [14] INFO: mmsbox.c:1366 make_and_queue_msg
[mmsbox] [n/a] MMSBox: Queued message from service [sendmms-user], [transid
[Mbuni-msg.4535.x2.41.34]: 6-qf4535.2.x941.9
2010-08-05 13:15:35 [3941] [14] DEBUG: HTTP: Destroying HTTPClient area
0xb5900d20.
2010-08-05 13:15:35 [3941] [14] DEBUG: HTTP: Destroying HTTPClient for
`127.0.0.1'.
2010-08-05 13:15:35 [3941] [14] INFO: mmsbox.c:1613 dispatch_sendmms_recv
[mmsbox] [n/a] MMSBox.mmssend: u=tester, Queued [Accepted:
Mbuni-msg.4535.x2.41.34]
2010-08-05 13:15:37 [3941] [7] DEBUG: Queued to thread 1 for
/var/spool/mbuni/mmsbox_outgoing/6/qf4535.2.x941.9, sendt=1280974535,
tnow=1280974537
arg 0: pppd
arg 1: call
arg 2: mobile-auth


Script /usr/sbin/chat -v -t15 -f /etc/ppp/chatscripts/mobile-modem.chat
finished (pid 4006), status = 0x5
Connect script failed


cat: /var/run/ppp0-mbuni.pid: Aucun fichier ou dossier de ce type
2010-08-05 13:15:42 [3941] [5] INFO: mmsbox_mm1.c:659 start_gprs
[mmsbox-mm1] [n/a] waiting for connection: 0, pid=4005 cpid=0, ifexited=1,
exitstatus=5
cat: /var/run/ppp0-mbuni.pid: Aucun fichier ou dossier de ce type
2010-08-05 13:15:47 [3941] [5] INFO: mmsbox_mm1.c:659 start_gprs
[mmsbox-mm1] [n/a] waiting for connection: 1, pid=4005 cpid=0, ifexited=1,
exitstatus=5
cat: /var/run/ppp0-mbuni.pid: Aucun fichier ou dossier de ce type
2010-08-05 13:15:52 [3941] [5] INFO: mmsbox_mm1.c:659 start_gprs
[mmsbox-mm1] [n/a] waiting for connection: 2, pid=4005 cpid=0, ifexited=1,
exitstatus=5
cat: /var/run/ppp0-mbuni.pid: Aucun fichier ou dossier de ce type
2010-08-05 13:15:57 [3941] [5] INFO: mmsbox_mm1.c:659 start_gprs
[mmsbox-mm1] [n/a] waiting for connection: 3, pid=4005 cpid=0, ifexited=1,
exitstatus=5
chat:  Aug 05 13:15:58 CONNECT
Script /usr/sbin/chat -v -t15 -f /etc/ppp/chatscripts/mobile-modem.chat
finished (pid 4014), status = 0x0
Serial connection established.
using channel 17
Using interface ppp0
Connect: ppp0 -- /dev/ttyACM1
rcvd [LCP ConfReq id=0x0 mru 1500 asyncmap 0xa auth pap]
sent [LCP ConfReq id=0x1 asyncmap 0x0 magic 0xe5cdc253 pcomp accomp]
sent [LCP ConfAck id=0x0 mru 1500 asyncmap 0xa auth pap]
rcvd [LCP ConfRej id=0x1 magic 0xe5cdc253 pcomp accomp]
sent [LCP ConfReq id=0x2 asyncmap 0x0]
rcvd [LCP ConfNak id=0x2 asyncmap 0xa]
sent [LCP ConfReq id=0x3 asyncmap 0xa]
rcvd [LCP ConfAck id=0x3 asyncmap 0xa]
sent [PAP AuthReq id=0x1 user=mms password=hidden]
rcvd [PAP AuthAck id=0x1 ]
PAP authentication succeeded
sent [CCP ConfReq id=0x1 deflate 15 deflate(old#) 15]
sent [IPCP ConfReq id=0x1 addr 0.0.0.0 ms-dns1 0.0.0.0 ms-dns2
0.0.0.0]
rcvd [LCP ProtRej id=0x1 80 fd 01 01 00 0c 1a 04 78 00 18 04 78 00]
Protocol-Reject for 'Compression Control Protocol' (0x80fd) received
rcvd [IPCP ConfReq id=0x2 addr 192.168.254.254]
sent [IPCP ConfAck id=0x2 addr 192.168.254.254]
rcvd [IPCP ConfNak id=0x1 addr 10.152.149.196 ms-dns1 0.0.0.0 ms-dns2
0.0.0.0]
sent [IPCP ConfReq id=0x2 addr 10.152.149.196 ms-dns1 0.0.0.0 ms-dns2
0.0.0.0]
rcvd [IPCP ConfRej id=0x2 ms-dns1 0.0.0.0 ms-dns2 0.0.0.0]
sent [IPCP ConfReq id=0x3 addr 10.152.149.196]
rcvd [IPCP ConfAck id=0x3 addr 10.152.149.196]
local  IP address 10.152.149.196
remote IP address 192.168.254.254
Script /etc/ppp/ip-up started (pid 4042)
Script /etc/ppp/ip-up finished (pid 4042), status = 0x0
2010-08-05 13:16:02 [3941] [5] INFO: mmsbox_mm1.c:379 handle_mm1
[mmsbox-mm1] [n/a] start_gprs returned PID: 4005
2010-08-05 13:16:02 [3941] [5] DEBUG: WSP: Mapping `text/plain', WSP 1.2 to
0x0003.
2010-08-05 13:16:05 [3941] [5] ERROR: mmsbox_mm1.c:628 fetch_content
[mmsbox-mm1] [n/a] failed to fetch/post content: couldn't connect to host
2010-08-05 13:16:05 [3941] [5] DEBUG: Octet string at 0xafb009c8:
2010-08-05 13:16:05 [3941] [5] DEBUG:   len:  0
2010-08-05 13:16:05 [3941] [5] DEBUG:   size: 

Re: [Users] Mbuni try to send POST MMS before GPRS connection is established

2010-08-04 Thread Emmanuel CHANSON
I forgot to add

/sbin before 'ip route' in ip-up script, now it is Ok

Things is Mbuni connect to GPRS, send the MMS and disconnect just after
although a second MMS has to be sent, reconnect, send it and disconnect?

Is it a normal behavior ? or is it possible to keep the ppp0 open and send
all MMS stored in spool before closing it ?

Many thanks Piotr for your support, you helped me to solve this :)

I plan to developp a web interface that can use mbuni to send MMS.

BR,

Emmanuel

2010/8/5 Piotr Isajew p...@ex.com.pl

 On Thu, Aug 05, 2010 at 01:29:24PM +1100, Emmanuel CHANSON wrote:
  Yeah, thanks Piotr,
 
  It seems better using 'nodetach', mbuni does not block anymore but retry
 to
  send MMS
  but I have an issue with routing to reach MMS-C, when pppd is established
 it
  should set the route in ip-up script: ip route to 192.168.39.201 dev ppp0
 I
  guess?
  Can I use route add -host 192.168.39.201 gw ppp0IP@ 10.152.149.196 show
  below somewhere ?

 Sure. In basic configuration I used /sbin/route add -host $PROXY dev
 ppp0 in ip-up, but for me proxy was directly reachable from IP
 assigned by pppd. You may need to use 192.168.254.254 as gateway here.
 
  #!/bin/sh
  IFNAME=$1
  LOCAL_IP=$4
  REMOTE_IP=$5
  IPPARAM=$6
  *MMS_PROXY=192.168.39.201
  ip route add to $MMS_PROXY dev $IFNAME*
  # routing has been set up, so:
  ln -sf /var/run/ppp0.pid /var/run/ppp0-mbuni.pid
 
 
  but I saw in the netstat -rn output (stay few second): coming from pppd
  process?
  *192.168.254.254 0.0.0.0 255.255.255.255 UH0 0  0
  ppp0
 
  # cat /etc/ppp/peers/options-mobile
  *ttyACM1
  115200
  lock
  crtscts
  modem
  passive
  novj
  nodefaultroute
  nodetach
  noipdefault
  usepeerdns
  noauth
  hide-password
  persist
  holdoff 10
  maxfail 0
  debug*
 
  *
  mmsbox.log:
  --
  2010-08-05 13:15:35 [3941] [3] DEBUG: HTTP: Creating HTTPClient for
  `127.0.0.1'.
  2010-08-05 13:15:35 [3941] [3] DEBUG: HTTP: Created HTTPClient area
  0xb5900d20.
  2010-08-05 13:15:35 [3941] [14] DEBUG: WSP: Mapping `text/plain', WSP 1.2
 to
  0x0003.
  2010-08-05 13:15:35 [3941] [14] INFO: mmsbox.c:1366 make_and_queue_msg
  [mmsbox] [n/a] MMSBox: Queued message from service [sendmms-user],
 [transid
  [Mbuni-msg.4535.x2.41.34]: 6-qf4535.2.x941.9
  2010-08-05 13:15:35 [3941] [14] DEBUG: HTTP: Destroying HTTPClient area
  0xb5900d20.
  2010-08-05 13:15:35 [3941] [14] DEBUG: HTTP: Destroying HTTPClient for
  `127.0.0.1'.
  2010-08-05 13:15:35 [3941] [14] INFO: mmsbox.c:1613
 dispatch_sendmms_recv
  [mmsbox] [n/a] MMSBox.mmssend: u=tester, Queued [Accepted:
  Mbuni-msg.4535.x2.41.34]
  2010-08-05 13:15:37 [3941] [7] DEBUG: Queued to thread 1 for
  /var/spool/mbuni/mmsbox_outgoing/6/qf4535.2.x941.9, sendt=1280974535,
  tnow=1280974537
  arg 0: pppd
  arg 1: call
  arg 2: mobile-auth
 
 
  Script /usr/sbin/chat -v -t15 -f /etc/ppp/chatscripts/mobile-modem.chat
  finished (pid 4006), status = 0x5
  Connect script failed
 
 
  cat: /var/run/ppp0-mbuni.pid: Aucun fichier ou dossier de ce type
  2010-08-05 13:15:42 [3941] [5] INFO: mmsbox_mm1.c:659 start_gprs
  [mmsbox-mm1] [n/a] waiting for connection: 0, pid=4005 cpid=0,
 ifexited=1,
  exitstatus=5
  cat: /var/run/ppp0-mbuni.pid: Aucun fichier ou dossier de ce type
  2010-08-05 13:15:47 [3941] [5] INFO: mmsbox_mm1.c:659 start_gprs
  [mmsbox-mm1] [n/a] waiting for connection: 1, pid=4005 cpid=0,
 ifexited=1,
  exitstatus=5
  cat: /var/run/ppp0-mbuni.pid: Aucun fichier ou dossier de ce type
  2010-08-05 13:15:52 [3941] [5] INFO: mmsbox_mm1.c:659 start_gprs
  [mmsbox-mm1] [n/a] waiting for connection: 2, pid=4005 cpid=0,
 ifexited=1,
  exitstatus=5
  cat: /var/run/ppp0-mbuni.pid: Aucun fichier ou dossier de ce type
  2010-08-05 13:15:57 [3941] [5] INFO: mmsbox_mm1.c:659 start_gprs
  [mmsbox-mm1] [n/a] waiting for connection: 3, pid=4005 cpid=0,
 ifexited=1,
  exitstatus=5
  chat:  Aug 05 13:15:58 CONNECT
  Script /usr/sbin/chat -v -t15 -f /etc/ppp/chatscripts/mobile-modem.chat
  finished (pid 4014), status = 0x0
  Serial connection established.
  using channel 17
  Using interface ppp0
  Connect: ppp0 -- /dev/ttyACM1
  rcvd [LCP ConfReq id=0x0 mru 1500 asyncmap 0xa auth pap]
  sent [LCP ConfReq id=0x1 asyncmap 0x0 magic 0xe5cdc253 pcomp
 accomp]
  sent [LCP ConfAck id=0x0 mru 1500 asyncmap 0xa auth pap]
  rcvd [LCP ConfRej id=0x1 magic 0xe5cdc253 pcomp accomp]
  sent [LCP ConfReq id=0x2 asyncmap 0x0]
  rcvd [LCP ConfNak id=0x2 asyncmap 0xa]
  sent [LCP ConfReq id=0x3 asyncmap 0xa]
  rcvd [LCP ConfAck id=0x3 asyncmap 0xa]
  sent [PAP AuthReq id=0x1 user=mms password=hidden]
  rcvd [PAP AuthAck id=0x1 ]
  PAP authentication succeeded
  sent [CCP ConfReq id=0x1 deflate 15 deflate(old#) 15]
  sent [IPCP ConfReq id=0x1 addr 0.0.0.0 ms-dns1 0.0.0.0 ms-dns2
  0.0.0.0]
  rcvd [LCP ProtRej id=0x1 80 fd 01 01 00 0c 1a 04 78 00 18 04 78 00]
  Protocol-Reject for 'Compression Control Protocol' (0x80fd) received
  rcvd [IPCP ConfReq id=0x2 addr 

Re: [Users] Mbuni try to send POST MMS before GPRS connection is established

2010-08-04 Thread Emmanuel CHANSON
Yes, by default mmsbox.conf has the following config:

group = mbuni
storage-directory = /var/spool/mbuni
max-send-threads = 5
maximum-send-attempts = 50
default-message-expiry = 36
queue-run-interval = 5
send-attempt-back-off = 300
sendmms-port = 10001

max-send-threads set to 5 but Mbuni connect and disconnect for each MMS

If this is normal behavior of Mbuni, need to check for a patch or a script
that handle pppd

Emmanuel

2010/8/5 Piotr Isajew p...@ex.com.pl

 On Thu, Aug 05, 2010 at 04:59:59AM +0200, Emmanuel CHANSON wrote:
  I forgot to add
 
  /sbin before 'ip route' in ip-up script, now it is Ok
 
  Things is Mbuni connect to GPRS, send the MMS and disconnect just after
  although a second MMS has to be sent, reconnect, send it and disconnect?

 have you tried to set max-send-threads to something greater than 1?

 Also take a look at queue-run-interval and send-attempt-back-off
 settings.

 
  Is it a normal behavior ? or is it possible to keep the ppp0 open and
 send
  all MMS stored in spool before closing it ?

 You can always play with gprs-on and pid stuff; that would include
 setting idle timer in pppd and playing somehow with pids you pass to
 mbuni (you would need to create a kind of shielding script that
 manages pppd and ignores SIGTERM's from mbuni)




 
  Many thanks Piotr for your support, you helped me to solve this :)
 
  I plan to developp a web interface that can use mbuni to send MMS.
 
  BR,
 
  Emmanuel
 
  2010/8/5 Piotr Isajew p...@ex.com.pl
 
   On Thu, Aug 05, 2010 at 01:29:24PM +1100, Emmanuel CHANSON wrote:
Yeah, thanks Piotr,
   
It seems better using 'nodetach', mbuni does not block anymore but
 retry
   to
send MMS
but I have an issue with routing to reach MMS-C, when pppd is
 established
   it
should set the route in ip-up script: ip route to 192.168.39.201 dev
 ppp0
   I
guess?
Can I use route add -host 192.168.39.201 gw ppp0IP@ 10.152.149.196
 show
below somewhere ?
  
   Sure. In basic configuration I used /sbin/route add -host $PROXY dev
   ppp0 in ip-up, but for me proxy was directly reachable from IP
   assigned by pppd. You may need to use 192.168.254.254 as gateway here.
   
#!/bin/sh
IFNAME=$1
LOCAL_IP=$4
REMOTE_IP=$5
IPPARAM=$6
*MMS_PROXY=192.168.39.201
ip route add to $MMS_PROXY dev $IFNAME*
# routing has been set up, so:
ln -sf /var/run/ppp0.pid /var/run/ppp0-mbuni.pid
   
   
but I saw in the netstat -rn output (stay few second): coming from
 pppd
process?
*192.168.254.254 0.0.0.0 255.255.255.255 UH0 0
0
ppp0
   
# cat /etc/ppp/peers/options-mobile
*ttyACM1
115200
lock
crtscts
modem
passive
novj
nodefaultroute
nodetach
noipdefault
usepeerdns
noauth
hide-password
persist
holdoff 10
maxfail 0
debug*
   
*
mmsbox.log:
--
2010-08-05 13:15:35 [3941] [3] DEBUG: HTTP: Creating HTTPClient for
`127.0.0.1'.
2010-08-05 13:15:35 [3941] [3] DEBUG: HTTP: Created HTTPClient area
0xb5900d20.
2010-08-05 13:15:35 [3941] [14] DEBUG: WSP: Mapping `text/plain', WSP
 1.2
   to
0x0003.
2010-08-05 13:15:35 [3941] [14] INFO: mmsbox.c:1366
 make_and_queue_msg
[mmsbox] [n/a] MMSBox: Queued message from service [sendmms-user],
   [transid
[Mbuni-msg.4535.x2.41.34]: 6-qf4535.2.x941.9
2010-08-05 13:15:35 [3941] [14] DEBUG: HTTP: Destroying HTTPClient
 area
0xb5900d20.
2010-08-05 13:15:35 [3941] [14] DEBUG: HTTP: Destroying HTTPClient
 for
`127.0.0.1'.
2010-08-05 13:15:35 [3941] [14] INFO: mmsbox.c:1613
   dispatch_sendmms_recv
[mmsbox] [n/a] MMSBox.mmssend: u=tester, Queued [Accepted:
Mbuni-msg.4535.x2.41.34]
2010-08-05 13:15:37 [3941] [7] DEBUG: Queued to thread 1 for
/var/spool/mbuni/mmsbox_outgoing/6/qf4535.2.x941.9, sendt=1280974535,
tnow=1280974537
arg 0: pppd
arg 1: call
arg 2: mobile-auth
   
   
Script /usr/sbin/chat -v -t15 -f
 /etc/ppp/chatscripts/mobile-modem.chat
finished (pid 4006), status = 0x5
Connect script failed
   
   
cat: /var/run/ppp0-mbuni.pid: Aucun fichier ou dossier de ce type
2010-08-05 13:15:42 [3941] [5] INFO: mmsbox_mm1.c:659 start_gprs
[mmsbox-mm1] [n/a] waiting for connection: 0, pid=4005 cpid=0,
   ifexited=1,
exitstatus=5
cat: /var/run/ppp0-mbuni.pid: Aucun fichier ou dossier de ce type
2010-08-05 13:15:47 [3941] [5] INFO: mmsbox_mm1.c:659 start_gprs
[mmsbox-mm1] [n/a] waiting for connection: 1, pid=4005 cpid=0,
   ifexited=1,
exitstatus=5
cat: /var/run/ppp0-mbuni.pid: Aucun fichier ou dossier de ce type
2010-08-05 13:15:52 [3941] [5] INFO: mmsbox_mm1.c:659 start_gprs
[mmsbox-mm1] [n/a] waiting for connection: 2, pid=4005 cpid=0,
   ifexited=1,
exitstatus=5
cat: /var/run/ppp0-mbuni.pid: Aucun fichier ou dossier de ce type
2010-08-05 13:15:57 [3941] [5] INFO: mmsbox_mm1.c:659 start_gprs

Re: [Users] Mbuni try to send POST MMS before GPRS connection is established

2010-08-04 Thread Piotr Isajew
With settings similar to yours I get the behaviour when mbuni sends
everything that is queued and then disconnects. Maybe if you patch
mmsbox_mm1.c to add a 2 second sleep at end of inner loop in
handle_mm1 function that will solve your problem. 

On Thu, Aug 05, 2010 at 02:55:16PM +1100, Emmanuel CHANSON wrote:
 Yes, by default mmsbox.conf has the following config:
 
 group = mbuni
 storage-directory = /var/spool/mbuni
 max-send-threads = 5
 maximum-send-attempts = 50
 default-message-expiry = 36
 queue-run-interval = 5
 send-attempt-back-off = 300
 sendmms-port = 10001
 
 max-send-threads set to 5 but Mbuni connect and disconnect for each MMS
 
 If this is normal behavior of Mbuni, need to check for a patch or a script
 that handle pppd
 
 Emmanuel
 
 2010/8/5 Piotr Isajew p...@ex.com.pl
 
  On Thu, Aug 05, 2010 at 04:59:59AM +0200, Emmanuel CHANSON wrote:
   I forgot to add
  
   /sbin before 'ip route' in ip-up script, now it is Ok
  
   Things is Mbuni connect to GPRS, send the MMS and disconnect just after
   although a second MMS has to be sent, reconnect, send it and disconnect?
 
  have you tried to set max-send-threads to something greater than 1?
 
  Also take a look at queue-run-interval and send-attempt-back-off
  settings.
 
  
   Is it a normal behavior ? or is it possible to keep the ppp0 open and
  send
   all MMS stored in spool before closing it ?
 
  You can always play with gprs-on and pid stuff; that would include
  setting idle timer in pppd and playing somehow with pids you pass to
  mbuni (you would need to create a kind of shielding script that
  manages pppd and ignores SIGTERM's from mbuni)
 
 
 
 
  
   Many thanks Piotr for your support, you helped me to solve this :)
  
   I plan to developp a web interface that can use mbuni to send MMS.
  
   BR,
  
   Emmanuel
  
   2010/8/5 Piotr Isajew p...@ex.com.pl
  
On Thu, Aug 05, 2010 at 01:29:24PM +1100, Emmanuel CHANSON wrote:
 Yeah, thanks Piotr,

 It seems better using 'nodetach', mbuni does not block anymore but
  retry
to
 send MMS
 but I have an issue with routing to reach MMS-C, when pppd is
  established
it
 should set the route in ip-up script: ip route to 192.168.39.201 dev
  ppp0
I
 guess?
 Can I use route add -host 192.168.39.201 gw ppp0IP@ 10.152.149.196
  show
 below somewhere ?
   
Sure. In basic configuration I used /sbin/route add -host $PROXY dev
ppp0 in ip-up, but for me proxy was directly reachable from IP
assigned by pppd. You may need to use 192.168.254.254 as gateway here.

 #!/bin/sh
 IFNAME=$1
 LOCAL_IP=$4
 REMOTE_IP=$5
 IPPARAM=$6
 *MMS_PROXY=192.168.39.201
 ip route add to $MMS_PROXY dev $IFNAME*
 # routing has been set up, so:
 ln -sf /var/run/ppp0.pid /var/run/ppp0-mbuni.pid


 but I saw in the netstat -rn output (stay few second): coming from
  pppd
 process?
 *192.168.254.254 0.0.0.0 255.255.255.255 UH0 0
 0
 ppp0

 # cat /etc/ppp/peers/options-mobile
 *ttyACM1
 115200
 lock
 crtscts
 modem
 passive
 novj
 nodefaultroute
 nodetach
 noipdefault
 usepeerdns
 noauth
 hide-password
 persist
 holdoff 10
 maxfail 0
 debug*

 *
 mmsbox.log:
 --
 2010-08-05 13:15:35 [3941] [3] DEBUG: HTTP: Creating HTTPClient for
 `127.0.0.1'.
 2010-08-05 13:15:35 [3941] [3] DEBUG: HTTP: Created HTTPClient area
 0xb5900d20.
 2010-08-05 13:15:35 [3941] [14] DEBUG: WSP: Mapping `text/plain', WSP
  1.2
to
 0x0003.
 2010-08-05 13:15:35 [3941] [14] INFO: mmsbox.c:1366
  make_and_queue_msg
 [mmsbox] [n/a] MMSBox: Queued message from service [sendmms-user],
[transid
 [Mbuni-msg.4535.x2.41.34]: 6-qf4535.2.x941.9
 2010-08-05 13:15:35 [3941] [14] DEBUG: HTTP: Destroying HTTPClient
  area
 0xb5900d20.
 2010-08-05 13:15:35 [3941] [14] DEBUG: HTTP: Destroying HTTPClient
  for
 `127.0.0.1'.
 2010-08-05 13:15:35 [3941] [14] INFO: mmsbox.c:1613
dispatch_sendmms_recv
 [mmsbox] [n/a] MMSBox.mmssend: u=tester, Queued [Accepted:
 Mbuni-msg.4535.x2.41.34]
 2010-08-05 13:15:37 [3941] [7] DEBUG: Queued to thread 1 for
 /var/spool/mbuni/mmsbox_outgoing/6/qf4535.2.x941.9, sendt=1280974535,
 tnow=1280974537
 arg 0: pppd
 arg 1: call
 arg 2: mobile-auth


 Script /usr/sbin/chat -v -t15 -f
  /etc/ppp/chatscripts/mobile-modem.chat
 finished (pid 4006), status = 0x5
 Connect script failed


 cat: /var/run/ppp0-mbuni.pid: Aucun fichier ou dossier de ce type
 2010-08-05 13:15:42 [3941] [5] INFO: mmsbox_mm1.c:659 start_gprs
 [mmsbox-mm1] [n/a] waiting for connection: 0, pid=4005 cpid=0,
ifexited=1,
 exitstatus=5
 cat: /var/run/ppp0-mbuni.pid: Aucun fichier ou dossier de ce type
 2010-08-05 13:15:47 [3941] [5] INFO: mmsbox_mm1.c:659 start_gprs
 

Re: [Users] Mbuni try to send POST MMS before GPRS connection is established

2010-08-03 Thread Piotr Isajew
You could also do this with proper if-up script. Mbuni tries to
connect to MMS proxy when it sees pppd pid file. On other hand pid
file is created _before_ interface IP and routing is set up. I solved
this by symlinking ppp pid to some path in if-up after everything is
set-up and making mbuni to look for a file on that path.

On Tue, Aug 03, 2010 at 03:13:09PM +1100, Emmanuel CHANSON wrote:
 Hello mbuni users and developers,
 
 Mbuni CVS 20100702
 Modem: Sagem My300x
 
 Purpose: Try to send MMS through MM1 GPRS modem but failed.
 
 I did not succeed to send a MMS through MM1 GPRS modem connection.
 When sending a MMS through mmsbox interface I do see the pppd process
 starting to connect to GPRS but fail the first time then succeed, but Mbuni
 says:
 
 WARNING: mmsbox_mm1.c:375 handle_mm1 [mmsbox-mm1] [n/a] *failed to start
 GPRS connection. waiting...
 *
 Mbuni did not make a retry after the GPRS connection was established.*
 
 Find below:
 *- mmsbox.log
 - messages file (pppd message)
 - mmmsbox.conf*
 
 Questions:
 **- Did you ever experiment this situation ?
 - Do I have to use another process instead of pppd ?
 - Why Mbuni does not retry to send the MMS stored in pool ?**
 **- Problem of configuration ? of mbuni or routing issue to contact MMS-C**
 *- I saw an another post where a someone implement a delay (from Ben
 Hardill):*
 --
 **In order to get it all working I had to add a small delay after starting
 PPP as Mbuni was trying to send the post before the routing was all up and
 running properly, so I have added the following just after the call to start
 ppp in mmsbox_mm1.c
 
  if (mm1-gprs_on)
 
   pid = start_gprs(mm1-gprs_on, mm1-gprs_pid);
 
   gwthread_sleep(3);   #--- short pause to allow ppp to finish
 setting up the connection
 
  if (pid  0) {
 
   mms_warning(0, mmsbox-mm1, NULL,failed to start GPRS
 connection. waiting...);*
 *--
 *
 Starting log:
 mmsbox.log:
 ---
 [r...@navette mbuni]# mmsbox /etc/mbuni/mmsbox.conf
 2010-08-03 14:31:44 [3327] [0] INFO: Debug_lvl = -1, log_file = none,
 log_lvl = 0
 2010-08-03 14:31:44 [3327] [0] INFO: Added logfile
 `/var/log/mbuni/mmsbox.log' with level `0'.
 2010-08-03 14:31:44 [3327] [0] INFO: Started access logfile
 `/var/log/mbuni/mmsbox-access.log'.
 2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 1 (mmsbox_cdr.c:(void
 *)cdr_logger_func)
 2010-08-03 14:31:44 [3327] [0] INFO: HTTP: Opening server at port 10002.
 2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 2
 (gwlib/fdset.c:poller)
 2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 3
 (gwlib/http.c:server_thread)
 2010-08-03 14:31:44 [3327] [1] DEBUG: Thread 1 (mmsbox_cdr.c:(void
 *)cdr_logger_func) maps to pid 3327.
 2010-08-03 14:31:44 [3327] [0] INFO: mmsbox_cfg.c:578 start_mmsc_from_conf
 [mmsbox] [n/a] Loaded MMSC[modem], allow=[(null)], deny=[(null)]
 group_id=[modem]
 2010-08-03 14:31:44 [3327] [0] INFO: HTTP: Opening server at port 3130.
 2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 4
 (mmsbox_mm1.c:(gwthread_func_t *)handle_notify)
 2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 5
 (mmsbox_mm1.c:(gwthread_func_t *)handle_mm1)
 2010-08-03 14:31:44 [3327] [0] INFO: mmsbox_cfg.c:529
 mmsbox_start_mmsc_conn [mmsbox] [n/a] Startup for mmsc [modem] complete
 2010-08-03 14:31:44 [3327] [2] DEBUG: Thread 2 (gwlib/fdset.c:poller) maps
 to pid 3327.
 2010-08-03 14:31:44 [3327] [0] WARNING: mmsbox_cfg.c:459
 mms_load_mmsbox_settings [mmsbox] [n/a] Empty or no password supplied for
 admin port. All requests will be allowed!
 2010-08-03 14:31:44 [3327] [0] INFO: mmsbox.c:758 main [mmsbox] [n/a]
 
 2010-08-03 14:31:44 [3327] [0] INFO: mmsbox.c:759 main [mmsbox] [n/a]
 Mbuni MMSBox  version cvs-20100702 starting
 2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 6
 (mmsbox.c:(gwthread_func_t *)sendmms_func)
 2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 7
 (mmsbox.c:(gwthread_func_t *)mmsbox_outgoing_queue_runner)
 2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 8
 (mms_queue.c:(gwthread_func_t *)tdeliver)
 2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 9
 (mms_queue.c:(gwthread_func_t *)tdeliver)
 2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 10
 (mms_queue.c:(gwthread_func_t *)tdeliver)
 2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 11
 (mms_queue.c:(gwthread_func_t *)tdeliver)
 2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 12
 (mms_queue.c:(gwthread_func_t *)tdeliver)
 2010-08-03 14:31:44 [3327] [5] DEBUG: Thread 5
 (mmsbox_mm1.c:(gwthread_func_t *)handle_mm1) maps to pid 3327.
 2010-08-03 14:31:44 [3327] [5] INFO: mmsbox_mm1.c:363 handle_mm1
 [mmsbox-mm1] [n/a] handle_mm1 started
 2010-08-03 14:31:44 [3327] [4] DEBUG: Thread 4
 (mmsbox_mm1.c:(gwthread_func_t *)handle_notify) maps to pid 3327.
 2010-08-03 14:31:44 [3327] [3] DEBUG: Thread 3 (gwlib/http.c:server_thread)
 maps to pid 

Re: [Users] Mbuni try to send POST MMS before GPRS connection is established

2010-08-03 Thread Emmanuel CHANSON
One question:

Does Mbuni will open and close GPRS connection each time it will have to
send a MMS ? or does it keep the connection always open ?
Is it a good idea to keep the GPRS connection open in case a lot of MMS have
to be send through modem?

I will check about if-up script.

Others ideas maybe ? Just to confirm that it is a normal behavior and I
should not use pppd call gprs  that lead to this behavior ?

BR,

Emmanuel

2010/8/3 Piotr Isajew p...@ex.com.pl

 You could also do this with proper if-up script. Mbuni tries to
 connect to MMS proxy when it sees pppd pid file. On other hand pid
 file is created _before_ interface IP and routing is set up. I solved
 this by symlinking ppp pid to some path in if-up after everything is
 set-up and making mbuni to look for a file on that path.

 On Tue, Aug 03, 2010 at 03:13:09PM +1100, Emmanuel CHANSON wrote:
  Hello mbuni users and developers,
 
  Mbuni CVS 20100702
  Modem: Sagem My300x
 
  Purpose: Try to send MMS through MM1 GPRS modem but failed.
 
  I did not succeed to send a MMS through MM1 GPRS modem connection.
  When sending a MMS through mmsbox interface I do see the pppd process
  starting to connect to GPRS but fail the first time then succeed, but
 Mbuni
  says:
 
  WARNING: mmsbox_mm1.c:375 handle_mm1 [mmsbox-mm1] [n/a] *failed to
 start
  GPRS connection. waiting...
  *
  Mbuni did not make a retry after the GPRS connection was established.*
 
  Find below:
  *- mmsbox.log
  - messages file (pppd message)
  - mmmsbox.conf*
 
  Questions:
  **- Did you ever experiment this situation ?
  - Do I have to use another process instead of pppd ?
  - Why Mbuni does not retry to send the MMS stored in pool ?**
  **- Problem of configuration ? of mbuni or routing issue to contact
 MMS-C**
  *- I saw an another post where a someone implement a delay (from Ben
  Hardill):*
  --
  **In order to get it all working I had to add a small delay after
 starting
  PPP as Mbuni was trying to send the post before the routing was all up
 and
  running properly, so I have added the following just after the call to
 start
  ppp in mmsbox_mm1.c
 
   if (mm1-gprs_on)
 
pid = start_gprs(mm1-gprs_on, mm1-gprs_pid);
 
gwthread_sleep(3);   #--- short pause to allow ppp to
 finish
  setting up the connection
 
   if (pid  0) {
 
mms_warning(0, mmsbox-mm1, NULL,failed to start GPRS
  connection. waiting...);*
  *--
  *
  Starting log:
  mmsbox.log:
  ---
  [r...@navette mbuni]# mmsbox /etc/mbuni/mmsbox.conf
  2010-08-03 14:31:44 [3327] [0] INFO: Debug_lvl = -1, log_file = none,
  log_lvl = 0
  2010-08-03 14:31:44 [3327] [0] INFO: Added logfile
  `/var/log/mbuni/mmsbox.log' with level `0'.
  2010-08-03 14:31:44 [3327] [0] INFO: Started access logfile
  `/var/log/mbuni/mmsbox-access.log'.
  2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 1
 (mmsbox_cdr.c:(void
  *)cdr_logger_func)
  2010-08-03 14:31:44 [3327] [0] INFO: HTTP: Opening server at port 10002.
  2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 2
  (gwlib/fdset.c:poller)
  2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 3
  (gwlib/http.c:server_thread)
  2010-08-03 14:31:44 [3327] [1] DEBUG: Thread 1 (mmsbox_cdr.c:(void
  *)cdr_logger_func) maps to pid 3327.
  2010-08-03 14:31:44 [3327] [0] INFO: mmsbox_cfg.c:578
 start_mmsc_from_conf
  [mmsbox] [n/a] Loaded MMSC[modem], allow=[(null)], deny=[(null)]
  group_id=[modem]
  2010-08-03 14:31:44 [3327] [0] INFO: HTTP: Opening server at port 3130.
  2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 4
  (mmsbox_mm1.c:(gwthread_func_t *)handle_notify)
  2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 5
  (mmsbox_mm1.c:(gwthread_func_t *)handle_mm1)
  2010-08-03 14:31:44 [3327] [0] INFO: mmsbox_cfg.c:529
  mmsbox_start_mmsc_conn [mmsbox] [n/a] Startup for mmsc [modem] complete
  2010-08-03 14:31:44 [3327] [2] DEBUG: Thread 2 (gwlib/fdset.c:poller)
 maps
  to pid 3327.
  2010-08-03 14:31:44 [3327] [0] WARNING: mmsbox_cfg.c:459
  mms_load_mmsbox_settings [mmsbox] [n/a] Empty or no password supplied
 for
  admin port. All requests will be allowed!
  2010-08-03 14:31:44 [3327] [0] INFO: mmsbox.c:758 main [mmsbox] [n/a]
  
  2010-08-03 14:31:44 [3327] [0] INFO: mmsbox.c:759 main [mmsbox] [n/a]
  Mbuni MMSBox  version cvs-20100702 starting
  2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 6
  (mmsbox.c:(gwthread_func_t *)sendmms_func)
  2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 7
  (mmsbox.c:(gwthread_func_t *)mmsbox_outgoing_queue_runner)
  2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 8
  (mms_queue.c:(gwthread_func_t *)tdeliver)
  2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 9
  (mms_queue.c:(gwthread_func_t *)tdeliver)
  2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 10
  (mms_queue.c:(gwthread_func_t *)tdeliver)
  2010-08-03 14:31:44 [3327] [0] DEBUG: Started 

Re: [Users] Mbuni try to send POST MMS before GPRS connection is established

2010-08-03 Thread Piotr Isajew
On Tue, Aug 03, 2010 at 05:44:30PM +1100, Emmanuel CHANSON wrote:
 One question:
 
 Does Mbuni will open and close GPRS connection each time it will have to
 send a MMS ? or does it keep the connection always open ?

It opens connection once there is something in queue and keeps it open
until processing queue is empty. In reality to achieve this you should
have max-send-threads slightly higher than amount of modems
used. I.e. for one modem you shoud have 2 sending threads. With one
thread it will open and close the connection for each message.

 Is it a good idea to keep the GPRS connection open in case a lot of MMS have
 to be send through modem?

If you have lots to send you could write fake start-gprs script that
does nothing and start persistent pppd connection outside of
mbuni. That could evolve to inteligent start-gprs script that starts
gprs connection once something appears on queue and stays open for
some idle period while cheating mbuni for closing connection (mbuni
kills pid given in pid file when it does not need gprs connection any more)


 
 I will check about if-up script.
 
 Others ideas maybe ? Just to confirm that it is a normal behavior and I
 should not use pppd call gprs  that lead to this behavior ?

depends on your options. To be more specific using 'nodetach' option
of pppd works better for me.

 
 BR,
 
 Emmanuel
 
 2010/8/3 Piotr Isajew p...@ex.com.pl
 
  You could also do this with proper if-up script. Mbuni tries to
  connect to MMS proxy when it sees pppd pid file. On other hand pid
  file is created _before_ interface IP and routing is set up. I solved
  this by symlinking ppp pid to some path in if-up after everything is
  set-up and making mbuni to look for a file on that path.
 
  On Tue, Aug 03, 2010 at 03:13:09PM +1100, Emmanuel CHANSON wrote:
   Hello mbuni users and developers,
  
   Mbuni CVS 20100702
   Modem: Sagem My300x
  
   Purpose: Try to send MMS through MM1 GPRS modem but failed.
  
   I did not succeed to send a MMS through MM1 GPRS modem connection.
   When sending a MMS through mmsbox interface I do see the pppd process
   starting to connect to GPRS but fail the first time then succeed, but
  Mbuni
   says:
  
   WARNING: mmsbox_mm1.c:375 handle_mm1 [mmsbox-mm1] [n/a] *failed to
  start
   GPRS connection. waiting...
   *
   Mbuni did not make a retry after the GPRS connection was established.*
  
   Find below:
   *- mmsbox.log
   - messages file (pppd message)
   - mmmsbox.conf*
  
   Questions:
   **- Did you ever experiment this situation ?
   - Do I have to use another process instead of pppd ?
   - Why Mbuni does not retry to send the MMS stored in pool ?**
   **- Problem of configuration ? of mbuni or routing issue to contact
  MMS-C**
   *- I saw an another post where a someone implement a delay (from Ben
   Hardill):*
   --
   **In order to get it all working I had to add a small delay after
  starting
   PPP as Mbuni was trying to send the post before the routing was all up
  and
   running properly, so I have added the following just after the call to
  start
   ppp in mmsbox_mm1.c
  
if (mm1-gprs_on)
  
 pid = start_gprs(mm1-gprs_on, mm1-gprs_pid);
  
 gwthread_sleep(3);   #--- short pause to allow ppp to
  finish
   setting up the connection
  
if (pid  0) {
  
 mms_warning(0, mmsbox-mm1, NULL,failed to start GPRS
   connection. waiting...);*
   *--
   *
   Starting log:
   mmsbox.log:
   ---
   [r...@navette mbuni]# mmsbox /etc/mbuni/mmsbox.conf
   2010-08-03 14:31:44 [3327] [0] INFO: Debug_lvl = -1, log_file = none,
   log_lvl = 0
   2010-08-03 14:31:44 [3327] [0] INFO: Added logfile
   `/var/log/mbuni/mmsbox.log' with level `0'.
   2010-08-03 14:31:44 [3327] [0] INFO: Started access logfile
   `/var/log/mbuni/mmsbox-access.log'.
   2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 1
  (mmsbox_cdr.c:(void
   *)cdr_logger_func)
   2010-08-03 14:31:44 [3327] [0] INFO: HTTP: Opening server at port 10002.
   2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 2
   (gwlib/fdset.c:poller)
   2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 3
   (gwlib/http.c:server_thread)
   2010-08-03 14:31:44 [3327] [1] DEBUG: Thread 1 (mmsbox_cdr.c:(void
   *)cdr_logger_func) maps to pid 3327.
   2010-08-03 14:31:44 [3327] [0] INFO: mmsbox_cfg.c:578
  start_mmsc_from_conf
   [mmsbox] [n/a] Loaded MMSC[modem], allow=[(null)], deny=[(null)]
   group_id=[modem]
   2010-08-03 14:31:44 [3327] [0] INFO: HTTP: Opening server at port 3130.
   2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 4
   (mmsbox_mm1.c:(gwthread_func_t *)handle_notify)
   2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 5
   (mmsbox_mm1.c:(gwthread_func_t *)handle_mm1)
   2010-08-03 14:31:44 [3327] [0] INFO: mmsbox_cfg.c:529
   mmsbox_start_mmsc_conn [mmsbox] [n/a] Startup for mmsc [modem] complete
   2010-08-03 14:31:44 [3327] [2] DEBUG: Thread 2 

Re: [Users] Mbuni try to send POST MMS before GPRS connection is established

2010-08-03 Thread Emmanuel CHANSON
Is it possible to get an example of the if-up/down script that deal with
ppp0.pid symlink so that Mbuni start to send MMS only after the ppp0
connection is established?

I notice that routing is also missing after the GPRS connection is
established that is why maybe mbuni POST nothing.
I need to set a route add mmsproxyip@ gw ppp0 in order to reach MMS-C

One question about the port parameter:
# Sample conf for MMSBox using a modem (MM1)
group = mmsc
id = modem
type = custom
custom-settings = gprs-on=pppd call mobile-auth;gprs-pid=cat
/var/run/ppp0.pid|head -1;port=3130;mmsc-url=
http://mms.x.xx/mmsc;proxy=192.168.39.201;msisdn=100;
mmsc-library = /usr/local/lib/libmmsbox_mm1.

Is it the same to use port=*3130* and mmsc-url=http://mmscurl;pro...@ip:*
3130* ? in the mmsbox.conf?
In my case I use port=3130 and does not set a :port on the proxy parameter
in mmsc-url

Regards  thanks for your help

Emmanuel

2010/8/3 Piotr Isajew p...@ex.com.pl

 On Tue, Aug 03, 2010 at 05:44:30PM +1100, Emmanuel CHANSON wrote:
  One question:
 
  Does Mbuni will open and close GPRS connection each time it will have to
  send a MMS ? or does it keep the connection always open ?

 It opens connection once there is something in queue and keeps it open
 until processing queue is empty. In reality to achieve this you should
 have max-send-threads slightly higher than amount of modems
 used. I.e. for one modem you shoud have 2 sending threads. With one
 thread it will open and close the connection for each message.

  Is it a good idea to keep the GPRS connection open in case a lot of MMS
 have
  to be send through modem?

 If you have lots to send you could write fake start-gprs script that
 does nothing and start persistent pppd connection outside of
 mbuni. That could evolve to inteligent start-gprs script that starts
 gprs connection once something appears on queue and stays open for
 some idle period while cheating mbuni for closing connection (mbuni
 kills pid given in pid file when it does not need gprs connection any more)


 
  I will check about if-up script.
 
  Others ideas maybe ? Just to confirm that it is a normal behavior and I
  should not use pppd call gprs  that lead to this behavior ?

 depends on your options. To be more specific using 'nodetach' option
 of pppd works better for me.

 
  BR,
 
  Emmanuel
 
  2010/8/3 Piotr Isajew p...@ex.com.pl
 
   You could also do this with proper if-up script. Mbuni tries to
   connect to MMS proxy when it sees pppd pid file. On other hand pid
   file is created _before_ interface IP and routing is set up. I solved
   this by symlinking ppp pid to some path in if-up after everything is
   set-up and making mbuni to look for a file on that path.
  
   On Tue, Aug 03, 2010 at 03:13:09PM +1100, Emmanuel CHANSON wrote:
Hello mbuni users and developers,
   
Mbuni CVS 20100702
Modem: Sagem My300x
   
Purpose: Try to send MMS through MM1 GPRS modem but failed.
   
I did not succeed to send a MMS through MM1 GPRS modem connection.
When sending a MMS through mmsbox interface I do see the pppd process
starting to connect to GPRS but fail the first time then succeed, but
   Mbuni
says:
   
WARNING: mmsbox_mm1.c:375 handle_mm1 [mmsbox-mm1] [n/a] *failed to
   start
GPRS connection. waiting...
*
Mbuni did not make a retry after the GPRS connection was
 established.*
   
Find below:
*- mmsbox.log
- messages file (pppd message)
- mmmsbox.conf*
   
Questions:
**- Did you ever experiment this situation ?
- Do I have to use another process instead of pppd ?
- Why Mbuni does not retry to send the MMS stored in pool ?**
**- Problem of configuration ? of mbuni or routing issue to contact
   MMS-C**
*- I saw an another post where a someone implement a delay (from Ben
Hardill):*
--
**In order to get it all working I had to add a small delay after
   starting
PPP as Mbuni was trying to send the post before the routing was all
 up
   and
running properly, so I have added the following just after the call
 to
   start
ppp in mmsbox_mm1.c
   
 if (mm1-gprs_on)
   
  pid = start_gprs(mm1-gprs_on, mm1-gprs_pid);
   
  gwthread_sleep(3);   #--- short pause to allow ppp to
   finish
setting up the connection
   
 if (pid  0) {
   
  mms_warning(0, mmsbox-mm1, NULL,failed to start GPRS
connection. waiting...);*
*--
*
Starting log:
mmsbox.log:
---
[r...@navette mbuni]# mmsbox /etc/mbuni/mmsbox.conf
2010-08-03 14:31:44 [3327] [0] INFO: Debug_lvl = -1, log_file =
 none,
log_lvl = 0
2010-08-03 14:31:44 [3327] [0] INFO: Added logfile
`/var/log/mbuni/mmsbox.log' with level `0'.
2010-08-03 14:31:44 [3327] [0] INFO: Started access logfile
`/var/log/mbuni/mmsbox-access.log'.
2010-08-03 14:31:44 [3327] [0] DEBUG: 

Re: [Users] Mbuni try to send POST MMS before GPRS connection is established

2010-08-03 Thread Piotr Isajew
Mbuni uses curl to connect() to proxy. This is issued just after
start-gprs pid is returned so on normal system it uses default
route, which is not good because of firewalling and most ops using
private addresses for mmsc's. From what I saw (maybe someone will
correct me here) mmsbox-mm1 does not set any connection timeouts on
CURL and default is to wait indefinitly (or at least very long). So
handle_mm1 thread blocks here.


On Wed, Aug 04, 2010 at 02:15:46PM +1100, Emmanuel CHANSON wrote:
 I also dont understand why mbuni does not retry to send the MMS stored in
 spool after the ppp0 connection is up ?
 
 mbuni stay blocked:
 
 2010-08-04 13:52:37 [10240] [5] INFO: mmsbox_mm1.c:659 start_gprs
 [mmsbox-mm1] [n/a] waiting for connection: 0, pid=10263 cpid=10263,
 ifexited=1, exitstatus=0
 2010-08-04 13:52:37 [10240] [5] WARNING: mmsbox_mm1.c:375 handle_mm1
 [mmsbox-mm1] [n/a] failed to start GPRS connection. waiting...
 
 Emmanuel
 2010-08-03 14:31:44 [3327] [14] DEBUG: Thread 14
 (mms_queue.c:(gwthread_func_t *)tdeliver) maps to pid 3327.


 MMS send through MMS interface of mmsbox:
 # lynx -dump 

   
  http://localhost:10002/?username=testerpassword=foobarmmsc=modemto=%2B87773502/TYPE=PLMNsubject=Testtext=MMS-1
 
   Accepted: Mbuni-msg.7610.x1.24.85

 mmsbox.log generated after the MMS:
 
 2010-08-03 14:53:30 [2324] [3] DEBUG: HTTP: Creating HTTPClient for
 `127.0.0.1'.
 2010-08-03 14:53:30 [2324] [3] DEBUG: HTTP: Created HTTPClient area
 0xb5700ab0.
 2010-08-03 14:53:30 [2324] [18] DEBUG: WSP: Mapping `text/plain',
  WSP 1.2
to
 0x0003.
 2010-08-03 14:53:30 [2324] [18] INFO: mmsbox.c:1366
  make_and_queue_msg
 [mmsbox] [n/a] MMSBox: Queued message from service [sendmms-user],
[transid
 [Mbuni-msg.7610.x1.24.85]: q-qf7610.1.x324.69
 2010-08-03 14:53:30 [2324] [18] DEBUG: HTTP: Destroying HTTPClient
  area
 0xb5700ab0.
 2010-08-03 14:53:30 [2324] [18] DEBUG: HTTP: Destroying HTTPClient
  for
 `127.0.0.1'.
 2010-08-03 14:53:30 [2324] [18] INFO: mmsbox.c:1613
dispatch_sendmms_recv
 [mmsbox] [n/a] MMSBox.mmssend: u=tester, Queued [Accepted:
 Mbuni-msg.7610.x1.24.85]
 2010-08-03 14:53:35 [2324] [7] DEBUG: Queued to thread 0 for
 /var/spool/mbuni/mmsbox_outgoing/q/qf7610.1.x324.69,
  sendt=1280807610,
 tnow=1280807615
 arg 0: pppd
 arg 1: call
 arg 2: mobile-auth
 cat: /var/run/ppp0.pid: Aucun fichier ou dossier de ce type
 2010-08-03 14:53:40 [2324] [5] INFO: mmsbox_mm1.c:659 start_gprs
 [mmsbox-mm1] [n/a] waiting for connection: 0, pid=2457 cpid=2457,
 ifexited=1, exitstatus=0
 2010-08-03 14:53:40 [2324] [5] WARNING: mmsbox_mm1.c:375
  handle_mm1
 [mmsbox-mm1] [n/a] *failed to start GPRS connection. waiting...*

 /var/log/messages:
 
 Aug  3 14:53:35 navette kernel: PPP generic driver version 2.4.2
 Aug  3 14:53:35 navette pppd[2462]: pppd 2.4.5 started by admin, uid
  0
 Aug  3 14:53:36 navette chat[2463]: abort on (BUSY)
 Aug  3 14:53:36 navette chat[2463]: abort on (NO CARRIER)
 Aug  3 14:53:36 navette chat[2463]: abort on (VOICE)
 Aug  3 14:53:36 navette chat[2463]: abort on (NO DIALTONE)
 Aug  3 14:53:36 navette chat[2463]: abort on (NO DIAL TONE)
 Aug  3 14:53:36 navette chat[2463]: abort on (NO ANSWER)
 Aug  3 14:53:36 navette chat[2463]: abort on (DELAYED)
 Aug  3 14:53:36 navette chat[2463]: report (CONNECT)
 Aug  3 14:53:36 navette chat[2463]: timeout set to 6 seconds
 Aug  3 14:53:36 navette chat[2463]: send (ATQ0^M)
 Aug  3 14:53:36 navette chat[2463]: expect (OK)
 Aug  3 14:53:36 navette chat[2463]: ^M
 Aug  3 14:53:36 navette chat[2463]: OK
 Aug  3 14:53:36 navette chat[2463]:  -- got it
 Aug  3 14:53:36 navette chat[2463]: send (ATZ^M)
 Aug  3 14:53:37 navette chat[2463]: timeout set to 3 seconds
 Aug  3 14:53:37 navette chat[2463]: expect (OK)
 Aug  3 14:53:37 navette chat[2463]: ^M
 Aug  3 14:53:37 navette chat[2463]: ^M
 Aug  3 14:53:37 navette chat[2463]: OK
 Aug  3 14:53:37 navette chat[2463]:  -- got it
 Aug  3 14:53:37 navette chat[2463]: send (AT^M)
 Aug  3 14:53:37 navette chat[2463]: expect (OK)
 Aug  3 14:53:37 navette chat[2463]: ^M
 Aug  3 14:53:40 navette chat[2463]: alarm
 Aug  3 14:53:40 navette chat[2463]: send (AT^M)
 Aug  3 14:53:40 navette chat[2463]: expect (OK)
 Aug  3 14:53:40 navette chat[2463]: AT^M^M
 Aug  3 14:53:40 navette chat[2463]: OK
 Aug  3 14:53:40 navette chat[2463]:  -- got it
 Aug  3 14:53:40 navette chat[2463]: send (ATI^M)
 Aug  3 14:53:40 navette chat[2463]: expect (OK)
 Aug  3 14:53:40 navette chat[2463]: ^M
 Aug  3 14:53:40 navette chat[2463]: ATI^M^M
 Aug  3 14:53:40 navette chat[2463]: my300X GPRS^M
 Aug  3 14:53:40 navette chat[2463]: 

Re: [Users] Mbuni try to send POST MMS before GPRS connection is established

2010-08-03 Thread Piotr Isajew
On Wed, Aug 04, 2010 at 07:14:52AM +0200, Emmanuel CHANSON wrote:
 Thanks Piotr for this,
 
 One more questions:
 Where and when do I call ip-up.sh $1 $2 ... and then call pppd ? All
 inside custom-settings gprs-on= option ?

it's enough if you symlink it to /etc/ppp/ip-up. From pppd manual:

   /etc/ppp/ip-up
  A program or script which is executed when the link is available
  for  sending  and  receiving  IP packets (that is, IPCP has come
  up).  It is executed with the parameters

  interface-name  tty-device  speed   local-IP-address
  remote-IP-address ipparam


 
 I miss some experience on this
 
 About:
 *Mbuni uses curl to connect() to proxy. This is issued just after start-gprs
 pid is returned so on normal system it uses default
 route, which is not good because of firewalling and most ops using private
 addresses for mmsc's. From what I saw (maybe someone will correct me here)
 mmsbox-mm1 does not set any connection timeouts on CURL and default is to
 wait indefinitly (or at least very long). So handle_mm1 thread blocks here.*
 
 I understand that if ppp0 connection is not well established before Mbuni
 try to send MMS, Mbuni blocks and becomes unsuable ?

That's mine experience with it. 

 So I really have to make ppp0 connection ready and ip routing to reach MMS-C
 configured, before Mbuni it try to send any MMS right ? or patch
 mmsbox_mm1/curl function to add a timeout ? or fasten my GPRS connection
 process (because 1st try failed and second try successfully connect to GPRS
 always)?
 Is this issue due to my pppd config? the modem I use ? Is it a normal
 behavior ?

That may be due to imperfect chat script. You should check your logs
to find a reason. On the other way it can always happen that you can
temporarily lost connection with MMSC even with perfect configuration
on your side. IMO modifying mmsbox_mm1 is the only way to get rid of
the problem in production environment. I've modified mmsbox_mm1.c to
fix problems with this. I'll send a patch to devel list later.

 I plan to test using Huawei E220 modem maybe it will be better.
 
 I try tu understand if all mbuni user had same problem when using MM1
 interface through a modem
 
 BR,
 
 Emmanuel
 
 custom-settings = gprs-on=pppd call mobile-auth;gprs-pid=cat
  /var/run/ppp0.pid|head -1;port=3130;mmsc-url=
  http://mms.x.xx/mmsc;proxy=192.168.39.201;msisdn=100;
  mmsc-library = /usr/local/lib/libmmsbox_mm1.
 
 2010/8/4 Piotr Isajew p...@ex.com.pl
 
  On Wed, Aug 04, 2010 at 04:01:22AM +0200, Emmanuel CHANSON wrote:
   Is it possible to get an example of the if-up/down script that deal with
   ppp0.pid symlink so that Mbuni start to send MMS only after the ppp0
   connection is established?
  You may try something like:
  ip-up.sh:
  IFNAME=$1
  LOCAL_IP=$4
  REMOTE_IP=$5
  IPPARAM=$6
  MMS_PROXY=your mmsc proxy ip
  ip route add to $MMS_PROXY dev $IFNAME
  # routing has been set up, so:
  ln -sf /var/run/ppp-${IPPARAM}.pid /var/run/ppp-for-mbuni.pid
 
  then start pppd with:
  nodetach
  linkname mms
  ipparam mms
 
  and watch for it's pid in mbuni with something like:
  gprs-pid=cat /var/run/ppp-for-mbuni.pid|head -1
 
  
   I notice that routing is also missing after the GPRS connection is
   established that is why maybe mbuni POST nothing.
   I need to set a route add mmsproxyip@ gw ppp0 in order to reach
   MMS-C
  Yes
  
   One question about the port parameter:
   # Sample conf for MMSBox using a modem (MM1)
   group = mmsc
   id = modem
   type = custom
   custom-settings = gprs-on=pppd call mobile-auth;gprs-pid=cat
   /var/run/ppp0.pid|head -1;port=3130;mmsc-url=
   http://mms.x.xx/mmsc;proxy=192.168.39.201;msisdn=100;
   mmsc-library = /usr/local/lib/libmmsbox_mm1.
  
   Is it the same to use port=*3130* and mmsc-url=http://mmscurl
  ;pro...@ip:*
   3130* ? in the mmsbox.conf?
   In my case I use port=3130 and does not set a :port on the proxy
  parameter
   in mmsc-url
 
  No. port in settings is for other applications (like kannel) to
  communicate with mmsbox i.e. to trigger fetch actions. To specify your
  operator's mmsc port use :port in mmsc url or proxy settings depending
  on your MMSC settings.
  
   Regards  thanks for your help
  
   Emmanuel
  
   2010/8/3 Piotr Isajew p...@ex.com.pl
  
On Tue, Aug 03, 2010 at 05:44:30PM +1100, Emmanuel CHANSON wrote:
 One question:

 Does Mbuni will open and close GPRS connection each time it will have
  to
 send a MMS ? or does it keep the connection always open ?
   
It opens connection once there is something in queue and keeps it open
until processing queue is empty. In reality to achieve this you should
have max-send-threads slightly higher than amount of modems
used. I.e. for one modem you shoud have 2 sending threads. With one
thread it will open and close the connection for each message.
   
 Is it a good idea to keep the GPRS connection open in 

[Users] Mbuni try to send POST MMS before GPRS connection is established

2010-08-02 Thread Emmanuel CHANSON
Hello mbuni users and developers,

Mbuni CVS 20100702
Modem: Sagem My300x

Purpose: Try to send MMS through MM1 GPRS modem but failed.

I did not succeed to send a MMS through MM1 GPRS modem connection.
When sending a MMS through mmsbox interface I do see the pppd process
starting to connect to GPRS but fail the first time then succeed, but Mbuni
says:

WARNING: mmsbox_mm1.c:375 handle_mm1 [mmsbox-mm1] [n/a] *failed to start
GPRS connection. waiting...
*
Mbuni did not make a retry after the GPRS connection was established.*

Find below:
*- mmsbox.log
- messages file (pppd message)
- mmmsbox.conf*

Questions:
**- Did you ever experiment this situation ?
- Do I have to use another process instead of pppd ?
- Why Mbuni does not retry to send the MMS stored in pool ?**
**- Problem of configuration ? of mbuni or routing issue to contact MMS-C**
*- I saw an another post where a someone implement a delay (from Ben
Hardill):*
--
**In order to get it all working I had to add a small delay after starting
PPP as Mbuni was trying to send the post before the routing was all up and
running properly, so I have added the following just after the call to start
ppp in mmsbox_mm1.c

 if (mm1-gprs_on)

  pid = start_gprs(mm1-gprs_on, mm1-gprs_pid);

  gwthread_sleep(3);   #--- short pause to allow ppp to finish
setting up the connection

 if (pid  0) {

  mms_warning(0, mmsbox-mm1, NULL,failed to start GPRS
connection. waiting...);*
*--
*
Starting log:
mmsbox.log:
---
[r...@navette mbuni]# mmsbox /etc/mbuni/mmsbox.conf
2010-08-03 14:31:44 [3327] [0] INFO: Debug_lvl = -1, log_file = none,
log_lvl = 0
2010-08-03 14:31:44 [3327] [0] INFO: Added logfile
`/var/log/mbuni/mmsbox.log' with level `0'.
2010-08-03 14:31:44 [3327] [0] INFO: Started access logfile
`/var/log/mbuni/mmsbox-access.log'.
2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 1 (mmsbox_cdr.c:(void
*)cdr_logger_func)
2010-08-03 14:31:44 [3327] [0] INFO: HTTP: Opening server at port 10002.
2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 2
(gwlib/fdset.c:poller)
2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 3
(gwlib/http.c:server_thread)
2010-08-03 14:31:44 [3327] [1] DEBUG: Thread 1 (mmsbox_cdr.c:(void
*)cdr_logger_func) maps to pid 3327.
2010-08-03 14:31:44 [3327] [0] INFO: mmsbox_cfg.c:578 start_mmsc_from_conf
[mmsbox] [n/a] Loaded MMSC[modem], allow=[(null)], deny=[(null)]
group_id=[modem]
2010-08-03 14:31:44 [3327] [0] INFO: HTTP: Opening server at port 3130.
2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 4
(mmsbox_mm1.c:(gwthread_func_t *)handle_notify)
2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 5
(mmsbox_mm1.c:(gwthread_func_t *)handle_mm1)
2010-08-03 14:31:44 [3327] [0] INFO: mmsbox_cfg.c:529
mmsbox_start_mmsc_conn [mmsbox] [n/a] Startup for mmsc [modem] complete
2010-08-03 14:31:44 [3327] [2] DEBUG: Thread 2 (gwlib/fdset.c:poller) maps
to pid 3327.
2010-08-03 14:31:44 [3327] [0] WARNING: mmsbox_cfg.c:459
mms_load_mmsbox_settings [mmsbox] [n/a] Empty or no password supplied for
admin port. All requests will be allowed!
2010-08-03 14:31:44 [3327] [0] INFO: mmsbox.c:758 main [mmsbox] [n/a]

2010-08-03 14:31:44 [3327] [0] INFO: mmsbox.c:759 main [mmsbox] [n/a]
Mbuni MMSBox  version cvs-20100702 starting
2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 6
(mmsbox.c:(gwthread_func_t *)sendmms_func)
2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 7
(mmsbox.c:(gwthread_func_t *)mmsbox_outgoing_queue_runner)
2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 8
(mms_queue.c:(gwthread_func_t *)tdeliver)
2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 9
(mms_queue.c:(gwthread_func_t *)tdeliver)
2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 10
(mms_queue.c:(gwthread_func_t *)tdeliver)
2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 11
(mms_queue.c:(gwthread_func_t *)tdeliver)
2010-08-03 14:31:44 [3327] [0] DEBUG: Started thread 12
(mms_queue.c:(gwthread_func_t *)tdeliver)
2010-08-03 14:31:44 [3327] [5] DEBUG: Thread 5
(mmsbox_mm1.c:(gwthread_func_t *)handle_mm1) maps to pid 3327.
2010-08-03 14:31:44 [3327] [5] INFO: mmsbox_mm1.c:363 handle_mm1
[mmsbox-mm1] [n/a] handle_mm1 started
2010-08-03 14:31:44 [3327] [4] DEBUG: Thread 4
(mmsbox_mm1.c:(gwthread_func_t *)handle_notify) maps to pid 3327.
2010-08-03 14:31:44 [3327] [3] DEBUG: Thread 3 (gwlib/http.c:server_thread)
maps to pid 3327.
2010-08-03 14:31:44 [3327] [10] DEBUG: Thread 10
(mms_queue.c:(gwthread_func_t *)tdeliver) maps to pid 3327.
2010-08-03 14:31:44 [3327] [9] DEBUG: Thread 9 (mms_queue.c:(gwthread_func_t
*)tdeliver) maps to pid 3327.
2010-08-03 14:31:44 [3327] [6] DEBUG: Thread 6 (mmsbox.c:(gwthread_func_t
*)sendmms_func) maps to pid 3327.
2010-08-03 14:31:44 [3327] [11] DEBUG: Thread 11
(mms_queue.c:(gwthread_func_t *)tdeliver) maps to pid 3327.
2010-08-03 14:31:44 [3327] [8] DEBUG: Thread 8