This is what I'm trying to do. Can someone suggest code for this following spameden's suggestion to edit smsbox.c?
<?xml version="1.0" encoding="utf-8"?> <message> <submit> <da><number>222222222</number></da> <oa><number>yosup</number></oa> <ud>message number one</ud> <da><number>333333333</number></da> <oa><number>supyo</number></oa> <ud>message number two</ud> <da><number>444444444</number></da> <oa><number>yalls</number></oa> <ud>message number 3re</ud> <from> <username>your_username</username> <password>your_pass</password> </from> </submit> </message> Best Regards, Michael C. Nwaogu ________________________________ From: spameden <spame...@gmail.com> To: Mike Nwaogu <michael_nwa...@yahoo.com> Cc: "users@kannel.org" <users@kannel.org> Sent: Tuesday, October 30, 2012 1:34 AM Subject: Re: XML POST, multiple messages to multiple recipients I think this should be in the user-guide as well :p care to make a patch to the current snapshot and add this, Mike? 2012/10/30 spameden <spame...@gmail.com> Here is what I've used: > > ><?xml version="1.0" encoding="utf-8"?> ><message> > <submit> > <da> > <number>222222222</number> > <number>1234567</number> > <number>123456</number> > </da> > <oa><number>yosup</number></oa> > > <ud>message number one</ud> > > <from> > <username>your_username</username> > <password>your_pass</password> > </from> > <smsc>mysmsc</smsc> > </submit> ></message> > >curl -X POST -d @xml_post -H "Content-Type: text/xml" >http://localhost:13013/cgi-bin/sendsms >0: Accepted for delivery > >by looking into kannel's status i can see 3 messages were sent. > >so it's all working correctly, enjoy :) > > > >2012/10/30 spameden <spame...@gmail.com> > >I was looking into the code actually there is a handling of multiple numbers: >> >>from gw/smsbox.c: >> >> 705 /* to (da/number) Multiple tags */ >> 706 xpathObj = xmlXPathEvalExpression(BAD_CAST >>"/message/submit/da/number/text()", xpathCtx); >> 707 if (xpathObj != NULL && >>!xmlXPathNodeSetIsEmpty(xpathObj->nodesetval)) { >> 708 int i; >> 709 >> 710 *tolist = gwlist_create(); >> 711 for (i = 0; i < xpathObj->nodesetval->nodeNr; i++) { >> 712 if (xpathObj->nodesetval->nodeTab[i]->type != XML_TEXT_NODE) >> 713 continue; >> 714 xml_string = >>xmlXPathCastNodeToString(xpathObj->nodesetval->nodeTab[i]); >> 715 tmp = octstr_create((const char*) >>xpathObj->nodesetval->nodeTab[i]->content); >> 716 xmlFree(xml_string); >> 717 octstr_strip_blanks(tmp); >> 718 gwlist_append(*tolist, tmp); >> 719 } >> 720 } >> 721 if (xpathObj != NULL) >> 722 xmlXPathFreeObject(xpathObj); >> >>you can clearly see *tolist is being populated with items, now the question >>is what are you doing wrong, maybe XML should be bit different >> >> >> >>2012/10/30 Mike Nwaogu <michael_nwa...@yahoo.com> >> >>Thanks for getting back, >>>Which file specifically? >>> >>> >>> >>>Best Regards, >>>Michael C. Nwaogu >>> >>> >>>________________________________ >>> >>>From: spameden <spame...@gmail.com> >>>To: Mike Nwaogu <michael_nwa...@yahoo.com> >>>Cc: "users@kannel.org" <users@kannel.org> >>>Sent: Monday, October 29, 2012 8:31 PM >>> >>>Subject: Re: XML POST, multiple messages to multiple recipients >>> >>> >>> >>>You can modify kannel's sources to implement this. >>> >>> >>>2012/10/29 Mike Nwaogu <michael_nwa...@yahoo.com> >>> >>>Hello am I to assume there's no solution to this problem? >>>> >>>>Its been unanswered for days now. >>>> >>>> >>>>Best Regards, >>>>Michael C. Nwaogu >>>> >>>> >>>>________________________________ >>>> From: Mike Nwaogu <michael_nwa...@yahoo.com> >>>>To: "users@kannel.org" <users@kannel.org> >>>>Sent: Friday, October 26, 2012 12:46 PM >>>>Subject: Re: XML POST, multiple messages to multiple recipients >>>> >>>> >>>> >>>>Hello All, >>>>Please can someone help with the queries below. >>>> >>>>Has Anyone tried this in the past and how did you cross the barrier. >>>> >>>>I saw a post without response too as early-on as March 2012. >>>>Please oblige. >>>> >>>> >>>>Best Regards, >>>>Michael C. Nwaogu >>>> >>>> >>>>________________________________ >>>> From: Mike Nwaogu <michael_nwa...@yahoo.com> >>>>To: "users@kannel.org" <users@kannel.org> >>>>Sent: Wednesday, October 24, 2012 3:55 PM >>>>Subject: XML POST, multiple messages to multiple recipients >>>> >>>> >>>>Hello All, >>>>I'm trying to send many messages at the same time in one XML post, the post >>>>is accepted but only the first message "message number one" is sent to all >>>>the listed recipients >>>>[111111111 and 222222222]. >>>> >>>>My question is: since Kannel can accept multiple recipients, how do I >>>>format the xml to support multiple messages too. >>>> >>>>My format is as show below. All comments are duly appreciated. >>>> >>>> >>>> >>>>============= START ============ >>>><?xml version="1.0" encoding="utf-8"?> >>>><message> >>>> <submit> >>>> <da><number>222222222</number></da> >>>> <oa><number>98765</number></oa> >>>> <ud>message number one</ud> >>>> >>>> <da><number>111111111</number></da> >>>> <oa><number>12345</number></oa> >>>> <ud>message number two</ud> >>>> >>>> <from> >>>> <user>foo</user> >>>> <pass>bar</pass> >>>> </from> >>>> </submit> >>>></message> >>>>============= END ============== >>>> >>>>Best Regards, >>>>Michael C. Nwaogu >>>> >>>> >>>> >>>> >>> >>> >>> >> >